Tox Posted February 20, 2016 Share Posted February 20, 2016 hello everyone, i am trying to make a garbage collector job i'm having some problems that i don't understand why. so my event "garbage.warpPedIntoVehicle" won't work and i don't know why, if i get it out of the chunk it works ok but with this it just returns false client local Garbage = {} local x, y, z = getMarkerPosition () localPlayer:setModel(309) Garbage.vehicle = createVehicle (408, x-2, y, z+2) inMission = true if isElement (Garbage.vehicle) then if triggerServerEvent("garbage.warpPedIntoVehicle", localPlayer, Garbage.vehicle) then outputChatBox ("aye") else outputChatBox ("nay2") end else outputChatBox ("nay") end server addEvent ("garbage.warpPedIntoVehicle", true) addEventHandler ("garbage.warpPedIntoVehicle", root, function (vehicle) outputChatBox ("aye2") warpPedIntoVehicle (client, vehicle) end ) Link to comment
Tox Posted February 20, 2016 Author Share Posted February 20, 2016 i guess i found the solution, weird tho. client side element vehicle doesn't pass to server Link to comment
Bonus Posted February 20, 2016 Share Posted February 20, 2016 "Note: Vehicles (and other elements) created client-side are only seen by the client that created them, aren't synced and players cannot enter them. They are essentially for display only." Why do you even create the vehicle clientsided? Or use setElementModel? Link to comment
Tox Posted February 20, 2016 Author Share Posted February 20, 2016 "Note: Vehicles (and other elements) created client-side are only seen by the client that created them, aren't synced and players cannot enter them. They are essentially for display only."Why do you even create the vehicle clientsided? Or use setElementModel? well, let's say i tried to make code smaller. but uh i thought it was synced, thanks 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