SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 02/09/2019, 08:00 PM   #1
Ryuzaki07
Huge Clucker
 
Ryuzaki07's Avatar
 
Join Date: Mar 2017
Posts: 239
Reputation: 0
Question Timer não funciona

Boa tarde, estou precisando usar um timer porem ele não está funcionando, alguém sabe me dizer por que ?


Eu dou o comando para chamar, passa os 5 segundos, e ele simplesmente não chama.

PHP Code:
CMD:chamar(playerid)
{
 
SetTimerEx "KickarTempoLogin" 5000 false"i" playerid ) ;
//TempoLogin[playerid] = SetTimer("KickarTempoLogin",5000,false);
SendClientMessage(playeridAmarelo"| INFO | Você chamou o timer de teste tempo login sera kickado em 5 segundos !");
return 
1;
}

stock KickarTempoLogin(playerid)
{
SendClientMessage(playeridAmarelo"| INFO | DEVIDO VOCÊ NÃO TER LOGADO EM 5 MINUTOS VOCÊ FOI KICKADO POR FAVOR CONECETE-SE NOVAMENTE");
Kick(p);
return 
1;


Esse codigo abaixo foi um meio de "Resolver" o problema do kick, quando o player era kickado, a mensagem não aparecia para ele, então fizeram este código e colocaram no forum.

Quote:
#define Kick(%0) SetTimerEx("Kicka", 100, false, "i", %0)
forward Kicka(p); public Kicka(p){
#undef Kick
Kick(p);
#define Kick(%0) SetTimerEx("Kicka", 100, false, "i", %0)
return 1;
}
Ryuzaki07 is offline   Reply With Quote
Old 02/09/2019, 08:01 PM   #2
NWDMadara
Gangsta
 
NWDMadara's Avatar
 
Join Date: Mar 2018
Posts: 501
Reputation: 16
Default Re: Timer não funciona

stocks != callbacks

stocks são "funções"
timers chamam callbacks

utilize:

forward KickarTempoLogin(playerid);
public KickarTempoLogin(playerid)
NWDMadara is offline   Reply With Quote
Old 03/09/2019, 12:32 AM   #3
Ryuzaki07
Huge Clucker
 
Ryuzaki07's Avatar
 
Join Date: Mar 2017
Posts: 239
Reputation: 0
Default Re: Timer não funciona

Desculpa, tinha esquecido de responder, Muito obrigado, deu certo.
Ryuzaki07 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Performance Question , Per Player Timer vs Timer that loops through all players BiosMarcel Scripting Help 14 12/12/2016 10:50 AM
If /foodsearch doesn't find item, set wait timer (TIMER HELP) Josh_Main Scripting Help 7 14/09/2016 05:13 PM
Which is better Per Player Timer or Global timer? (issue with timer) Dokins Scripting Help 4 07/06/2016 10:50 AM
Slice's Timer Fix include --> timer public function isn't getting called Riwerry Scripting Help 0 02/01/2016 04:50 PM
[Timer Help] Score saving timer, should it always be running or should it be killed? Ghost100 Scripting Help 6 08/10/2012 11:12 PM


All times are GMT. The time now is 03:04 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.