Jump to content

warpPedIntoVehicle


Vanlot

Recommended Posts

I was trying to make a script for a spawner with gui.I should write the name of the wanted vehicle in the blank, then press a button, this will result in a marker creation,if the player hit that marker, he will get that vehicle. Everything working fine, but i want the player to warp to the vehicle which is not happening

addEvent("VehicleSpawn",true) 
addEventHandler("VehicleSpawn",root, 
function (TheVehicleName,x,y,z) 
marker = createMarker(x+1,y,z-1,"cylinder",1.5,0,255,0,255) 
addEventHandler("onMarkerHit",marker, 
function (hitElement) 
if (source == marker) then 
if getElementType( hitElement ) == 'player' then 
RaceVehicle = createVehicle (tonumber(TheVehicleName), x+5,y,z)       . 
warpPedIntoVehicle(hitElement ,RaceVehicle) 
end 
end 
end) 
end 
) 

Link to comment
  • Administrators

You had a dot at the end of createVehicle.

  
addEvent("VehicleSpawn",true) 
addEventHandler("VehicleSpawn",root, 
function (TheVehicleName,x,y,z) 
marker = createMarker(x+1,y,z-1,"cylinder",1.5,0,255,0,255) 
addEventHandler("onMarkerHit",marker, 
function (hitElement) 
if (source == marker) then 
if getElementType( hitElement ) == 'player' then 
RaceVehicle = createVehicle (tonumber(TheVehicleName), x+5,y,z) 
hitElement = hitElement 
setTimer(warpPedIntoVehicle,50,1,hitElement ,RaceVehicle) 
end 
end 
end) 
end 
) 

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...