Jump to content

Can't enter train


Tails

Recommended Posts

For some reason it's not letting me enter the train, same thing on server side. WarpPedIntoVehicle isn't working either.

function interCity() 
    local train = createVehicle(538,-1948.413, -0.929, 25.711) 
end 
addEventHandler("onClientResourceStart",resourceRoot,interCity) 

Any ideas?

Edited by Guest
Link to comment
Expected ped getting resource-data in debug

Look the example "warpPedIntoVehicle " in WIKI mta

function setupForRace ( ) 
    local RacerPed = createPed ( 252, 0, 0, 3 ) 
    local RaceVehicle = createVehicle ( 411, 4, 0, 3 )            -- create a vehicle. 
    warpPedIntoVehicle ( RacerPed, RaceVehicle )                  -- warp the ped straight into the vehicle 
end 
addCommandHandler ( "startrace", setupForRace )   

Link to comment
is easy, or not? :|

Sure is. I thought I tested it my code server side but apparently I didn't.

There's another issue, however, the train will only go in one direction when driving it?

You can't enter vehicles created in client side

Thanks, ALw7sH, I did not know that.

Link to comment

What do you mean?

Server side:

function interCity() 
    local train = createVehicle(538,-1948.413, -0.929, 25.711) 
end 
addEventHandler("onResourceStart",resourceRoot,interCity) 

Yes, you can enter the train now. But try it for yourself, it will only go in one direction.

Trains just confuse me. They never do what I want.

Link to comment

try this :|

Server side:

function interCity(thePlayer) 
    local train = createVehicle(538,-1948.413, -0.929, 25.711) 
    warpPedIntoVehicle(thePlayer, train) 
    setVehicleRotation ( train, 0, 0, 270 ) 
end 
addEventHandler("onResourceStart",resourceRoot,interCity) 

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