SOLVED
#1

PROBLEM SOLVED.
I admit I posted it before searching/trying in the problem enough.
Please any admin remove this topic.

Sorry for forums spam.
Reply
#2

pawn Код:
if(strcmp(cmd, "/makeadmin", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] >= 0) // <<==== after make yourself admin change this !! to ( >= 10 or what do u want ;) )
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "{7DAEFF}USAGE: /makeadmin [playerid/PartOfName] [level(1-10)]{7DAEFF}");
                    return 1;
                }
                new para1;
                new level;
                para1 = ReturnUser(tmp);
                tmp = strtok(cmdtext, idx);
                level = strvalEx(tmp);
                if(IsPlayerConnected(para1))
                if(level > 10 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "You can't go higher than 7 or lower than 0."); return 1; }
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pAdmin] = level;
                        printf("Info: %s has promoted %s to a level %d admin.", sendername, giveplayer, level);
                        format(string, sizeof(string), "You have been promoted/demoted to a level %d admin by %s.", level, sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "You have promoted/demoted %s to a level %d admin.", giveplayer,level);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
        }
        return 1;
    }
Reply
#3

You didn't say to the server that the default level should be 0. Add this:
pawn Код:
new PlayerInfo[playerid][pAdmin] = 0;
Reply
#4

Thanks guys, I really appreciate that.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)