URGENT HELP, NOT LOGGED = KICK - 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: URGENT HELP, NOT LOGGED = KICK (
/showthread.php?tid=470719)
URGENT HELP, NOT LOGGED = KICK -
Alex_Obando - 19.10.2013
pawn Код:
forward LoginKick(playerid);
public LoginKick(playerid)
{
KillTimer( loginkickTimer[playerid] );
if( !IsPlayerConnected(playerid) ) return 0;
if(!IsLoggedIn(playerid))
{
new str[100];
if(loginTime[playerid] > 0)
{
// Count down code here
format( str, sizeof(str), "You have 10 seconds to login!");
GameTextForPlayer( playerid, str, 5000, 5 );
loginkickTimer[playerid] = SetTimerEx( "LoginKick", 10000, false, "i", playerid );
print("test1");
}
else
{
format( str, sizeof(str), "You have 10 seconds adwwadawdawdwto login!");
GameTextForPlayer( playerid, str, 5000, 5 );
print("test2");
}
}
return 1;
}
I want that if the player doesnt login in 10 seconds he's kicked, plaese help :C
+REP for help.
Re: URGENT HELP, NOT LOGGED = KICK -
Konstantinos - 19.10.2013
pawn Код:
new
bool: User_Logged_In[ MAX_PLAYERS char ]
;
// OnPlayerConnect:
User_Logged_In{ playerid } = false;
// When they are logged in to their account:
User_Logged_In{ playerid } = true;
// When it's time to login:
SetTimerEx( "OnPlayerLoginTime", 10000, false, "i", playerid );
forward OnPlayerLoginTime( playerid );
public OnPlayerLoginTime( playerid )
{
if( !User_Logged_In{ playerid } ) Kick( playerid );
}
EDIT: pds2k12, none of them will work. It does not matter what value you're going to return. Neither
continue; would work since there's not any loop to skip.
Re: URGENT HELP, NOT LOGGED = KICK - Patrick - 19.10.2013
This is the problem why your code won't work.
Wrong
pawn Код:
if( !IsPlayerConnected(playerid) ) return 0;
Right
pawn Код:
if( !IsPlayerConnected(playerid) ) return 1; //or if( !IsPlayerConnected(playerid) ) continue;
EDIT:Look at Konstantino First and to fix the IsPlayerConnected Problem, look at this one.