Jump to content
  • 0

Comanda /makeadmin Problema


InfernoZone

Question

Salut am o problema am facut o comanda /makeadmin si nu reusesc sa fac ca cei care au gen admin 6 sa nu poate sa isi dea 7 sau asa sau sa nu poti trece de adm 6 cu /makeadmin va las comanda mai jos Ms mult 

cmd:makeadmin(playerid, params[])
{
    if(pInfo[playerid][pAdmin] >= 7)
    {
        new giveplayerid, level;
        if(sscanf(params, "ud", giveplayerid, level)) return SendSyntaxMessage(playerid, "/makeadmin [playerid/name] [level]");
        if(giveplayerid == INVALID_PLAYER_ID || pInfo[giveplayerid][pStatus] != 1) return SendClientMessage(playerid, COLOR_DARKGRAY, "Player not connected.");
        pInfo[giveplayerid][pStaff] = 0;
        if(level < 10 && level != 0)
        {
            new status[16];
            if(level > pInfo[giveplayerid][pAdmin] ? format(status, sizeof(status), "promoted") : format(status, sizeof(status), "demoted"))
            pInfo[giveplayerid][pAdmin] = level, Iter_Add(Stafff, giveplayerid);
            format(AdminWText, sizeof(AdminWText), "Admcmd: %s has %s %s to Level %d Admin.", GetName(playerid), status, GetName(giveplayerid), level);
            SendAdminMessage(playerid, COLOR_ADMWARNING, AdminWText);
            format(stmsg[giveplayerid], 72, "Admin %s has %s your to Level %d Admin.", GetName(playerid), status, level);
            SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, stmsg[giveplayerid]);
            mysql_format(MySQLCon, quMYSQL, 100, "UPDATE `players` SET `Admin`=%d WHERE `ID`=%d", pInfo[giveplayerid][pAdmin], pInfo[giveplayerid][pID]), mysql_tquery(MySQLCon, quMYSQL);
            return 1;
        }
        else if(level == 0)
        {
            if(pInfo[giveplayerid][pHelper] < 1) Iter_Remove(Stafff, giveplayerid), TextDrawHideForPlayer(giveplayerid, RHTXT);
            pInfo[giveplayerid][pAdmin] = level;
            format(AdminWText, sizeof(AdminWText), "Admcmd: %s has removed %s from the Admin Team.", GetName(playerid), GetName(giveplayerid));
            SendAdminMessage(playerid, COLOR_ADMWARNING, AdminWText);
            format(stmsg[giveplayerid], 72, "Admin %s has removed your from the Admin Team.", GetName(playerid));
            SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, stmsg[giveplayerid]);
            mysql_format(MySQLCon, quMYSQL, 100, "UPDATE `players` SET `Admin`=%d WHERE `ID`=%d", pInfo[giveplayerid][pAdmin], pInfo[giveplayerid][pID]), mysql_tquery(MySQLCon, quMYSQL);
            return 1;
        }
        else return SendClientMessage(playerid, COLOR_DARKGRAY, "Invalid Admin Level.");
    }
    else return SendClientMessage(playerid, COLOR_DARKGRAY, AdminError);
}

Edited by InfernoZone
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0
1 hour ago, nobilzeusAdv said:

if(pInfo[giveplayerid][pAdmin] < 7 && level >= 7) return n-ai voie

Salut ms ca incerci sa ma ajuti dar cand o pun si ii dau compile nu imi mai porneste sv daca ai putea sa copii comanda scrisa de mine mai sus si sa introduci tu codul respectiv unde trebuie pus Mersi Mult 

Link to comment
Share on other sites

  • 0
Chiar acum, InfernoZone a spus:

Salut ms ca incerci sa ma ajuti dar cand o pun si ii dau compile nu imi mai porneste sv daca ai putea sa copii comanda scrisa de mine mai sus si sa introduci tu codul respectiv unde trebuie pus Mersi Mult 

