20.01.2015, 04:51
try it.
pawn Код:
new pVehicle[MAX_PLAYERS];
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
pVehicle[playerid] = GetPlayerVehicleID(playerid);
}
if(oldstate == PLAYER_STATE_DRIVER)
{
for(new id; id < MAX_PLAYERS; id++)
{
if(IsPlayerConnected(id) && GetPlayerVehicleID(id) == pVehicle[playerid])
{
RemovePlayerFromVehicle(id);
SendClientMessage(id, 0xFF0000FF, "The driver is leaving the vehicle!");
}
}
pVehicle[playerid] = INVALID_VEHICLE_ID;
}
return 1;
}