[Problem] Lags
#1

Hello there!

I have strange problem with my own event script. Anyway when event is active players on this event get lags. In this event players peds do not refresh, but chat don’t get lags. Unfortunately, other players can play without lags. What can make this lags? What’s wrong? Here it is code:


Timer public:
Код:
forward OdswiezHay();
public OdswiezHay()
{
    print("[Start odswiezania]");
 HayCzas--;
    sekundajhay--;
 format(strr, sizeof(strr), "~r~Czas~w~: %02d:%02d", minetajhay, sekundajhay);
 TextDrawSetString(TDUSCzas, strr);
 print("Odswiezylo czas eventu...");
 if(sekundajctp <= 0)
{
 sekundajhay = 60;
 minetajhay--;
 print("Odjeto minute");
}
 if(HayCzas <= 0)
{
 ResetPlayerWeapons(HayNiszczyciel);
 HayCzas = 6;
 HayNiszczyciel = random(HayUczestnicy);
 GivePlayerWeapon(HayNiszczyciel, 24, 1);
 format(strr, sizeof(strr), "%s", PlayerName(HayNiszczyciel));
 TextDrawSetString(TDUSNiszczyciel, strr);
 print("Rozdało bronie...");
}

    print("[Koniec tego odswiezania]");
 //if(minetajhay == 0 && sekundajhay == 0)
 //return KoniecHay();
 return 1;
}
 forward StartujHay();
 public StartujHay()
{
 for(new i=0; i<MAX_PLAYERS; i++)
{
 if(Player[i][Event] == EVENT_HAY)
{
    new rand = random(sizeof(HaySpawny));
    SetPlayerPos(i, HaySpawny[rand][0], HaySpawny[rand][1], HaySpawny[rand][2]);
    TogglePlayerControllable(i, 0);
    SetTimerEx("Unfreeze", 2000, 0, "d", i);
    SetPlayerHealth(i, 100);
    SetPlayerArmour(i, 0);
    SetPlayerTeam(i, 1);
    SetPlayerVirtualWorld(i, 601);
    HayNiszczyciel = -1;
    minetajhay = 5;
    sekundajhay = 1;
    HayCzas = 6;
}
}
 TimerHay = SetTimer("OdswiezHay", 1000, true);
 return 1;
}
If you have questions for this script. Ask me!





Sorry for my bad language.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)