doar admin 7 o sa aiba acces, cred ca asta vrei
cmd:makeadmin(playerid, params[])
{
    if(pInfo[playerid][pAdmin] < 7) return 1;
    new giveplayerid, level;
    if(sscanf(params, "ui", giveplayerid, level)) return SendSyntaxMessage(playerid, "/makeadmin [playerid/name] [level]");
    if(giveplayerid == INVALID_PLAYER_ID || pInfo[giveplayerid][pStatus] != 1) return SendClientMessage(playerid, COLOR_DARKGRAY, "Player not connected.");
    if(level < 10 && level != 0)
    {
        new status[16];
        if(level > pInfo[giveplayerid][pAdmin] ? format(status, sizeof(status), "promoted") : format(status, sizeof(status), "demoted"))
        pInfo[giveplayerid][pAdmin] = level, Iter_Add(Stafff, giveplayerid);
        format(AdminWText, sizeof(AdminWText), "Admcmd: %s has %s %s to Level %d Admin.", GetName(playerid), status, GetName(giveplayerid), level);
        SendAdminMessage(playerid, COLOR_ADMWARNING, AdminWText);
        format(stmsg[giveplayerid], 72, "Admin %s has %s your to Level %d Admin.", GetName(playerid), status, level);
        SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, stmsg[giveplayerid]);
        mysql_format(MySQLCon, quMYSQL, 100, "UPDATE `players` SET `Admin`=%d WHERE `ID`=%d", pInfo[giveplayerid][pAdmin], pInfo[giveplayerid][pID]), mysql_tquery(MySQLCon, quMYSQL);
        return 1;
    }
    else if(level == 0)
    {
        if(pInfo[giveplayerid][pHelper] < 1) Iter_Remove(Stafff, giveplayerid), TextDrawHideForPlayer(giveplayerid, RHTXT);
        pInfo[giveplayerid][pStaff] = 0;
        pInfo[giveplayerid][pAdmin] = level;
        format(AdminWText, sizeof(AdminWText), "Admcmd: %s has removed %s from the Admin Team.", GetName(playerid), GetName(giveplayerid));
        SendAdminMessage(playerid, COLOR_ADMWARNING, AdminWText);
        format(stmsg[giveplayerid], 72, "Admin %s has removed your from the Admin Team.", GetName(playerid));
        SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, stmsg[giveplayerid]);
        mysql_format(MySQLCon, quMYSQL, 100, "UPDATE `players` SET `Admin`=%d WHERE `ID`=%d", pInfo[giveplayerid][pAdmin], pInfo[giveplayerid][pID]), mysql_tquery(MySQLCon, quMYSQL);
        return 1;
    }
    return 1;
}

daca nu iti merge nici asa ai facut ceva la pAdmin, verifica

aqpUjAc.png

 

 

 

 

Link to comment
Share on other sites

  • 0

    if(PlayerInfo[playerid][pAdmin] == 6 && PlayerInfo[id][pAdmin] >= 7) return SCM(playerid, -1, "Nu poti seta admin level-ul acelui player."); // asta e ca de ex daca x are adm 6 si y are adm 7 sa nu i poata seta admin  0 lui y
    if(id == playerid) return SCM(playerid, -1, "Nu poti folosi aceasta comanda pe tine.");  // asta e ca sa nu si mai deie admin lui.

 

 

Cand eram mic, eram mare zdreanta Eu fut*am femei, vara miu umbla prin casa

LINIE-3.gif.f4c03161035b1ce4c431755a78bed2ae.gif.aacf6e45f3894429f134b2e37f997f6f.gif

Discord: ㍿ Luca лол㍿ツ#5482

Sunt de moda veche inca mai cred in Respect!

LINIE-3.gif.f4c03161035b1ce4c431755a78bed2ae.gif.bcf86dadd9b43351554dd738f470725f.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.