Jump to content

WarpPedIntoVehicle


isa_Khamdan

Recommended Posts

Hello ,

I have problem with warppedintovehicle , The problem is that the ped never get warped to the vehicle I tried to fix it with timers and stuffs ( e.g. creating vehicle and ped then using warp after 5 seconds to warp the ped into vehicle )

It works 100% on my offline server but when I upload it to my online server it doesn't work :S

I just see the ped standing next to the vehicle.

So can anyone tell me how to fix it?

function hideL() 
  
    vehicle = createVehicle ( 529, -2069.2124023438, 1844.8651123047, 17.2 , 0 , 0 , 0 ) 
    setVehicleColor ( vehicle, 0, 0, 0 ) 
    addVehicleUpgrade ( vehicle , 1010 ) 
    ped = createPed ( 46, -2069.2124023438 + 1, 1844.8651123047 + 1 , 17.2 ) 
    warpPedIntoVehicle ( ped , vehicle ) 
  
  
end 
addEvent("hideL", true) 
addEventHandler("hideL", getRootElement(), hideL) 

Edit: This script is client sided.

Link to comment
Attention: If you used setElementPosition to spawn the ped/player, this function will not work and returns false.

----

Available client side from 1.3.1 (It will only work with client side vehicles and peds)

That makes no sense as he is not using setElementPosition and he is using the function server-side. That notice is there only to explain why servers that use a version lower than 1.3.1 can't use the function client-side - because it is only available client-side after 1.3.1.

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