跳到主要内容

PutPlayerInVehicle

Description

Puts a player in a vehicle.

NameDescription
playeridThe ID of the player to put in a vehicle.
vehicleidThe ID of the vehicle to put the player in.
seatidThe ID of the seat to put the player in.

Returns

true - The function was executed successfully.

false - The function failed to execute. The player or vehicle don't exist.

Examples

public OnPlayerEnterVehicle(playerid, vehicleid, ispassanger)
{
PutPlayerInVehicle(playerid, vehicleid, 0);
return 1;
}
IDSeat
0Driver
1Front passenger
2Back-left passenger
3Back-right passenger
4+Passenger seats (coach etc.)

Notes

提示

You can use GetPlayerVehicleSeat in a loop to check if a seat is occupied by any players.

注意

If the seat is invalid or is taken, will cause a crash when they EXIT the vehicle.