Padul Posted March 10, 2017 Share Posted March 10, 2017 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 Link to comment
Mr.Loki Posted March 10, 2017 Share Posted March 10, 2017 triggerServerEvent triggerClientEvent Link to comment
Padul Posted March 11, 2017 Author Share Posted March 11, 2017 if i do trigger server then client event it will be still the same rootElement so it will be working only for me Link to comment
Mr.Loki Posted March 11, 2017 Share Posted March 11, 2017 Then simply change it from resourceRoot to root... because you are dealing with elements outside of the resource. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now