Padul Posted March 10, 2017 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 MTA Dayz textures and objects: http://padulmods.blogspot.com/
Mr.Loki Posted March 10, 2017 Posted March 10, 2017 triggerServerEvent triggerClientEvent [REL]Cinema Experience Beta 2.0 [TUT]Object offsets with OOP. [TUT] Adding a Discord bot to your server. Discord: Loki#7355
Padul Posted March 11, 2017 Author 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 MTA Dayz textures and objects: http://padulmods.blogspot.com/
Mr.Loki Posted March 11, 2017 Posted March 11, 2017 Then simply change it from resourceRoot to root... because you are dealing with elements outside of the resource. [REL]Cinema Experience Beta 2.0 [TUT]Object offsets with OOP. [TUT] Adding a Discord bot to your server. Discord: Loki#7355
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