CopDuty problem
#1

Well, there's a problem...
I've made it where you need to be a LAPD officer to go on copduty and use cuff etc.
And this sounds very noobish, but for an odd reason, it's not allowing me to do that after I use /setfactionleader
Setfactionleader is fully functional on other factions, just not LAPD.
Here's my code
P.S: I CBA to find it myself, if you could do this for me, i'd be happy lol

pawn Код:
CMD:pduty(playerid, params[])
{
    if(PlayerInfo[playerid][pMember] == 1)
    {
        if(CopDuty[playerid] == 0)
        {
            new string[128];
            format(string, sizeof(string), "%s grabs a badge and a police belt from the locker.", PlayerNameEx(playerid));
            ProxDetector(15.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA);
            GPW(playerid, 24, 250);
            GPW(playerid, 3, 1);
            GPW(playerid, 41, 400);
            GPW(playerid, 25, 200);
            SetPlayerColor(playerid, COP_COLOR);
            SetPlayerArmour(playerid, 100);
            SetPlayerHealth(playerid, 100);
            CopDuty[playerid] = 1;
        }
        else
        {
            new string[128];
            format(string, sizeof(string), "%s puts his badge and police belt back in the locker with his supplies.", PlayerNameEx(playerid));
            ProxDetector(15.0, playerid, string, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA, 0xC2A2DAAA);
            ResetPlayerWeapons(playerid);
            SetPlayerColor(playerid, -1);
            CopDuty[playerid] = 0;
        }
    }
    return 1;
}
Reply
#2

Should be something like:

pawn Код:
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1) // checks if is in faction or or is leader of faction 1
    {
Can you show me the makeleader command, or what variable leader is?
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)