OnPlayerEnterVehicle

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 12:37, 22 April 2014
Kilou (Talk | contribs)
(add fr link)
← Previous diff
Revision as of 19:48, 23 April 2014
Ikkentim (Talk | contribs)
(This is a callback(NoReturn>NoReturnCallback))
Next diff →
Line 8: Line 8:
{{Param|ispassenger|0 if entering as driver. 1 if entering as passenger.}} {{Param|ispassenger|0 if entering as driver. 1 if entering as passenger.}}
-{{NoReturn}}+{{NoReturnCallback}}
Here's an example that prints the model of vehicle you're entering to the chatbox. Here's an example that prints the model of vehicle you're entering to the chatbox.

Revision as of 19:48, 23 April 2014



Description:

This callback 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)
playeridID of the player who attempts to enter a vehicle.
vehicleidID of the vehicle the player is attempting to enter.
ispassenger0 if entering as driver. 1 if entering as passenger.


Return Values:

This callback does not handle returns.


Here's an example that prints the model 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;
}
Image:32px-Ambox_warning_orange.png

Note

This callback is called when a player BEGINS to enter a vehicle, not when they HAVE entered it. See OnPlayerStateChange.


Image:32px-Ambox_warning_orange.png

Note

This callback is still called if the player is denied entry to the vehicle (e.g. it is locked or full).


Related Callbacks

The following callbacks might be useful as well, as they are related to this callback in one way or another.


Related Functions

The following functions might be useful, as they're related to this callback in one way or another.

In other languages