xXGhostXx Posted September 21, 2018 Share Posted September 21, 2018 Hi guys ! What is problem in my code ?! Code for respawn vehicle with weapon fire ! Client : local gundv = nil function gunDVFunction(_, _, _, _, _, _, car) outputDebugString("1") if gundv then outputDebugString("2") if car then outputDebugString("3") if getElementType(car) == "vehicle" then triggerServerEvent("gundv:respawnVehicle", localPlayer, car) outputChatBox("[Done] Vehicle Respawned!", 25,255,25) end end end end addEventHandler ("onClientPlayerWeaponFire", localPlayer, gunDVFunction) addEvent("gundv:enableOrDisable", true) addEventHandler("gundv:enableOrDisable", localPlayer, function(bool) if bool then gundv = true else gundv = nil end end ) Server : function gunDVFunction ( thePlayer, command ) if not ( isPlayerOnGroup ( thePlayer ) ) then outputChatBox("#ff0000Permission Denied!", thePlayer, 255, 255, 255, true) return false end respawnVehicle(thePlayer,gundv) end addCommandHandler("gundv", gunDVFunction) Link to comment
MIKI785 Posted September 21, 2018 Share Posted September 21, 2018 gundv:respawnVehicle -> don't see that being handled anywhere. Link to comment
xXGhostXx Posted September 21, 2018 Author Share Posted September 21, 2018 3 minutes ago, MIKI785 said: gundv:respawnVehicle -> don't see that being handled anywhere. What ?! Please give me fix code ! Link to comment
MIKI785 Posted September 21, 2018 Share Posted September 21, 2018 1 hour ago, xXGhostXx said: What ?! Please give me fix code ! No. This section is not intended for code requests. You're supposed to post a snippet, tell us what's wrong, any debug info and we will try to help you. I'm saying that you are triggering a server side event 'gundv:respawnVehicle' but that event is never handled on the server side (at least not in the snippet you provided). 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