SA-MP Forums Archive
Detect a player exiting a vehicle - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Detect a player exiting a vehicle (/showthread.php?tid=203919)



Detect a player exiting a vehicle - Nameless303 - 28.12.2010

Hi everybody,
I need a way to detect a player exiting a vehicle because OnPlayerExitVehicle doesn't register teleports or fall of I can't use that...
And OnPlayerStateChange doesn't provide vehicle id, so I'm sort of stuck...
Please help!
Thanks


Re: Detect a player exiting a vehicle - Crime Life ROLEPLAY - 28.12.2010

Код:
if(GetPlayerState(playerid)==PLAYER_STATE_FEET)
{
   //someting
}
give your commands here


Re: Detect a player exiting a vehicle - cessil - 28.12.2010

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
              SetPVarInt(playerid,"vehicleid",GetPlayerVehicleID(playerid));
        }
        if(oldstate == PLAYER_STATE_DRIVER)
    {
              //now you have them exiting the car as a driver and the last vehicle ID
        }
}



Re: Detect a player exiting a vehicle - Nameless303 - 28.12.2010

Quote:
Originally Posted by cessil
Посмотреть сообщение
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
              SetPVarInt(playerid,"vehicleid",GetPlayerVehicleID(playerid));
        }
        if(oldstate == PLAYER_STATE_DRIVER)
    {
              //now you have them exiting the car as a driver and the last vehicle ID
        }
}
So I'll have to save every player's vehicleid..
Thanks!