Vanlot Posted February 18, 2014 Share Posted February 18, 2014 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
MTA Team 0xCiBeR Posted February 18, 2014 MTA Team Share Posted February 18, 2014 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
Vanlot Posted February 18, 2014 Author Share Posted February 18, 2014 Thanks for the note . it's fixed Link to comment
MTA Team 0xCiBeR Posted February 18, 2014 MTA Team Share Posted February 18, 2014 You're Welcome! 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