Unban Command - 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: Unban Command (
/showthread.php?tid=458011)
Unban Command -
Blackazur - 14.08.2013
Hello, this is how i ban a user:
Код:
pInfo[targetid][pBanned] = 1;
BanPlayer(targetid,reason,PlayerName(playerid));
How to make with that an unban cmd which unban an offline player or an online player?
Re: Unban Command -
gtakillerIV - 14.08.2013
Check out my Tutorial
https://sampforum.blast.hk/showthread.php?tid=388612
How to ban and unban an offline player.
AW: Unban Command -
Blackazur - 14.08.2013
Thanks and i have a question is timeban possible with YINI?
Re: Unban Command -
gtakillerIV - 14.08.2013
Yep. I've done it before, you'll have to create your own ban file and ban functions though. Quite easy really.
In other words, you're creating your own custom ban system away from sa-mp's original one.
AW: Unban Command -
Blackazur - 14.08.2013
I have an custom ban system and my ban command is so:
Код:
new targetid,reason[105],string[256];
if(sscanf(params, "us[105]", targetid,reason)) return SendClientMessage(playerid,-1,""chat" /ban [playerid] [reason]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""chat""COL_RED" Player is not online.");
if(pInfo[targetid][pAdminLevel] > 0) return SendClientMessage(playerid,-1,""chat""COL_RED" You cannot ban an admin!");
format(string, sizeof(string), ""chat""COL_RED" %s %s has banned %s [Reason: %s]",GetAdminName(playerid),PlayerName(playerid),PlayerName(targetid),reason);
SendClientMessageToAll(-1,string);
pInfo[targetid][pBanned] = 1;
BanPlayer(targetid,reason,PlayerName(playerid));
Can you make me the unban command for that, please? i dont have any idea how to do it that with pbanned = 0; wont work.
Re: Unban Command -
gtakillerIV - 14.08.2013
Show me your BanPlayer function. It should only kick the player. Then under OnPlayerConnect you load his files and check if banned = 1. If so, we kick him.
What the unban command will do is just open the user's (banned) file and set Banned to 0. Thus 'unbanning' him.
Re: Unban Command -
fiki574 - 14.08.2013
Try my newest include, will save you some time. Link in my signature.
AW: Unban Command -
Blackazur - 14.08.2013
Ah i understand now what i have to do thanks but i have a question with offline ban:
Код:
new INI:File = INI_Open(UserPath(filestring));
i got a error:
Код:
argument type mismatch (argument 1)
Re: Unban Command -
gtakillerIV - 14.08.2013
UserPath's first argument must be an integer. For example: UserPath(playerid).
AW: Unban Command -
Blackazur - 14.08.2013
So all working, but how to make an timeban command?