Help Me Out
#1

hi i have a /setrank command yet it dosent set the rank, i need it to do so if you can find the problem in here please fix / tell me what is wrong, it compiles no warnings or errors.
pawn Код:
if(strcmp(cmd, "/setrank", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /setrank [playerid/PartOfName] [Rank]");
                return 1;
            }
            new playa;
            new rank;
            playa = ReturnUser(tmp);
            rank = strval(tmp);
            if(Admin[playerid] > 8)
            {
                if(IsPlayerConnected(playa))
            {
                if(playa != INVALID_PLAYER_ID)
                {
                    GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        dUserSetINT(PlayerName(playa)).("rank",rank);
                        Rank[playa] = rank;
                        format(string, sizeof(string), "Admin %s gave you %s Rank!", sendername, rank);
                        SendClientMessage(playa, COLOR_YELLOW, string);
                        print(string);
                    }
                }
                else
                {
                SendClientMessage(playerid, COLOR_RED, "You Are Not An Admin!");
                }
                }
            }
        return 1;
        }
Thanks
Reply
#2

-BUMP- this is semi-important i need a reply
Reply
#3

does it say "Admin %s gave you %s Rank!" correctly when you do the command?

you don't need this check either
Код:
   				if(playa != INVALID_PLAYER_ID)
	    		{
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)