OnPlayerEnterVehicle
Description:
Callback OnPlayerEnterVehicle is called when a player starts to enter a vehicle, meaning the player is not in vehicle yet at the time this callback is called.
|
Parameters:
(playerid, vehicleid, ispassenger)
int | playerid | ID of the player who attempts to enter a vehicle. |
int | vehicleid | ID of the vehicle the player is attempting to enter. |
bool | ispassenger | 0 if entering as driver. 1 if entering as passenger. |
Return Values:
This callback does not handle returns.
- It is always called first in filterscripts.
Examples:
// 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; }
Related Callbacks
The following callbacks might be useful as well, as they are related to this callback in one way or another.
- OnPlayerExitVehicle: Called when a player leaves a vehicle.
- OnPlayerStateChange: Called when a player changes state.
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- PutPlayerInVehicle: Put a player in a vehicle.
- GetPlayerVehicleSeat: Check what seat a player is in.