/*---------------------------------------------------------—
  CleanRP SoundMaster
  
  Copyright © 2017 Jonas Hogeback / UltimateRP
  All Rights Reserved
  Website: UltimateRP.net
—-----------------------------------------------------------*/

SoundMaster = SoundMaster or {}

-- SoundMaster.BoughtSound(Player(), Typ String, Mode String)	
-- Example: 
-- SoundMaster.BoughtSound(ply,"ca_ching", "local")	
function SoundMaster.BoughtSound(activator,typ,mode)	
		-- Sound Type
		if (typ == "ca_ching") then
			pitch = math.random(70, 130)
			sound = "soundmaster/bought/cash.mp3"
		end
		
		-- Local or Global	
		if (mode == "global") then
			activator:EmitSound(sound, 100, pitch)	
		elseif (mode == "local") then
			activator:SendLua("LocalPlayer():EmitSound('"..sound.."', 100, "..pitch..")");
		end
end