PutPlayerInVehicle

From SA-MP Wiki

Jump to: navigation, search

PutPlayerInVehicle


Puts a player in a vehicle


Parameters:
(playerid,vehicleid,seatid)
playeridThe ID of the player to put in a vehicle
vehicleidThe ID of the vehicle for the player to be put in
seatidThe ID of the seat to put the player in


This function does not return a specific value.


Seats:

0 - Driver
1 - Front Passenger
2 - Back left passenger
3 - Back right passenger
4+ - Passenger seats (coach etc.)


public OnPlayerEnterVehicle(playerid,vehicleid,ispassanger)
{
    PutPlayerInVehicle(playerid, vehicleid, 0);
    return 1;
}

Important Note: If the seat is invalid or is taken, will cause a crash when they EXIT the car.


TIP: Use GetPlayerVehicleSeat in a loop to check if a seat is available.

Related Functions

The following functions might be useful as well, as they're related to this function in one way or another.


Related Callbacks

The following callbacks might be useful, as they're related to this function in one way or another.

Personal tools