CopDuty problem
#3

pawn Код:
CMD:makefactionleader(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
        new para1,level;
        if(!sscanf(params, "ui", para1, level))
        {
            if(level > 4 || level < 0)
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "   Don't go below number 0 or above number 4!");
                return 1;
            }
            if(IsPlayerConnected(para1))
            {
                PlayerInfo[pInfo][pLeader] = -1;
                PlayerInfo[pInfo][pMember] = level;
                PlayerInfo[pInfo][pRank] = 5;
                new string[100];
                format(string, sizeof(string), "   You have been promoted to leader for %s by Admin %s.", FactionName(level), PlayerNameEx(playerid));
                SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                format(string, sizeof(string), "   You have given %s control to run %s.", PlayerNameEx(para1), FactionName(level));
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                if(level == 0)
                {
                    SendClientMessage(para1, COLOR_LIGHTBLUE, "* You are now a civilian again.");
                    PlayerInfo[pInfo][pMember] = 0;
                    PlayerInfo[pInfo][pLeader] = -1;
                    PlayerInfo[pInfo][pRank] = 0;
                }
                UpdatePlayer(para1);
            }
            else
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "   Invalid player!");
                return 1;
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "USAGE: /MakeFactionLeader [playerid/PartOfName] [Faction ID]");
        }
    }
    return 1;
}
Reply


Messages In This Thread
CopDuty problem - by VladCanarez - 07.10.2012, 15:21
Re: CopDuty problem - by Chriham3 - 07.10.2012, 15:24
Re: CopDuty problem - by VladCanarez - 07.10.2012, 15:56

Forum Jump:


Users browsing this thread: 1 Guest(s)