pawn Код:
forward RACtime
();
public RACtime
(){ static vehID, trailerid;
new bool:unwanted
[CAR_AMOUNT
char];
for(new player
=0; player
<MAX_PLAYERS; player
++) if(IsPlayerConnected
(player
)) { vehID
= GetPlayerVehicleID
(player
);
if(!(0 < vehID
< CAR_AMOUNT
)) continue;
// if player is not in any vehicle we skip unwanted
{vehID
} = true;
trailerid
= GetVehicleTrailer
(vehID
);
if(0 < trailerid
< CAR_AMOUNT
) // if trailer is attached unwanted
{trailerid
} = true;
} for(new car
= 1; car
< CAR_AMOUNT; car
++) if(!unwanted
{car
} && GetVehicleModel
(car
) > 0) // or https://sampwiki.blast.hk/wiki/IsValidVehicle instead GetVehicleModel SetVehicleToRespawn
(car
);
}