25.07.2013, 21:56
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
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;
}