yousseftawab Posted May 19, 2012 Posted May 19, 2012 what is wrong? when i walk into the marker the gui pops up when I press patriot it spawns but it warps me over it not in it please help function Patriot() humvee = createVehicle ( 470, 208.60000610352, 1920.6999511719, 16.60000038147, 0, 0, 90 ) guiSetVisible(GUIEditor_Window[1], false) showCursor(false) warpPedIntoVehicle ( source, humvee ) end addEventHandler("onClientGUIClick", GUIEditor_Button[1] , Patriot, false)
Guest Guest4401 Posted May 19, 2012 Posted May 19, 2012 warpPedIntoVehicle is serverside function only. You must trigger with triggerServerEvent and warp the player there.
Wei Posted May 19, 2012 Posted May 19, 2012 Client function Patriot() humvee = createVehicle ( 470, 208.60000610352, 1920.6999511719, 16.60000038147, 0, 0, 90 ) guiSetVisible(GUIEditor_Window[1], false) showCursor(false) triggerServerEvent( "warpEvent", source, humvee ) end addEventHandler("onClientGUIClick", GUIEditor_Button[1] , Patriot) Server addEvent("warpEvent", true) function warp ( thePlayer, theCar ) warpPedIntoVehicle( thePlayer, theCar ) end addEventHandler("warpEvent", getRootElement(), warp) Didn't test it EDIT: if its bugged then setTimer !
yousseftawab Posted May 19, 2012 Author Posted May 19, 2012 I set timer and it's still bugged look ---------server side-------- addEvent("warpEvent", true) function warp ( thePlayer, theCar ) warpPedIntoVehicle( thePlayer, theCar ) end addEventHandler("warpEvent", getRootElement(), warp) setTimer ( warpPedIntoVehicle, 2500, 1 ) --------client side---------- function Patriot() humvee = createVehicle ( 470, 208.60000610352, 1920.6999511719, 16.60000038147, 0, 0, 90 ) guiSetVisible(GUIEditor_Window[1], false) showCursor(false) triggerServerEvent( "warpEvent", source, humvee ) end addEventHandler("onClientGUIClick", GUIEditor_Button[1] , Patriot)
iFoReX Posted May 19, 2012 Posted May 19, 2012 Blazy I think , if the vehicle is in client-side , cant Entry to the Vehicle sv-side addEvent("warpEvent", true) function warp () humvee = createVehicle ( 470, 208.60000610352, 1920.6999511719, 16.60000038147, 0, 0, 90 ) warpPedIntoVehicle( source, humvee ) end addEventHandler("warpEvent", getRootElement(), warp) cl-side function Patriot() if source == GUIEditor_Button[1] then guiSetVisible(GUIEditor_Window[1], false) showCursor(false) triggerServerEvent( "warpEvent", getLocalPlayer() ) end end addEventHandler("onClientGUIClick", root , Patriot) only I think
Wei Posted May 19, 2012 Posted May 19, 2012 Blazy I think , if the vehicle is in client-side , cant Entry to the Vehicle Thanks for letting me know !
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