SA-MP Forums Archive
Kick if doesn't login - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Kick if doesn't login (/showthread.php?tid=369611)



Kick if doesn't login - cotyzor - 17.08.2012

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


Re: Kick if doesn't login - doreto - 17.08.2012

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 ?


Re: Kick if doesn't login - park4bmx - 17.08.2012

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);
}



Re: Kick if doesn't login - cotyzor - 20.08.2012

Doesn't work x(


Re: Kick if doesn't login - Admigo - 20.08.2012

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



Re: Kick if doesn't login - avivelkayam - 20.08.2012

just put the timer in OnPlayerConnect..