Jump to content
  • 0

Ajutor Script


faze amuzante

Question

Salut, cand dau /setadmin unui jucator acel jucator primeste functia dar dupa ce da relog nu mai are acea functie de admin, ajutorrr

Multumesc Anticipat!

COMANDA:

 

 

YCMD:setadmin(playerid, params[], help) {

    new id, adminlevel, gString[120];

    if(PlayerInfo[playerid][pAdmin] < 6)
        return SCM(playerid, COLOR_WHITE, AdminOnly);

    if(sscanf(params, "ui", id, adminlevel))
        return SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/setadmin <playerid/name> <Admin Level>");

    if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID)
        return SCM(playerid, COLOR_GREY, "Acel player nu este conectat.");

    if(adminlevel < 0 || adminlevel > 6)
        return SCM(playerid, COLOR_GREY, "Invalid admin level. 0-6");

    if(PlayerInfo[id][pAdmin] > PlayerInfo[playerid][pAdmin])
        return SCM(playerid, COLOR_GREY, "Nu poti folosi aceasta comanda pe acel player. Are admin level mai mare.");

    format(gString, 80, "Ai fost promovat la admin %d de %s", adminlevel, GetName(playerid));
    SCM(id, COLOR_LIGHTBLUE, gString);

    format(gString, 100, "AdmCmd: %s i-a setat lui %s admin level %d.", GetName(playerid), GetName(id), adminlevel);
    SendAdminHelperMessage(COLOR_LOGS, gString);

    if(adminlevel == 0) {
        PlayerInfo[id][pAW] = 0;
        UpdateVar(id, "AW", 0);
        SpecFaction[id] = 0;
        StopFly(playerid);
        UsedFly[playerid] = 0;
        SetPlayerHealthEx(playerid, 100);

        Iter_Remove(PlayerAdmins, id);
    }

    Iter_Add(PlayerAdmins, id);

    finishAchievement(id, 27);
    PlayerInfo[id][pAdmin] = adminlevel;

    new gQuery[180];

    if(adminlevel >= 1)
        format(gQuery, sizeof(gQuery), "UPDATE users SET `Admin`='%d', `Security`='%s', `HelpedPlayers`='0' WHERE `ID`='%d'", PlayerInfo[id][pAdmin]/*, MD5_Hash(DEFAULT_PASSWORD)*/, PlayerInfo[id][pSQLID]);
    else
        UpdateVar(id, "Admin", PlayerInfo[id][pAdmin]);
    mysql_tquery(SQL, gQuery, "", "");
    SetPVarInt(id, "SecurityPlayer", 0);

    return true;
}

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Salut,

la instructiunea mysql ai o variabila comentata care este corespondenta pentru variabila Security

/*, MD5_Hash(DEFAULT_PASSWORD)*/

Din ce se vede ai o parola predefinita, ai doua variante ori elimini comentariul si vei pune parola default ori elimini de tot variabila

  format(gQuery, sizeof(gQuery), "UPDATE users SET `Admin`='%d', `Security`='%s', `HelpedPlayers`='0' WHERE `ID`='%d'", PlayerInfo[id][pAdmin], MD5_Hash(DEFAULT_PASSWORD), PlayerInfo[id][pSQLID]);

sau

  format(gQuery, sizeof(gQuery), "UPDATE users SET `Admin`='%d', `Security`=' ', `HelpedPlayers`='0' WHERE `ID`='%d'", PlayerInfo[id][pAdmin]/*, MD5_Hash(DEFAULT_PASSWORD)*/, PlayerInfo[id][pSQLID]);

 

 

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

  • 0

Folosești aceeași baza ca a și serverului?

Baza având aceleași funcții ca și a gm-ului? 

                     

             a7DfKP7.gif                                                                      FGIfknL.gif

                                                                                                                                                                                                                                                                                                I0aS856.gif

Link to comment
Share on other sites

  • 0

format(gQuery, sizeof(gQuery), "UPDATE users SET `Admin`='%d', `HelpedPlayers`='0' WHERE `ID`='%d'", PlayerInfo[id][pAdmin], PlayerInfo[id][pSQLID]);

                     

             a7DfKP7.gif                                                                      FGIfknL.gif

                                                                                                                                                                                                                                                                                                I0aS856.gif

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.