Inconsistently enforcing banned account (Y_INI) - 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: Inconsistently enforcing banned account (Y_INI) (
/showthread.php?tid=510027)
Inconsistently enforcing banned account (Y_INI) -
PrivatioBoni - 29.04.2014
Hi,
I am experiencing a weird problem. I'm trying to make an offline ban system (i.e. the person banned is offline). It is an account ban. The ban itself works fine but the problem starts when a person connects whilst they are banned. When I say 'banned', I mean with the banned enum value, they are not physically Ban(playerid)ned.
The first time a user connects after being offline banned, the kicking them off the server procedure works. However, the second time they try to connect, they get 'server closed connection' almost immediately after player connect. And if I restart the server, I believe it works normally for the first time again.
I've tried adding the kick off function on both OnPlayerSpawn and even something obscure - OnPlayerText. I think I even tried it on login. I've tried it both as a function and not as a function.
pawn Код:
if(PlayerInfo[playerid][pAccountBanned] == 1)
{
new kickstring[124];
format(kickstring,sizeof(kickstring),"[Admin] Server kicked %s(%d). Reason: Account is banned.",GetName(playerid),playerid);
SendClientMessageToAll(COLOR_TOMATO,kickstring);
SetTimerEx("AccountBanned", 1000, 1, "i", playerid);
}
pawn Код:
forward AccountBanned(playerid);
public AccountBanned(playerid)
{
Kick(playerid);
}
If it's of any help, I use the saving system Y_INI although I do not think it makes a difference here as the data is being saved and loaded correctly.
Re: Inconsistently enforcing banned account (Y_INI) -
Richie© - 29.04.2014
You have set repeating enabled in settimerex. This means it will continue to run until you stop server.
Re: Inconsistently enforcing banned account (Y_INI) -
Vince - 29.04.2014
You've unnecessarily set the timer to loop.
Edit: ^ what he said.
Re: Inconsistently enforcing banned account (Y_INI) -
PrivatioBoni - 29.04.2014
Thank you.
Re: Inconsistently enforcing banned account (Y_INI) -
iFarbod - 29.04.2014
change SetTimerEx to CallLocalFunction
Re: Inconsistently enforcing banned account (Y_INI) -
PrivatioBoni - 29.04.2014
Quote:
Originally Posted by iFarbod
change SetTimerEx to CallLocalFunction
|
As you can see above, it's fixed.
Thanks but no thanks.