24.08.2010, 19:49
Code:
RespawnEmptyCars(); public RespawnEmptyCars() { for(new i=0; i<MAX_VEHICLES; i++) { for(new pl = 0; pl<MAX_PLAYERS; pl++) { if(IsPlayerConnected(pl)) { if(!IsVehicleInUse(i))//if(!IsPlayerInVehicle(pl, i)) { SetVehicleToRespawn(i); } } } } }
Code:
stock IsVehicleInUse(vehicleid) { for(new i=0; i<GetMaxPlayers(); i++) { if(IsPlayerConnected(i)) { if(GetPlayerVehicleID(i) == vehicleid) return true; } } return false; }