Wysłany: 2015-01-04, 01:43
Sowik
Wiek: 30 Na forum: 5581 dni Posty: 48
Piwa : 429
Witam, mam problem z timerami, ot??:
Kod:
[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.
i tak dalej...
Gdzie "CheckMySQL" w gamemode to:
Kod:
Kod: SetTimer("CheckMySQL", 5000, true);
i
Kod: public CheckMySQL()
{
if(mysql_ping() == 0)
mysql_reconnect();
return 1;
}
A "AutomaticallyRespawnVehicles" to..
Kod: forward AutomaticallyRespawnVehicles();
Kod: SetTimer("AutomaticallyRespawnVehicles", 1000*60*1, true);
Kod: 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);
}
}
}
}
Kto? pomo?e? Bo przez to inne rzeczy si? buguj?.
Wysłany: 2015-01-04, 14:49
Combacior
Wiek: 29 Na forum: 5796 dni Posty: 1516
Piwa : 2161
Wywal w choler? ten timerfix, ale polecam zoptymalizowa? kod od respawnowania pojazd?w. W dodatku po co respawn wszystkich pojazd?w co minut??
Wysłany: 2015-01-04, 15:17
Sowik
Wiek: 30 Na forum: 5581 dni Posty: 48
Piwa : 429
Ustawi?em co minut? poniewa? sprawdza?em ten respawn gdy? jest co? z nim nie tak. Czyli kompletnie si? tym nie przejmowa?? A co z t? optymalizacj? automatycznego respawnu? Jaki? pomys??
Tagi: timery
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: