SA-MP Forums Archive
need help rep +++ - 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)
+--- Thread: need help rep +++ (/showthread.php?tid=307488)



need help rep +++ - KosmasRego - 30.12.2011

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


Re: need help rep +++ - Guest9328472398472 - 30.12.2011

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


Re: need help rep +++ - KosmasRego - 30.12.2011

Anyone can help me?