Kick if doesn't login
#1

Quote:

public OnPlayerRequestClass(playerid, classid)
{
SetTimerEx("kicklogin", 45000, 0, "d", playerid);
}

Quote:

public OnPlayerLogin(playerid,password[])
{
KillTimer(kicklogin(playerid));
}

Quote:

forward kicklogin(playerid);
public kicklogin(playerid)
{
SendClientMessage(playerid,COLOR_GRAD2,"Ai primit kick pentru ca nu te-ai logat in 45 de secunde");
Kick(playerid);
}

Evreything works fine, but when I put my password (correctly or incorrectly) i recieve a kick with this client message
Reply
#2

becose you place the timer after place login/register and when is ready to choise class then you kick him were actully you wonna to kicm him ?
Reply
#3

simple reson for this is that
public OnPlayerRequestClass(playerid, classid) is called each time the player changes the skin
so the more the players gores Left & Right the more timers you create

SOLUTION
pawn Код:
new KickTimer[MAX_PLAYERS];
public OnPlayerRequestClass(playerid, classid)
{
if(KickTimer != -1) return 0;//check if the timer is runnung
KickTimer[playerid] = SetTimerEx("kicklogin", 45000, 0, "d", playerid);
}
Reply
#4

Doesn't work x(
Reply
#5

Why you need a timer for kicking someone who is not loggin in?
Use:
Код:
if(!response)return Kick(playerid);
Reply
#6

just put the timer in OnPlayerConnect..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)