SA-MP Forums Archive
need help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: need help (/showthread.php?tid=105476)



need help - radi - 29.10.2009

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;
    }



Re: need help - Frikandel - 29.10.2009

Hahah lol,

I have the same problem

Please help me/him


Re: need help - MadeMan - 29.10.2009

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.


Re: need help - dirkblok - 29.10.2009

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


Re: need help - radi - 29.10.2009

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 ?


Re: need help - MadeMan - 29.10.2009

Change >= to ==