need help
#1

how can i fix this
it only shows kicked out of admin team

pawn Код:
if(strcmp(cmd, "/makeadmin", true) == 0)
    {
      tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_GREY, "USAGE: /makeadmin [playerid] [level]");
            return 1;
        }
        giveplayerid = strval(tmp);
        tmp = strtok(cmdtext, idx);
        if (IsPlayerAdmin(playerid))
        {
            if(PlayerInfo[giveplayerid][pAdmin] >= 101)
          {
                format(string, sizeof(string), "%s Has been made a Test-Admin by admin %s", PlayerName[giveplayerid], PlayerName[playerid]);
                SendClientMessageToAll(COLOR_RED, string);
                return 1;
            }
            else if(PlayerInfo[giveplayerid][pAdmin] >= 102)
          {
                format(string, sizeof(string), "%s Has been made a Moderator by admin %s", PlayerName[giveplayerid], PlayerName[playerid]);
                SendClientMessageToAll(COLOR_RED, string);
                return 1;
            }
            else if(PlayerInfo[giveplayerid][pAdmin] >= 103)
          {
                format(string, sizeof(string), "%s Has been made a Admin by admin %s", PlayerName[giveplayerid], PlayerName[playerid]);
                SendClientMessageToAll(COLOR_RED, string);
                return 1;
            }
            else if(PlayerInfo[giveplayerid][pAdmin] >= 104)
          {
                format(string, sizeof(string), "%s Has been made a Super-Admin by admin %s", PlayerName[giveplayerid], PlayerName[playerid]);
                SendClientMessageToAll(COLOR_RED, string);
                return 1;
            }
            else if(PlayerInfo[giveplayerid][pAdmin] >= 105)
          {
                format(string, sizeof(string), "%s Has been made a Super-Admin by admin %s", PlayerName[giveplayerid], PlayerName[playerid]);
                SendClientMessageToAll(COLOR_RED, string);
                return 1;
            }
            else if(PlayerInfo[giveplayerid][pAdmin] <= 1)
      {
                format(string, sizeof(string), "%s Has been kicked out of the admin team by admin %s", PlayerName[giveplayerid], PlayerName[playerid]);
                SendClientMessageToAll(COLOR_RED, string);
                return 1;
            }
            else
      {
                format(string, sizeof(string), "blupblup");
                SendClientMessageToAll(COLOR_RED, string);
        return 1;
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You are a part of the admin team");
        }
        return 1;
    }
Reply
#2

Hahah lol,

I have the same problem

Please help me/him
Reply
#3

pawn Код:
tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_GREY, "USAGE: /makeadmin [playerid] [level]");
            return 1;
        }
        giveplayerid = strval(tmp);
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_GREY, "USAGE: /makeadmin [playerid] [level]");
            return 1;
        }
        PlayerInfo[giveplayerid][pAdmin] = strval(tmp);
Look what part is missing from your code and add it.
Reply
#4

I don't know really but, I don't think this is right:
Код:
else if(PlayerInfo[giveplayerid][pAdmin] <= 1)
at least in php <= isn't right but I don't know if it is in pawno...



Dirk
Reply
#5

thanks mademan 1 prob is fixed
but now a other prob
no it says that i am test-admin
but if i make myself 102 it says i am test-admin
but i am moderator then how to fix that ?
Reply
#6

Change >= to ==
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)