(playerid, vehicleid, ispassenger)
playerid
ID of the player who attempts to enter a vehicle.
vehicleid
ID of the vehicle the player is attempting to enter.
ispassenger
0 if entering as driver. 1 if entering as passenger.
Here's an example that prints the ID of vehicle you're entering to the chatbox.
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new string[128];
format(string, sizeof(string), "You are entering vehicle %i", vehicleid);
SendClientMessage(playerid, 0xFFFFFFFF, string);
return 1;
}
- This callback is called when a player BEGINS to enter a vehicle, not when they HAVE entered it. See OnPlayerStateChange.
- This callback is still called if the player is denied entry to the vehicle (e.g. it is locked or full).
The following callbacks might be useful as well, as they are related to this callback in one way or another.
The following functions might be useful, as they're related to this callback in one way or another.