OnPlayerEnterVehicle

From SA-MP

Jump to: navigation, search

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)
playeridID of the player who attempts to enter a vehicle.
vehicleidID of the vehicle the player is attempting to enter (ID From CreateVehicle() or AddStaticVehicle() that is, not model ID.
ispassangerSimply 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;
}
Personal tools