20.12.2013, 15:20
Something like:
pawn Код:
new lastDriver[MAX_VEHICLES] = {INVALID_PLAYER_ID,..};
if(newstate == PLAYER_STATE_ONFOOT && oldstate == PLAYER_STATE_DRIVER)
{
lastDriver[vehicleid] = playerid;
}
// onVehicleDeath
lastDriver[vehicleid] = INVALID_PLAYER_ID;
command(lastdriver, playerid, params[])
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new name[24], string[500]; GetPlayerName(lastDriver[GetPlayerVehicleID(playerid)],name,sizeof(name));
format(string, sizeof(string), "The last driver of this %s was {FF0000}%s{FFFFFF}", GetVehicleName(GetPlayerVehicleID(playerid)), (isnull(name) ? "Unknown" : name));
SendClientMessage(playerid, WHITE, string);
}
else return SCM(playerid, WHITE, "You are not in a vehicle.");
return 1;
}