Little help here.
#2

Here you go, I've copied this from my own script, feel free to edit it..
-

pawn Код:
if(strcmp(cmd, "/banaccount", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new string2[256];
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GREY, "USAGE: /banaccount [full name(case sensative)]");
                return 1;
            }
            if(PlayerInfo[playerid][pAdmin] >= 4)
            {
                format(string, sizeof(string), "users/%s.ini",tmp);
                if(dini_Exists(string))
                {
                    if(dini_Int(string, "Band") == 0)
                    {
                        if(dini_Int(string, "AdminLvl") > PlayerInfo[playerid][pAdmin])
                        {
                            SendClientMessage(playerid, COLOR_GREY, "You can't ban higher level Admins !");
                            return 1;
                        }
                        dini_IntSet(string, "Band", 3);
                        string2 = dini_Get(string, "IP");
                        format(string, sizeof(string),"banip %s", string2);
                        SendRconCommand(string);
                        SendRconCommand("reloadbans");
                        format(string, 256, "AdmWarning: %s has banned account '%s' and IP '%s'.",PlayerName(playerid),tmp,string2);
                        ABroadCast(COLOR_LIGHTRED, string, 1);
                        return 1;
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GRAD2, "That player is already account-banned. You have banned their IP.");
                        string2 = dini_Get(string, "IP");
                        format(string, sizeof(string), "banip %s", string2);
                        SendRconCommand(string);
                        SendRconCommand("reloadbans");
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "That player does not exist!");
                }
            }
        }
        return 1;
    }
Reply


Messages In This Thread
Little help here. - by Crystallize - 23.11.2013, 08:05
Re: Little help here. - by Stanford - 23.11.2013, 08:22
Re: Little help here. - by Joy_Freed - 23.11.2013, 08:39
Re: Little help here. - by LeeXian99 - 23.11.2013, 09:21
Re: Little help here. - by Crystallize - 24.11.2013, 09:18

Forum Jump:


Users browsing this thread: 1 Guest(s)