Jump to content
  • 0

Problema transfer comanda


Mark S.

Question

Problema intalnita (descriere): Am comanda pe dcmd si nu merge cand o pun pe cmdtext am incercat.
Ero(area / rile) / warning-(ul / urile): 0
Liniile de cod / sursa / script-ul:

dcmd_unabn
{
    if(PlayerInfo[playerid][pAdmin] < 5)
        return 0;

    new rcmsg[80], acct[24], file[64],name[24],string[128],otherfile[64];
    GetPlayerName(playerid, name, sizeof(name));

    if(sscanf(params, "s", acct))
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Usage: /unban <account name>");

    format(file, sizeof(file),"LARP/Users/%s.ini", acct);

    if(!dini_Exists(file))
        return SendClientMessage(playerid, COLOR_LIGHTRED,"Error: account doesn't exists!");

    dini_IntSet(file, "Banned", 0);

    format(ipFILE, 128, "LARP/Users/Aliases/%s.txt", acct);

    format(rcmsg, sizeof(rcmsg), "unbanip %s", dini_Get(ipFILE,"NameIp"));
    SendRconCommand(rcmsg);
    SendRconCommand("reloadbans");

    format(otherfile,sizeof(otherfile),"LARP/Users/Bans/%s.ban",dini_Get(ipFILE,"NameIp"));
    fremove(otherfile);

    format(string, sizeof(string), "[ADMIN]: %s has unbanned The account of %s.", name,acct);
    ABroadCast(COLOR_LIGHTRED,string, 5);
    format(string, sizeof(string), "[ADMIN]: IP %s has been removed by the ban list by %s.", dini_Get(ipFILE,"NameIp"), name);
    ABroadCast(COLOR_WHITE,string, 5);
    format(string, sizeof(string), "* Administrator %s Has Unbanned the account of %s", name,acct);
    SendClientMessageToAll(COLOR_NICERED,string);
    format(string, sizeof(string), "* Successfuly Unbanned %s's account & removed %s from the ban list", name,dini_Get(ipFILE,"NameIp"));
    SendClientMessage(playerid,TEAM_GROVE_COLOR,string);

    new y, m, d;
    new h,mi,s;
    getdate(y,m,d);
    gettime(h,mi,s);
    format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Unbanned the Account of %s (%s)",d,m,y,h,mi,s,name,acct,dini_Get(ipFILE,"NameIp"));
    LoginLog(string);
    return 1;
}


Imagini / Video (optional):
Ati incercat sa rezolvati singur?: da si nu merge, daca ma ajuta cineva sa o pun zice mereu account not exist desi pun numele meu

 

asa am incercat sa o pun pe cmd tezxt si zice ca nu exsta

 

    if(strcmp(cmd, "/unban", true) == 0)
    {
        if(PlayerInfo[playerid][pAdmin] < 5)
            return 0;

        new rcmsg[80], acct[24], file[64],name[24],otherfile[64];
        GetPlayerName(playerid, name, sizeof(name));

        if(sscanf(cmdtext , "s", acct))
            return SendClientMessage(playerid, COLOR_LIGHTRED, "Usage: /unban <account name>");

        format(file, sizeof(file),"LARP/Users/%s.ini", acct);

        if(!dini_Exists(file))
            return SendClientMessage(playerid, COLOR_LIGHTRED,"Error: account doesn't exists!");

        dini_IntSet(file, "Banned", 0);

        format(ipFILE, 128, "LARP/Users/Aliases/%s.txt", acct);

        format(rcmsg, sizeof(rcmsg), "unbanip %s", dini_Get(ipFILE,"NameIp"));
        SendRconCommand(rcmsg);
        SendRconCommand("reloadbans");

        format(otherfile,sizeof(otherfile),"LARP/Users/Bans/%s.ban",dini_Get(ipFILE,"NameIp"));
        fremove(otherfile);

        format(string, sizeof(string), "[ADMIN]: %s has unbanned The account of %s.", name,acct);
        ABroadCast(COLOR_LIGHTRED,string, 5);
        format(string, sizeof(string), "[ADMIN]: IP %s has been removed by the ban list by %s.", dini_Get(ipFILE,"NameIp"), name);
        ABroadCast(COLOR_WHITE,string, 5);
        format(string, sizeof(string), "* Administrator %s Has Unbanned the account of %s", name,acct);
        SendClientMessageToAll(COLOR_NICERED,string);
        format(string, sizeof(string), "* Successfuly Unbanned %s's account & removed %s from the ban list", name,dini_Get(ipFILE,"NameIp"));
        SendClientMessage(playerid,TEAM_GROVE_COLOR,string);

        new y, m, d;
        new h,mi,s;
        getdate(y,m,d);
        gettime(h,mi,s);
        format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Unbanned the Account of %s (%s)",d,m,y,h,mi,s,name,acct,dini_Get(ipFILE,"NameIp"));
        LoginLog(string);
        return 1;
    }
 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.