Jump to content
  • 0

Ajutor comanda setadmin



Problema intalnita (descriere): Am comanda in gm dar cand intru pe server si dau setadmin nu imi apare nmc in chat si nici nu seteaza nimic..
Ero(area / rile) / warning-(ul / urile):
Liniile de cod / sursa / script-ul(obligatoriu):-
Imagini / Video (optional):-
Ati incercat sa rezolvati singur?: Da

CMD:setadmin(playerid, params[])

        if(sscanf(params, "s[60]i", playername,level)) return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/setadmin [exact player name] [level]");
            playeradmid = GetPlayerID(playername);
                if(level >= 0 && level <= 7)

                    GetPlayerName(playeradmid, szPlayerName, MAX_PLAYER_NAME);
                    format(string, sizeof(string), "You have made %s a level %d admin.", szPlayerName, level);
                    SendClientMessage(playerid, COLOR_WHITE, string);

                    GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);

                    if(level == 0) format(string, sizeof(string), "Administrator %s has removed you from the admins team.", szPlayerName);
                    else if(level >= playerVariables[playeradmid][pAdminLevel]) format(string, sizeof(string), "Administrator %s has promoted you to a level %d admin.", szPlayerName, level);
                    else if (level <= playerVariables[playeradmid][pAdminLevel]) format(string, sizeof(string), "Administrator %s has demoted you to a level %d admin.", szPlayerName, level);

                    SendClientMessage(playeradmid, COLOR_NICESKY, string);

                    playerVariables[playeradmid][pAdminLevel] = level;
                else SendClientMessage(playerid, COLOR_GREY, "Valid admins levels are 0 to 6.");
                new query[500];

                new aString[500];

                format(query, 500,"UPDATE playeraccounts SET playerAdminLevel = '%d' WHERE playerName = '%s'", level, playername);

                format(aString, sizeof(aString), "Offline: You have made %s admin level %d.", playername, level);
                SCM(playerid,COLOR_BLUE, aString);

    return 1;

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

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.