Detect a player exiting a vehicle
#1

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
Reply
#2

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

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
        }
}
Reply
#4

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)