Jump to content

Spawn Marker Problem


Recommended Posts

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) 

Link to comment
Guest Guest4401

warpPedIntoVehicle is serverside function only. You must trigger with triggerServerEvent and warp the player there.

Link to comment

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 !

Link to comment

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) 

Link to comment

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 :P

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...