ajuda com comando timer
#1

Criei um Timer que kicka o player se ele demorar para logar-se/registrar-se,aki estб:

SetTimer("TimeLogin", 120000, 1); //coloquei isso no onplayerconnect

e este fica no fim do gm:
public TimeLogin(playerid) {
new pname[MAX_PLAYER_NAME];
new string[256];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "[INFO] %s Foi kickado automaticamente por demorar para se registrar/logar.", pname);
SendClientMessageToAll(COLOR_BRIGHTRED, string);
Kick(playerid);
}

Porem,mesmo que o cara entrar ele leva kick depois de 2 minutos.como faзo pra arrumar isso? o que tenho que fazer para quando ele logar/registrar "destruir" o timer? Agradeзo
Reply
#2

essa eu sei xD.

pawn Код:
new tempo;

// no onplayer coonect:
 tempo = SetTimer("TimeLogin",120000,false);// acontecerб sу uma fez
// no login :
 KillTimer(tempo);
// na public:
public TimeLogin(playerid) {
new pname[MAX_PLAYER_NAME];
new string[256];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "[INFO] %s Foi kickado automaticamente por demorar para se registrar/logar.", pname);
SendClientMessageToAll(COLOR_BRIGHTRED, string);
Kick(playerid);
}
Reply
#3

Quote:
Originally Posted by [Full]Garfield[XDB]
Посмотреть сообщение
essa eu sei xD.

pawn Код:
new tempo;

// no onplayer coonect:
 tempo = SetTimer("TimeLogin",120000,false);// acontecerб sу uma fez
// no login :
 KillTimer(tempo);
// na public:
public TimeLogin(playerid) {
new pname[MAX_PLAYER_NAME];
new string[256];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "[INFO] %s Foi kickado automaticamente por demorar para se registrar/logar.", pname);
SendClientMessageToAll(COLOR_BRIGHTRED, string);
Kick(playerid);
}
Vlw parceiro,funcionou perfeitamente,sу tive que colocar um new tempo; no inicio do gm =D й nois.
Reply
#4

na verdade o q faltou foi o
pawn Код:
KillTimer(tempo);
Reply
#5

Quote:
Originally Posted by [WinG]BiieL
Посмотреть сообщение
na verdade o q faltou foi o
pawn Код:
KillTimer(tempo);
Ah? eu coloquei o KillTimer(tempo);,ae deu um erro no tempo,ae coloquei um new tempo; no inicio do gm e pronto =D
Reply
#6

ah ta, esquece
Reply
#7

Quote:
Originally Posted by [WinG]BiieL
Посмотреть сообщение
na verdade o q faltou foi o
pawn Код:
KillTimer(tempo);
ta faltando na sua cabeзa!

nгo tava faltando isto ali, se vocк ver o code vocк entenderб.
Reply
#8

Estava tudo certo atй agora,porem agora eu logo,fico on por 2 mins e sou kickado.... e eu coloquei o KillTimer(tempo); no logar ¬¬ o que deve ser?
Reply
#9

bote em OnPlayerSpawn o KillTimer, e tente
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)