Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2015-01-04, 01:43


Sowik







Wiek: 30
Na forum: 5581 dni
Posty: 48

Piwa: 429

Respekt: 12

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:

forward CheckMySQL();


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?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-01-04, 14:49


Combacior







Wiek: 29
Na forum: 5795 dni
Posty: 1516

Piwa: 2161

Respekt: 1060
Respekt: 1060

Ostrzeżeń: 20%
Wywal w choler? ten timerfix, ale polecam zoptymalizowa? kod od respawnowania pojazd?w. W dodatku po co respawn wszystkich pojazd?w co minut??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-01-04, 15:17


Sowik







Wiek: 30
Na forum: 5581 dni
Posty: 48

Piwa: 429

Respekt: 12

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??

Postaw piwo autorowi tego posta
 

 
Tagi: timery
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN » [INNE] Timery Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku