/giverank command bug
#10

pawn Код:
if(strcmp(cmd, "/giverank", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_DGOLD, "Koristite: /giverank [playerid/PartOfName] [Number(1-6)]");
        new para1;
        new level;
        para1 = ReturnUser(tmp);
        tmp = strtok(cmdtext, idx);
        level = strval(tmp);
       
        //===========[Error Checking]===========\\
        if(PlayerInfo[playerid][pLeader] < 1) return SendClientMessage(playerid, COLOR_GREY, "You aren't a leader!");
        if(PlayerInfo[para1][pLeader] > 0) return SendClientMessage(playerid, COLOR_GOLD, "LEADER INFO: You can't set ranks to a leader!");
        if(level > 6 || level < 0) return SendClientMessage(playerid, COLOR_GREY, " SERVER: Organizacija ima rank od 1 do 6.");
        if(PlayerInfo[playerid][pLeader] != PlayerInfo[para1][pMember]) return SendClientMessage(playerid, COLOR_GOLD, "LEADER INFO: That player is not in your organization!");
        if(para1 == playerid) return SendClientMessage(playerid, COLOR_GREY, "You can't rank yourself!!");
        if(para1 != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Invalid player!");
        if(!IsPlayerConnected(para1)) return SendClientMessage(playerid, COLOR_GREY, "Player not connected!");
        //======================================\\

        if(PlayerInfo[playerid][pLeader] >= 1 && PlayerInfo[playerid][pLeader] <= 9 || PlayerInfo[playerid][pLeader] == 11) //Not sure if you want/have hitman leader - you can take it out or whatever
        {
            GetPlayerName(para1, giveplayer, sizeof(giveplayer));
            GetPlayerName(playerid, sendername, sizeof(sendername));
            PlayerInfo[para1][pRank] = level;
            format(string, sizeof(string), "ORG INFO: You have been promoted to rank %d by your leader %s.", level, sendername);
            SendClientMessage(para1, COLOR_GOLD, string);
            format(string, sizeof(string), "LEADER INFO: You have given rank %d to a member %s.", level, giveplayer);
            SendClientMessage(playerid, COLOR_GOLD, string);
           
            switch(PlayerInfo[playerid][pLeader])
            {
                case 1: //pd
                {
                    if(PlayerInfo[para1][pSex] == 1)
                    {
                        //Male Skin
                        if(PlayerInfo[para1][pRank] == 1) { PlayerInfo[para1][pChar] = 280; SetPlayerSkin(para1, 280); }
                        else if(PlayerInfo[para1][pRank] == 2) { PlayerInfo[para1][pChar] = 280; SetPlayerSkin(para1, 280); }
                        else if(PlayerInfo[para1][pRank] == 3) { PlayerInfo[para1][pChar] = 281; SetPlayerSkin(para1, 281); }
                        else if(PlayerInfo[para1][pRank] == 4) { PlayerInfo[para1][pChar] = 281; SetPlayerSkin(para1, 281); }
                        else if(PlayerInfo[para1][pRank] == 5) { PlayerInfo[para1][pChar] = 282; SetPlayerSkin(para1, 282); }
                        else if(PlayerInfo[para1][pRank] == 6) { PlayerInfo[para1][pChar] = 282; SetPlayerSkin(para1, 282); }
                    }
                    else if(PlayerInfo[para1][pSex] == 2)
                    {
                        PlayerInfo[para1][pChar] = 211; SetPlayerSkin(para1, 211);
                    }
                }
                case 2: //BB Street Racer's
                {
                    if(PlayerInfo[para1][pSex] == 1)
                    {
                        //Male Skin
                        if(PlayerInfo[para1][pRank] == 1) { PlayerInfo[para1][pChar] = 50; SetPlayerSkin(para1, 50); }
                        else if(PlayerInfo[para1][pRank] == 2) { PlayerInfo[para1][pChar] = 50; SetPlayerSkin(para1, 50); }
                        else if(PlayerInfo[para1][pRank] == 3) { PlayerInfo[para1][pChar] = 29; SetPlayerSkin(para1, 29); }
                        else if(PlayerInfo[para1][pRank] == 4) { PlayerInfo[para1][pChar] = 29; SetPlayerSkin(para1, 29); }
                        else if(PlayerInfo[para1][pRank] == 5) { PlayerInfo[para1][pChar] = 217; SetPlayerSkin(para1, 217); }
                        else if(PlayerInfo[para1][pRank] == 6) { PlayerInfo[para1][pChar] = 217; SetPlayerSkin(para1, 217); }
                    }
                    else if(PlayerInfo[para1][pSex] == 2)
                    {
                        PlayerInfo[para1][pChar] = 211; SetPlayerSkin(para1, 211);
                    }
                }
                case 3: //Y Street Racer's
                {
                    if(PlayerInfo[para1][pSex] == 1)
                    {
                        //Male Skin
                        if(PlayerInfo[para1][pRank] == 1) { PlayerInfo[para1][pChar] = 59; SetPlayerSkin(para1, 59); }
                        else if(PlayerInfo[para1][pRank] == 2) { PlayerInfo[para1][pChar] = 59; SetPlayerSkin(para1, 59); }
                        else if(PlayerInfo[para1][pRank] == 3) { PlayerInfo[para1][pChar] = 120; SetPlayerSkin(para1, 120); }
                        else if(PlayerInfo[para1][pRank] == 4) { PlayerInfo[para1][pChar] = 120; SetPlayerSkin(para1, 120); }
                        else if(PlayerInfo[para1][pRank] == 5) { PlayerInfo[para1][pChar] = 186; SetPlayerSkin(para1, 186); }
                        else if(PlayerInfo[para1][pRank] == 6) { PlayerInfo[para1][pChar] = 186; SetPlayerSkin(para1, 186); }
                    }
                    else if(PlayerInfo[para1][pSex] == 2)
                    {
                        PlayerInfo[para1][pChar] = 211; SetPlayerSkin(para1, 211);
                    }
                }
                case 4: //GH Street Racer's
                {
                    if(PlayerInfo[para1][pSex] == 1)
                    {
                        //Male Skin
                        if(PlayerInfo[para1][pRank] == 1) { PlayerInfo[para1][pChar] = 122; SetPlayerSkin(para1, 122); }
                        else if(PlayerInfo[para1][pRank] == 2) { PlayerInfo[para1][pChar] = 122; SetPlayerSkin(para1, 122); }
                        else if(PlayerInfo[para1][pRank] == 3) { PlayerInfo[para1][pChar] = 101; SetPlayerSkin(para1, 101); }
                        else if(PlayerInfo[para1][pRank] == 4) { PlayerInfo[para1][pChar] = 101; SetPlayerSkin(para1, 101); }
                        else if(PlayerInfo[para1][pRank] == 5) { PlayerInfo[para1][pChar] = 241; SetPlayerSkin(para1, 241); }
                        else if(PlayerInfo[para1][pRank] == 6) { PlayerInfo[para1][pChar] = 241; SetPlayerSkin(para1, 241); }
                    }
                    else if(PlayerInfo[para1][pSex] == 2)
                    {
                        PlayerInfo[para1][pChar] = 211; SetPlayerSkin(para1, 211);
                    }
                }
                case 5: //PT Street Racer's
                {
                    if(PlayerInfo[para1][pSex] == 1)
                    {
                        //Male Skin
                        if(PlayerInfo[para1][pRank] == 1) { PlayerInfo[para1][pChar] = 179; SetPlayerSkin(para1, 179); }
                        else if(PlayerInfo[para1][pRank] == 2) { PlayerInfo[para1][pChar] = 179; SetPlayerSkin(para1, 179); }
                        else if(PlayerInfo[para1][pRank] == 3) { PlayerInfo[para1][pChar] = 206; SetPlayerSkin(para1, 206); }
                        else if(PlayerInfo[para1][pRank] == 4) { PlayerInfo[para1][pChar] = 206; SetPlayerSkin(para1, 206); }
                        else if(PlayerInfo[para1][pRank] == 5) { PlayerInfo[para1][pChar] = 202; SetPlayerSkin(para1, 202); }
                        else if(PlayerInfo[para1][pRank] == 6) { PlayerInfo[para1][pChar] = 202; SetPlayerSkin(para1, 202); }
                    }
                    else if(PlayerInfo[para1][pSex] == 2)
                    {
                        PlayerInfo[para1][pChar] = 211; SetPlayerSkin(para1, 211);
                    }
                }
                case 6: //Aztecas Gang
                {
                    if(PlayerInfo[para1][pSex] == 1)
                    {
                        //Male Skin
                        if(PlayerInfo[para1][pRank] == 1) { PlayerInfo[para1][pChar] = 114; SetPlayerSkin(para1, 114); }
                        else if(PlayerInfo[para1][pRank] == 2) { PlayerInfo[para1][pChar] = 114; SetPlayerSkin(para1, 114); }
                        else if(PlayerInfo[para1][pRank] == 3) { PlayerInfo[para1][pChar] = 116; SetPlayerSkin(para1, 116); }
                        else if(PlayerInfo[para1][pRank] == 4) { PlayerInfo[para1][pChar] = 116; SetPlayerSkin(para1, 116); }
                        else if(PlayerInfo[para1][pRank] == 5) { PlayerInfo[para1][pChar] = 115; SetPlayerSkin(para1, 115); }
                        else if(PlayerInfo[para1][pRank] == 6) { PlayerInfo[para1][pChar] = 115; SetPlayerSkin(para1, 115); }
                    }
                    else if(PlayerInfo[para1][pSex] == 2)
                    {
                        PlayerInfo[para1][pChar] = 41; SetPlayerSkin(para1, 41);
                    }
                }
                case 7: //Vagos gang
                {
                    if(PlayerInfo[para1][pSex] == 1)
                    {
                        //Male Skin
                        if(PlayerInfo[para1][pRank] == 1) { PlayerInfo[para1][pChar] = 30; SetPlayerSkin(para1, 30); }
                        else if(PlayerInfo[para1][pRank] == 2) { PlayerInfo[para1][pChar] = 30; SetPlayerSkin(para1, 30); }
                        else if(PlayerInfo[para1][pRank] == 3) { PlayerInfo[para1][pChar] = 110; SetPlayerSkin(para1, 110); }
                        else if(PlayerInfo[para1][pRank] == 4) { PlayerInfo[para1][pChar] = 110; SetPlayerSkin(para1, 110); }
                        else if(PlayerInfo[para1][pRank] == 5) { PlayerInfo[para1][pChar] = 109; SetPlayerSkin(para1, 109); }
                        else if(PlayerInfo[para1][pRank] == 6) { PlayerInfo[para1][pChar] = 109; SetPlayerSkin(para1, 109); }
                    }
                    else if(PlayerInfo[para1][pSex] == 2)
                    {
                        PlayerInfo[para1][pChar] = 211; SetPlayerSkin(para1, 211);
                    }
                }
                case 8://Grove Street Families
                {
                    if(PlayerInfo[para1][pSex] == 1)
                    {
                        //Male Skin
                        if(PlayerInfo[para1][pRank] == 1) { PlayerInfo[para1][pChar] = 107; SetPlayerSkin(para1, 107); }
                        else if(PlayerInfo[para1][pRank] == 2) { PlayerInfo[para1][pChar] = 107; SetPlayerSkin(para1, 107); }
                        else if(PlayerInfo[para1][pRank] == 3) { PlayerInfo[para1][pChar] = 105; SetPlayerSkin(para1, 105); }
                        else if(PlayerInfo[para1][pRank] == 4) { PlayerInfo[para1][pChar] = 105; SetPlayerSkin(para1, 105); }
                        else if(PlayerInfo[para1][pRank] == 5) { PlayerInfo[para1][pChar] = 271; SetPlayerSkin(para1, 271); }
                        else if(PlayerInfo[para1][pRank] == 6) { PlayerInfo[para1][pChar] = 271; SetPlayerSkin(para1, 271); }
                    }
                    else if(PlayerInfo[para1][pSex] == 2)
                    {
                        PlayerInfo[para1][pChar] = 211; SetPlayerSkin(para1, 211);
                    }
                }
                case 9://Bloods gang
                {
                    if(PlayerInfo[para1][pSex] == 1)
                    {
                        //Male Skin
                        if(PlayerInfo[para1][pRank] == 1) { PlayerInfo[para1][pChar] = 102; SetPlayerSkin(para1, 102); }
                        else if(PlayerInfo[para1][pRank] == 2) { PlayerInfo[para1][pChar] = 102; SetPlayerSkin(para1, 102); }
                        else if(PlayerInfo[para1][pRank] == 3) { PlayerInfo[para1][pChar] = 103; SetPlayerSkin(para1, 103); }
                        else if(PlayerInfo[para1][pRank] == 4) { PlayerInfo[para1][pChar] = 103; SetPlayerSkin(para1, 103); }
                        else if(PlayerInfo[para1][pRank] == 5) { PlayerInfo[para1][pChar] = 104; SetPlayerSkin(para1, 104); }
                        else if(PlayerInfo[para1][pRank] == 6) { PlayerInfo[para1][pChar] = 104; SetPlayerSkin(para1, 104); }
                    }
                    else if(PlayerInfo[para1][pSex] == 2)
                    {
                        PlayerInfo[para1][pChar] = 211; SetPlayerSkin(para1, 211);
                    }
                }
                case 11://Hitman
                {
                    if(PlayerInfo[para1][pSex] == 1)
                    {
                        //Male Skin
                        if(PlayerInfo[para1][pRank] == 1) { PlayerInfo[para1][pChar] = 163; SetPlayerSkin(para1, 112); }
                        else if(PlayerInfo[para1][pRank] == 2) { PlayerInfo[para1][pChar] = 112; SetPlayerSkin(para1, 112); }
                        else if(PlayerInfo[para1][pRank] == 3) { PlayerInfo[para1][pChar] = 127; SetPlayerSkin(para1, 127); }
                        else if(PlayerInfo[para1][pRank] == 4) { PlayerInfo[para1][pChar] = 127; SetPlayerSkin(para1, 127); }
                        else if(PlayerInfo[para1][pRank] == 5) { PlayerInfo[para1][pChar] = 166; SetPlayerSkin(para1, 166); }
                        else if(PlayerInfo[para1][pRank] == 6) { PlayerInfo[para1][pChar] = 166; SetPlayerSkin(para1, 166); }
                    }
                    else if(PlayerInfo[para1][pSex] == 2)
                    {
                        PlayerInfo[para1][pChar] = 211; SetPlayerSkin(para1, 211);
                    }
                }
            }
        }
        else return SendClientMessage(playerid, COLOR_RED, "[Greška!]{FFFFFF} You are not a leader of any organization!");
        return 1;
    }
How about this?
Reply


Messages In This Thread
/giverank command bug - by The One - 09.03.2012, 23:33
Re: /giverank command bug - by Shabi RoxX - 10.03.2012, 04:09
Re: /giverank command bug - by The One - 10.03.2012, 10:36
Re: /giverank command bug - by CAR - 10.03.2012, 11:40
Re: /giverank command bug - by The One - 10.03.2012, 11:55
Re: /giverank command bug - by Reklez - 10.03.2012, 11:59
Re: /giverank command bug - by CAR - 10.03.2012, 12:03
Re: /giverank command bug - by The One - 10.03.2012, 12:34
Re: /giverank command bug - by The One - 10.03.2012, 20:54
Re: /giverank command bug - by [ABK]Antonio - 10.03.2012, 22:21

Forum Jump:


Users browsing this thread: 1 Guest(s)