RemovePlayerFromVehicle

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 18:01, 1 October 2013
W (Talk | contribs)

← Previous diff
Revision as of 04:31, 2 February 2014
Connor Mead (Talk | contribs)

Next diff →
Line 1: Line 1:
{{Scripting}} {{Scripting}}
-{{Title}} 
{{Description|Removes/ejects a player from their vehicle.}} {{Description|Removes/ejects a player from their vehicle.}}
Line 30: Line 29:
[[Category:Scripting Functions]] [[Category:Scripting Functions]]
 +[[fr:RemovePlayerFromVehicle]]
[[it:RemovePlayerFromVehicle]] [[it:RemovePlayerFromVehicle]]
[[ru:RemovePlayerFromVehicle]] [[ru:RemovePlayerFromVehicle]]

Revision as of 04:31, 2 February 2014



Description:

Removes/ejects a player from their vehicle.


Parameters:
(playerid)
playeridThe ID of the player to remove from their vehicle.


Return Values:

This function does not return any specific values.


Image:32px-Ambox_warning_orange.png

Notes

  • The exiting animation is not synced for other players.
  • This function will not work when used in OnPlayerEnterVehicle, because the player isn't in the vehicle when the callback is called. Use OnPlayerStateChange (newstate == 2/PLAYER_STATE_DRIVER) instead.


// Example - Players can only drive vehicles if they have 10 score.
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == 2 && GetPlayerScore(playerid) < 10)
    {
        RemovePlayerFromVehicle(playerid);
    }
    return 1;
}

Related Functions

The following functions may be useful, as they are related to this function in one way or another.

In other languages