Jump to content

playSound3D


Padul

Recommended Posts

Posted


addEventHandler("onClientKey",root,function(button,pressed)
	if isPlayerInVehicle(localPlayer) then
		local veh=getPlayerOccupiedVehicle (localPlayer)
		local x,y,z = getElementPosition(veh)
		if button=="8" and pressed==true then
			triggerEvent("wlaczPoganiacz",root,veh,x,y,z)
		elseif button=="8" and pressed==false then
			triggerEvent("wylaczPoganiacz",root,veh)
		end
	end
end)

addEvent("wlaczPoganiacz",true)
addEventHandler("wlaczPoganiacz",getResourceRootElement(getThisResource()),function(veh,x,y,z)
	poganiacz=playSound3D("zyla.ogg",x,y,z,true)
	attachElements(poganiacz,veh)
end)

addEvent("wylaczPoganiacz",true)
addEventHandler("wylaczPoganiacz",getResourceRootElement(getThisResource()),function(veh)
	destroyElement(poganiacz)
end)

how can i make it play for all player on server? not just me

Posted

if i do trigger server then client event it will be still the same rootElement so it will be working only for me

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...