[Ajuda] Como detectar quando o player cai da moto
#8

Quote:
Originally Posted by caoraivoso3
Посмотреть сообщение
GetPlayerVehicleID(playerid);
nao, isso nao vai dar, porque quano o oldstate for driver ele ja nao vai ser driver, dai nao dб para detectar o ultimo veiculo

entao faзa assim

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    static ultimovei[MAX_PLAYERS];
    if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        ultimovei[playerid] = GetPlayerVehicleID(playerid);
    }
    else if(oldstate == PLAYER_STATE_DRIVER)
    {
        if(CapaceteStatus[playerid] == 1 && IsABike(ultimovei[playerid]))
        {
                RemovePlayerAttachedObject(playerid, SLOT);
                SendClientMessage(playerid,Azul,"Retiras-te o Capacete.");
                CapaceteStatus[playerid] = 0;
        }
    }
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)