29.05.2012, 17:50
pawn Код:
new gAdminVeh[MAX_VEHICLES];
CMD:acar(playerid, params[])
{
// Blah blah blah
new vid = CreateVehicle(...);
gAdminVeh[vid] = 1;
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == 2) SetPVarInt(playerid, "lastveh", GetPlayerVehicleID(playerid));
new lastveh = GetPVarInt(playerid, "lastveh");
if(oldstate == 2 && gAdminVeh[lastveh] == 1)
{
DestroyVehicle(lastveh);
gAdminVeh[lastveh] = 0;
}
}