Jump to content
  • 0

problema /setadmin


zonga

Question

salutare am si eu o problema la comanda /setadmin     eu mi-am setat admin 8 di baza de date si cand intru pe server si vreau sa dau admin la cineva imi spune ca nu am acces la accea comanda eu avand admin 8 dece ?

 

 

CMD:setadmin(playerid, params[]) {
    if(!EstiFondator(playerid)) return SCM(playerid, COLOR_ERROR, AdminOnly);
    new userID, admin;
    if(sscanf(params, "ud", userID, admin)) return SCM(playerid, COLOR_SYNTAX, "Syntax: {FFFFFF}/setadmin <Name/ID> <Admin Level>");
    if(admin < 0 || admin > 8) return SCM(playerid, COLOR_ERROR, "Error: Admin level invalid (0 - 8).");
    if(!Connected(userID)) return SCM(playerid, COLOR_ERROR, "Error: This player it's not connected.");
    if(PlayerInfo[userID][pAdmin] == 0 && admin > 0) Iter_Add(ServerAdmins, userID);
    if(PlayerInfo[userID][pAdmin] > 0 && admin == 0) Iter_Remove(ServerAdmins, userID);
    new string[180];
    PlayerInfo[userID][pAdmin] = admin;
    SCM(playerid, COLOR_YELLOW, "You have promoted %s to a level %d admin.", GetName(userID), admin);
    SCM(userID, COLOR_YELLOW, "You've been promoted to level %d admin, by %s %s.", admin, GetAdminName(playerid), GetName(playerid));
    format(string, sizeof(string), "AdmCmd: %s %s set %s's admin level to %d.", GetAdminName(playerid), GetName(playerid), GetName(userID), admin);
    SendAdminMessage(COLOR_LIGHTRED, string, 1);
    print(string);
    if(admin == 0) AdminDuty[userID] = 0;
    UpdateInt(userID, "Admin", PlayerInfo[userID][pAdmin]);
    return 1;

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Deoarece linia asta     if(!EstiFondator(playerid)) return SCM(playerid, COLOR_ERROR, AdminOnly); verifica daca ai numele din acel public.

Cauti public-ul si iti pui numele tau acolo pe care il folosesti pe server sau stergi acea linie si pui verificare daca are admin mai mare decat 6 sau cat doresti tu.

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.