22.08.2013, 15:23
pawn Код:
stock GetVehicleDriver(vehicleid)
{
for(new i; i<MAX_PLAYERS; i++)
{
if (IsPlayerInVehicle(i, vehicleid))
{
if(GetPlayerState(i) == 2)
{
return i;
}
}
}
return -1;
}
pawn Код:
CMD:v(...)
{
for(new i = 0 ; i < MAX_VEHICLES; i++)
{
if(GetVehicleDriver( i ) == -1)
{
DestroyVehicle( i );
}
}
return 1;
}