PutPlayerInVehicle
Description:
Function PutPlayerInVehicle puts a player in a vehicle.
|
You can use GetPlayerVehicleSeat in a loop to check if a seat is occupied by any players. |
Parameters:
(playerid, vehicleid, seatid)
int | playerid | The ID of the player to put in a vehicle. |
int | vehicleid | The ID of the vehicle to put the player in. |
int | seatid | The ID of the seat to put the player in. |
Return Values:
- 1: The function was executed successfully.
- 0: The function failed to execute. The player or vehicle don't exist.
Examples:
public OnPlayerEnterVehicle(playerid,vehicleid,ispassanger) { PutPlayerInVehicle(playerid, vehicleid, 0); return 1; }
Seats:
0 - Driver 1 - Front passenger 2 - Back-left passenger 3 - Back-right passenger 4+ - Passenger seats (coach etc.)
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- RemovePlayerFromVehicle: Throw a player out of their vehicle.
- GetPlayerVehicleID: Get the ID of the vehicle the player is in.
- GetPlayerVehicleSeat: Check what seat a player is in.
Related Callbacks
The following callbacks might be useful as well, as they are related to this callback in one way or another.
- OnPlayerEnterVehicle: Called when a player starts to enter a vehicle.