Unban Command, From DINI to Y_INI.
#7

Maybe try this?
pawn Код:
CMD:unban(playerid, params[])
{
    if(PlayerInfo[playerid][AdminLevel] >= 3)
    {
        new File[50], string[128];
        if(sscanf(params, "u[50]",File)) return SendClientMessage(playerid, COLOR_YELLOW, "-XSBot-: Correct Usage: /unban [Player Name]");
        format(File, sizeof(File), "Users/%s.ini", params);
        if(!fexist(File)) return SendClientMessage(playerid, COLOR_RED, "-XSBot-: This player is not registered.");
        new Bnd;
        new INI:File = INI_Open(File);
        Bnd = INI_Int("Banned", Bnd);
        if(Bnd == 0) return SendClientMessage(playerid, COLOR_RED, "-XSBot-: This player is not marked as banned, unable to proceed with unbanning.");
        INI_WriteInt(File, "Banned", 0);
        INI_Close(File);
        format(string, sizeof(string), "%s has been unbanned by %s", File, GetName(playerid));
        SaveIn("UnbanLog",string);
        format(string, sizeof(string), "-XSBot-: {FF0000}%s {FFFF00}has been unbanned by %s{FFFF00}.", params, GetColorNameID(playerid));
        SendClientMessageToAll(COLOR_YELLOW, string);
    }
    else return SendErrorMessage(playerid, ADMIN_ERROR);
    return 1;
}
Reply


Messages In This Thread
[SOLVED] - by GeekSiMo - 01.08.2014, 17:58
Re: Unban Command, From DINI to Y_INI. - by GeekSiMo - 01.08.2014, 18:20
Re: Unban Command, From DINI to Y_INI. - by PurpleDragon - 01.08.2014, 18:22
Re: Unban Command, From DINI to Y_INI. - by Stinged - 01.08.2014, 18:26
Re: Unban Command, From DINI to Y_INI. - by GeekSiMo - 02.08.2014, 09:42
Re: Unban Command, From DINI to Y_INI. - by nilanjay - 02.08.2014, 10:12
Re: Unban Command, From DINI to Y_INI. - by biker122 - 02.08.2014, 10:14
Re: Unban Command, From DINI to Y_INI. - by Stinged - 02.08.2014, 10:35
Re: Unban Command, From DINI to Y_INI. - by GeekSiMo - 02.08.2014, 10:46
Re: Unban Command, From DINI to Y_INI. - by GeekSiMo - 02.08.2014, 11:36

Forum Jump:


Users browsing this thread: 3 Guest(s)