26.06.2012, 11:52
pawn Код:
forward VehicleRespawn(playerid, vehicleid, ispassenger);
public VehicleRespawn(playerid, vehicleid, ispassenger)
{
for(new i = 0; i < MAX_VEHICLES; i ++ )
{
for(new o = 0, a = GetMaxPlayers(); o < a; o ++ )
{
if(!IsPlayerConnected(o)) continue;
if(IsAnyBodyInVehicle(i)) continue;
if(CurrentSpawnedVehicle[i]) continue;
GameTextForPlayer(playerid,"~r~Vehicles ~g~Respawn",5000,5);
SendClientMessage(playerid, COLOR_BLUE, "{CFF55F}*INFO: {FFFFFF}Vehicle Respawn.");
SetVehicleToRespawn(i);
DestroyVehicle(CurrentSpawnedVehicle[i]);
}
}
return 1;
}
stock IsAnyBodyInVehicle(vid)
{
for(new i = 0; i < GetMaxPlayers(); i ++ )
{
if(IsPlayerInVehicle(i, vid)) return 1;
}
return 1;
}
You do not need any of that shit. Stop thinking your script is "cool" and "unique." What you are going to do now is replace all of that shit with this:
pawn Код:
//.........
for(new i=0; i<=MAX_VEHICLES; i++) SetVehicleToRespawn(i);
//.....