[Ajuda] Timer parando de funcionar
#1

Boa noite , seguindo galera eu tenho um timer no ongamemodeinit do relogio e de players on.
Sу que ele funciona de boa , sу que depois de um certo tempo ele para de funcionar e nгo atualiza nem o relogio e nem o players on mais , nгo sei o que pode ser...

Ongamemodeinit :
Код:
 SetTimer("Relogio", 1000, true);
Public :
Код:
forward Relogio();
public Relogio()
{
AntiDeAMX();
new
string[50],
year,
month,
day,
hour,
minute,
second;
getdate(year, month, day);
gettime(hour, minute, second);
format(string, sizeof string, "%d/%s%d/2015", day, ((month < 10) ? ("0") : ("")), month);
TextDrawSetString(Textdraw10, string);
format(string, sizeof string, "%s%d:%s%d:%s%d", (hour < 10) ? ("0") : (""), hour, (minute < 10) ? ("0") : (""), minute, (second < 10) ? ("0") : (""), second);
TextDrawSetString(Textdraw9, string);
format(string, sizeof string, "~g~Players On:~w~ %d/%d", GetPlayersConnected(), GetMaxPlayers());
TextDrawSetString(Textdraw8, string);
}
Ele sу volta a funcionar se relogar , eu sei que tem casos que trava mesmo quando net tб ruim etc... , mas trava de todos online , nгo й o host pois jб testei em 2 diferentes ...
Reply
#2

Use settimerex porque ela que chama uma calback.
Reply
#3

Jб tentei usar no connect e usar killtimer no disconnect , porйm continuou travando.
Reply
#4

Coloque o
PHP код:
return 1
no final da callback e poste os resultados.
Reply
#5

Quote:
Originally Posted by Luan Argolo
Посмотреть сообщение
Coloque o
PHP код:
return 1
no final da callback e poste os resultados.
Ainda continua o problema mesmo com o return 1;

:/
Reply
#6

Aqui tem um exemplo de como deve ficar a public https://sampforum.blast.hk/showthread.php?tid=246395 de uma olhada e use como base, abraзos
Reply
#7

O script esta a crashar, use o crashdetect e ira ver isso:

PHP код:
forward Relogio();
public 
Relogio()
{
    new 
string[50], yearmonthdayhourminutesecond;
    
getdate(yearmonthday);
    
gettime(hourminutesecond);
    
    
format(stringsizeof string"%02d/%02d/%04d"daymonthyear);
    
TextDrawSetString(Textdraw10string);
    
    
format(stringsizeof string"%02d:%02d:%02d"hourminutesecond);
    
TextDrawSetString(Textdraw9string);
    
    
format(stringsizeof string"~g~Players On:~w~ %d/%d"GetPlayersConnected(), GetMaxPlayers());
    
TextDrawSetString(Textdraw8string);
    return 
1;

nunca pode usar "" nas textdraw.
Reply
#8

Resolvi , era conflito na stock do GetDistanceBetweenPlayers , ai toda vez que efetuava um comando que utilizava dela travava , obrigado a todos.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)