Jump to content

[REZOLVAT] Problema la /setadmin


Mihai112
 Share

Recommended Posts

  • Username : Mihai112
  • Problema întâlnită: Am... da. La comanda /setadmin
  • Detalii despre problemă: Folosesc gamemod-ul "burned big edit" al lui Cosmin aka 47, dar am o problema la comanda /setadmin. Daca ofer cuiva admin, dupa ce acel player da relog ii se seteaza admin 0 automat.
  • Ce ai încercat să faci înainte să postezi?: Am incercat sa sterg "SecurityPlayer" si inca cv. Dar nu a mers.
  • Cod sursa (recomandat pastebin.com) :  ----
  • Alte detalii : imi puteti da comanda, unde admin-ul ramane salvat la /setadmin?.
Link to comment
Share on other sites

Acum 3 minute, Dani3l. a spus:

Codu sursa unde e? s-a pierdut in spatiu?

Uite 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

Chiar acum, RebornAdv a spus:

Da comanda /setadmin aici.

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

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...