[SOLVED] lags the server
#1

Hey,
Here's my code for vehicles respawn:
pawn Код:
if (strcmp(cmdtext, "/respawnvehicles", true) == 0 && pAdminLvl[playerid] >= 3)
    {
      SystemMsg(playerid,"Respawning all vehicles in server.. Please wait..");
    for(new v = 0; v < MAX_VEHICLES; v++)
        {
          for(new i = 0; i <MAX_PLAYERS; i++)
          {
            if(!IsPlayerInAnyVehicle(i))
            {
                SetVehicleToRespawn(v);
                }
            }
        }
        SystemMsg(playerid,"All vehicles has been respawned!");
        return 1;
    }
Earlier it respawned vehicles like in 5 - 10 seconds.. (The code was without IsPlayerInAnyVehicle check) EDIT: But IsPlayerInAnyVehicle doesn't help cause even if player is in vehicle, his vehicle gets respawned..
But now it takes about 25-35 seconds to respawn (vehicle count is almost same as it was before) and it lags the server... Why?


And BTW Why vehicles usually spawn in wrong place? I save them to spawn in parking lot but they spawn in front of the road... After /respawnvehicles, they spawn correctly

And I do not use any vehicle streamer!
Reply


Messages In This Thread
[SOLVED] lags the server - by SiJ - 09.08.2009, 08:35
Re: /RespawnVehicles lags the server - by dice7 - 09.08.2009, 08:43
Re: /RespawnVehicles lags the server - by SiJ - 09.08.2009, 08:45

Forum Jump:


Users browsing this thread: 1 Guest(s)