Jump to content
  • 0

Suport /unban


Mister

Question

Problema intalnita (descriere): Nu merge aceasta comanda sa modifice statusul unui playeroffline
Ero(area / rile) / warning-(ul / urile): nu am
Liniile de cod / sursa / script-ul:

if(strcmp(cmd, "/unban", true) == 0)
    {
        if(PlayerInfo[playerid][pAdmin] > 6)
        {
            new file[64];
            if(IsPlayerConnected(playerid))
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /makeplayer [playerid/PartOfName]");
                    return 1;
                }
                new length = strlen(cmdtext);
                while ((idx < length) && (cmdtext[idx] <= ' '))
                {
                    idx++;
                }
                new offset = idx;
                new result[128];
                while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                {
                    result[idx - offset] = cmdtext[idx];
                    idx++;
                }
                result[idx - offset] = EOS;
                if(strlen(result))
                {
                    format(file, sizeof(file),"LARP/Users/%d.ini", result)
                    if(dini_Exists(file))
                    {
                        dini_IntSet(file, "Banned", 0);
                        SendClientMessage(playerid, COLOR_GREEN, "Ai dat unban playerului");
                    }
                }
            }
        }
        return 1;
    }

Imagini / Video (optional):
Ati incercat sa rezolvati singur?: da

 

asa am declarata variabila ban

asta e la public OnPlayerRegister

 

dini_IntSet(string3, "Banned",PlayerInfo[playerid][pBanned]);

 

asa este la public onplayerupdateex(playerid)

 

dini_IntSet(string3, "Banned",PlayerInfo[playerid][pBanned]);

 

scrie /unban Mister si nu zice nici mesajul cu ai dat unban si nu se modifica, am dat unban si altui player si nu merge

 

PS: aveam aceasta comanda

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;
}
 

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Foloseste comanda asta si vezi daca-ti merge.

dcmd_unban(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] > 6)
    {
        new PlayerFile[50];
        format(PlayerFile, sizeof(PlayerFile), "LARP/Users/%s.ini", params);
        if(!strlen(params)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /unban [playername]");
        if(!dini_Exists(PlayerFile)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "Nu exista nici un jucator cu numele specificat");
        dini_IntSet(PlayerFile, "Banned", 0);
        SendClientMessage(playerid, COLOR_GREEN, "Jucatorul a fost debanat");
    }
    return 1;
}
Link to comment
Share on other sites

  • 0

Salut eu folosesc cmdtext, nu paramas acela, are ceva adica nu se buguie intre ele?

 

 

Comanda merge bine dar nu o poti transforma in cmdtext ?

 

Si as dori ceva de genul (daca se poate)  if("Banned" != 0)  adica daca are deja ban sa nu mai poti sa ii dai

Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

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.