/giverank
#7

pawn Код:
CMD:giverank(playerid, params[])
{
    if (PlayerInfo[playerid][pLeader] >= 1)
    {
        new string[128], giveplayerid, rank;
        if(sscanf(params, "ud", giveplayerid, rank)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /giverank [playerid] [Rank (1-6)]");

        if(rank > 6 || rank < 0) { SendClientMessageEx(playerid, COLOR_GREY, "   Don't go below number 0, or above number 6!"); return 1; }

        if(IsPlayerConnected(giveplayerid))
        {
            if(PlayerInfo[playerid][pLeader] != PlayerInfo[giveplayerid][pMember])
            {
                SendClientMessageEx(playerid, COLOR_GRAD1, "   That person is not in your faction!");
                return 1;
            }

            if(rank > PlayerInfo[giveplayerid][pRank])
            {
                format(string, sizeof(string), "   You have been promoted to a higher rank by %s.", GetPlayerNameEx(playerid));
            }
            if(rank < PlayerInfo[giveplayerid][pRank])
            {
                format(string, sizeof(string), "   You have been demoted to a lower rank by %s.", GetPlayerNameEx(playerid));
            }
            PlayerInfo[giveplayerid][pRank] = rank;
            SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
            format(string, sizeof(string), "   You have given %s rank %d.", GetPlayerNameEx(giveplayerid),rank);
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command (leaders only)!");
    }
    return 1;
}
Reply


Messages In This Thread
/giverank - by Blackazur - 26.09.2012, 16:31
Re: /giverank - by ikbenremco - 26.09.2012, 16:35
AW: /giverank - by Blackazur - 26.09.2012, 17:57
Re: AW: /giverank - by HyDrAtIc - 26.09.2012, 17:59
AW: /giverank - by Blackazur - 26.09.2012, 18:05
Re: /giverank - by Sasoft - 26.09.2012, 18:11
Re: /giverank - by SmithyComp - 26.09.2012, 18:14
Re: /giverank - by HyDrAtIc - 26.09.2012, 18:15
Re: /giverank - by RedJohn - 26.09.2012, 18:18
Re: /giverank - by Sasoft - 26.09.2012, 18:20

Forum Jump:


Users browsing this thread: 2 Guest(s)