OnPlayerEnterVehicle
From SA-MP
[edit]
OnPlayerEnterVehicle
This callback is called when a player hits RETURN/G (Driver/Passanger) near a vehicle so he starts approaching the vehicle.
(playerid, vehicleid, ispassanger)
| playerid | ID of the player who attempts to enter a vehicle. |
| vehicleid | ID of the vehicle the player is attempting to enter (ID From CreateVehicle() or AddStaticVehicle() that is, not model ID. |
| ispassanger | Simply 0/1 if he's trying to enter as passanger or not. |
This function does not return a specific value, it's best to simply ignore it.
Here's an example that prints the model of vehicle you're entering to the chatbox.
public OnPlayerEnterVehicle(playerid, vehicleid, ispassanger) { new string[64]; format(string, sizeof(string), "You're entering car model %s!", GetVehicleModel(vehicleid)); SendClientMessage(playerid, 0xFFFFFFFF, string); return 1; }
