Need /unban Command
#1

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 .
Reply
#2

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;
    }
Reply
#3

The command you gave me just removes the account
Reply
#4

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);
Reply
#5

So the whole command will be?
Reply
#6

send your BAN COMMAND
Reply
#7

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.
Reply
#8

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
Reply
#9

What admin system are you using?

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


Forum Jump:


Users browsing this thread: 1 Guest(s)