SA-MP Forums Archive
Need /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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need /unban Command (/showthread.php?tid=137130)



Need /unban Command - Dudits - 27.03.2010

Well I don't seem to be able to make unban command, here's the info that might be helpful.

My userfiles destination
Код:
/scriptfiles/users/"Name".ini
My ban check
Код:
Banned=0
All I need is a command to set the "Banned" to 0, I will add if player is admin and similar stuff later, just need the base please .


Re: Need /unban Command - Razvann - 27.03.2010

pawn Код:
if (strcmp(cmd, "/unban", true)==0)
    {
        if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 1337)
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /unban [PlayerName]");
                return 1;
            }
            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, 256, "AdmWarning: %s has unbanned %s", sendername,tmp);
            ABroadCast(COLOR_YELLOW,string,1);
            format(string, 256, "AdmWarning: %s has unbanned %s", sendername,tmp);
            printf(string);
            format(string,sizeof(string),"%s.ini",tmp);
            fremove(string);
            SendClientMessage(playerid, COLOR_GRAD1, "Player Unbanned");
        }
        return 1;
    }



Re: Need /unban Command - Dudits - 28.03.2010

The command you gave me just removes the account


Re: Need /unban Command - woot - 28.03.2010

Really easy, just change it to this and customize it. (inputtext)
pawn Код:
new
    var[ 64 ];
format(var, sizeof(var), "/scriptfiles/users/%s.ini", inputtext);
dini_IntSet(var, "banned", 0);



Re: Need /unban Command - Dudits - 28.03.2010

So the whole command will be?


Re: Need /unban Command - DRIFT_HUNTER - 28.03.2010

send your BAN COMMAND


Re: Need /unban Command - Dudits - 28.03.2010

Quote:
Originally Posted by DRIFT_HUNTER
send your BAN COMMAND
Please read carefully before replying with stupid replys. I said I don't have one as I didn't manage to successfully make it.


Re: Need /unban Command - woot - 28.03.2010

Scripting Discussion is not ment for people to make whole things for you, just help you partly.
If you want someone to do a fully working command, try: http://forum.sa-mp.com/index.php?topic=144062.0


Re: Need /unban Command - Jay420 - 30.03.2010

What admin system are you using?

SSomething which sets the
pawn Код:
PlayerInfo[playerid][pBanned] = 0
should do the work