SetTimer("SetVehicleRespawn",50000,1);
//////////////////////////////////////////////
stock IsAnyPlayerInVehicle(vehicleid)
{
for (new i = 0; i != MAX_PLAYERS; i++)
{
if (IsPlayerInVehicle(i, vehicleid)) return 1;
}
return 0;
}
//////////////////////////////////////////////
public SetVehicleRespawn()
{
for(new car = 1; car <= 268; car++)
{
if(!IsPlayerInAnyVehicle(car)) SetVehicleToRespawn(car);
}
SendClientMessageToAll(COLOR_WHITE,"All vehicles has been respawned!");
}
//////////////////////////////////////////////
public SetVehicleRespawn()
{
#define VEHICLES_IN_SERVER MAX_VEHICLES
new bool:VehicleOccupied[VEHICLES_IN_SERVER] = false;
for(new player; player <= GetMaxPlayers(); player++)
{
if( IsPlayerInAnyVehicle(player) ) VehicleOccupied[GetPlayerVehicleID(player)] = true;
}
for(new car; car <= VEHICLES_IN_SERVER; car++);
{
if( !VehicleOccupied[car] ) SetVehicleRespawn(car);
}
SendClientMessageToAll(COLOR_WHITE,"All vehicles has been respawned!");
}
(48177) : error 036: empty statement
(48179) : error 017: undefined symbol "car"
(48179) : error 017: undefined symbol "car"
for(new car; car <= VEHICLES_IN_SERVER; car++);
{
if( !VehicleOccupied[car] ) SetVehicleRespawn(car);
pawn Код:
That's : pawn Код:
|
public SetVehicleRespawn()
{
#define VEHICLES_IN_SERVER MAX_VEHICLES
new bool:VehicleOccupied[VEHICLES_IN_SERVER] = false, MAX_PLAYER_IN_SERVER = GetMaxPlayers();
for(new player; player <= MAX_PLAYER_IN_SERVER; player++)
{
if( IsPlayerInAnyVehicle(player) ) VehicleOccupied[GetPlayerVehicleID(player)] = true;
}
for(new car; car <= VEHICLES_IN_SERVER; car++)
{
if( !VehicleOccupied[car] ) SetVehicleToRespawn(car);
}
SendClientMessageToAll(COLOR_WHITE,"All vehicles has been respawned!");
}
for(new car; car <= VEHICLES_IN_SERVER; car++)
for(new car; car < VEHICLES_IN_SERVER; car++)