#1

Hello, I have a problem with the timer, and so:
Код:
[21:33] (TimerFix) WARNING: The function "CheckMySQL" took 24ms to execute! This will affect other timers.
[21:33] (TimerFix) WARNING: The function "CheckMySQL" took 23ms to execute! This will affect other timers.
[21:33] (TimerFix) WARNING: The function "CheckMySQL" took 23ms to execute! This will affect other timers.
[21:33] (TimerFix) WARNING: The function "AutomaticallyRespawnVehicles" took 1355ms to execute! This will affect other timers.
[21:33] (TimerFix) WARNING: The function "CheckMySQL" took 22ms to execute! This will affect other timers.
[21:33] (TimerFix) WARNING: The function "CheckMySQL" took 24ms to execute! This will affect other timers.
[21:34] (TimerFix) WARNING: The function "CheckMySQL" took 23ms to execute! This will affect other timers.
[21:34] (TimerFix) WARNING: The function "CheckMySQL" took 24ms to execute! This will affect other timers.
[21:34] (TimerFix) WARNING: The function "CheckMySQL" took 23ms to execute! This will affect other timers.
[21:34] (TimerFix) WARNING: The function "CheckMySQL" took 23ms to execute! This will affect other timers.
[21:34] (TimerFix) WARNING: The function "AutomaticallyRespawnVehicles" took 1352ms to execute! This will affect other timers.
[21:34] (TimerFix) WARNING: The function "CheckMySQL" took 23ms to execute! This will affect other timers.
[21:34] (TimerFix) WARNING: The function "CheckMySQL" took 22ms to execute! This will affect other timers.
[21:35] (TimerFix) WARNING: The function "CheckMySQL" took 24ms to execute! This will affect other timers.
[21:35] (TimerFix) WARNING: The function "CheckMySQL" took 24ms to execute! This will affect other timers.
and so on ...

"CheckMySQL" gamemode code:

Код:
forward CheckMySQL();
Код:
SetTimer("CheckMySQL", 5000, true);
and

Код:
public CheckMySQL()
{
    if(mysql_ping() == 0)
        mysql_reconnect();
    return 1;
}
"AutomaticallyRespawnVehicles" this..

Код:
forward AutomaticallyRespawnVehicles();
Код:
SetTimer("AutomaticallyRespawnVehicles", 1000*60*1, true);
Код:
public AutomaticallyRespawnVehicles()
{
    for(new i=0; i<MAX_VEHICLES; i++)
    {
        if(!IsVehicleInUse(i, 5) && !IsTrailerAttached(i, 3))
        {
            if(IsTrailerAttachedToVehicle(i))
            {
                new trailerid = GetVehicleTrailer(i);
                DetachTrailerFromVehicle(i);
                    SetVehicleToRespawn(trailerid);
            }
            if(vInfo[i][Owner] != -1 && vInfo[i][Fraction] == 0)
            {
                 UnloadPlayerVehicles(vInfo[i][Owner]);
                 LoadPlayerVehicles(vInfo[i][Owner]);
            }
            else
            {
                SetVehicleToRespawn(i);
            }
        }
    }
}
Please help me, by that other things do not work.

Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)