SA-MP Forums Archive
RemovePlayerFromVehicle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: RemovePlayerFromVehicle (/showthread.php?tid=483336)



RemovePlayerFromVehicle - audriuxxx - 25.12.2013

Hi,

RemovePlayerFromVehicle, when i remove player from vehicle, OnPlayerExitVehicle call back get called?


Re: RemovePlayerFromVehicle - xVIP3Rx - 25.12.2013

Important Note: Not called if the player falls off a bike or is removed from a vehicle by other means such as using SetPlayerPos.
From Wiki

Use OnPlayerStateChange instead
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
    {
        //Codes
    }
    return 1;
}



Re: RemovePlayerFromVehicle - SilentSoul - 25.12.2013

No,
Quote:

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.

Source : https://sampwiki.blast.hk/wiki/RemovePlayerFromVehicle
EDIT:Viper was faster .


Re: RemovePlayerFromVehicle - Konstantinos - 25.12.2013

https://sampwiki.blast.hk/wiki/OnPlayerExitVehicle

Look at the "Important Notes".

EDIT: Too late.