y_ini unban command
#1

Hello,

I made the system that when you ban someone it also bans their IP.
Now when I unban a player I want the admins to allow them to unban them by name, which should automatically unbans their IP.

pawn Код:
command(unban, playerid, params[])
{
    new name[128], str[128];
    if(sscanf(params, "s", name))
    {
        if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1){SendClientMessage(playerid, WHITE, "SYNTAX: /unban [name]");}
    }
    else
    {
        if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
        {
            format(PlayerInfo[playerid][pUnbanname],128,"%s", name);
            INI_ParseFile(UnBanPath(playerid), "LoadBan_%s", .bExtra = true, .extra = playerid);
            format(str, sizeof str, "/Bans/%s.ini", PlayerInfo[playerid][pUnbanning]);
            fremove(str);
            format(str, sizeof str, "/Bans/%s.ini", PlayerInfo[playerid][pUnbanningIP]);
            fremove(str);
           
            fSendClientMessage(playerid, GREEN, "> You have succesfully unbanned %s with IP %s!",PlayerInfo[playerid][pUnbanning],PlayerInfo[playerid][pUnbanningIP]);
           
            PlayerInfo[playerid][pUnbanningIP] = EOS;
            PlayerInfo[playerid][pUnbanning] = EOS;
        }
    }
    return 1;
}

stock UnBanPath(playerid)
{
    new string[128];
    format(string,sizeof(string),BPATH,PlayerInfo[playerid][pUnbanname]);
    return string;
}

forward LoadBan_Data(playerid,name[],value[]);
public LoadBan_Data(playerid,name[],value[])
{
    INI_String("Username",PlayerInfo[playerid][pUnbanning], 128);
    INI_String("IP",PlayerInfo[playerid][pUnbanningIP], 26);
    printf("Name: %s",PlayerInfo[playerid][pUnbanning]);
    printf("IP: %s",PlayerInfo[playerid][pUnbanningIP]);
    return 1;
}
Problem is it says "> You have succesfully unbanned with IP !"
Reply
#2

BUMB
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)