need help rep +++
#1

pawn Код:
if (strcmp("/setcoprank", cmdtext, true, 10) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_PINKCREAM, "/setcoprank [playerid] [rank(1 - 8)]");
                return 1;
            }
            new player1;
            new rank;
            player1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            rank = strval(tmp);
            if(rank > 8 || rank < 0) { SendClientMessage(playerid, COLOR_PINKCREAM, "Invalid rank."); return 1; }
            if (PlayerInfo[playerid][pAdminLevel] >= 3 || PlayerInfo[playerid][pIsCop] >= 6)
            {
                if(IsPlayerConnected(player1))
                {
                    if(player1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(player1, giveplayer, sizeof(giveplayer));

                        PlayerInfo[player1][pIsCop] = rank;
                        format(string, sizeof(string), "Cop rank set to %d by %s",rank, sendername);
                        SendClientMessage(player1, COLOR_GROVESTREET, string);
                        format(string, sizeof(string), "%s's cop rank changed to %d.", giveplayer,rank);
                        SendClientMessage(playerid, COLOR_ORANGE, string);
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_PINKCREAM, "Player is not connected.");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_CREAM, "SERVER: Unknown command.");
            }
        }
        return 1;
    }
it does not work. It does not sets the rank
Reply
#2

In your userfile, are you "PlayerInfo[playerid][pIsCop] >= 6"?
Reply
#3

Anyone can help me?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)