/makeleader problem
#10

Try

pawn Код:
if(strcmp(cmd, "/makeleader", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SyntaxMessage(playerid, "/makeleader [playerid/name] [number]");
                return 1;
            }
            new para1;
            para1 = ReturnUser(tmp);
            if(IsPlayerNPC(para1)) return 1;
            tmp2 = strtok(tmp, idx);
            if(!strlen(tmp2))
            {
                SyntaxMessage(playerid, "/makeleader [playerid/name] [number]");
                return 1;
            }
            new faction;
            faction = strval(tmp);
            if(faction < 0 || faction > MAX_FACTIONS) { format(string, sizeof(string), "Faction ID can't be below 0 or above %d.", MAX_FACTIONS); SendClientMessage(playerid, GREY, string); return 1; }
            if(faction != 0 && !FactionInfo[faction][FactionExists]) return SendClientMessage(playerid, GREY, "Invalid faction ID.");
            if(PlayerInfo[playerid][pAdmin] >= 99999 || PlayerInfo[playerid][pFactionMod] > 0)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        PlayerInfo[para1][pRank] = (faction) ? (6) : (0);
                        MakeLeaderOf(para1, faction);
                        format(string, sizeof(string), "WARNING :- You have given %s the leadership-badge of the %s orgnizaiton.", giveplayer,FactionInfo[faction][FactionName]);
                        SendClientMessage(playerid, LIGHTBLUE, string);
                        format(string, sizeof(string), "WARNING :- Adminstrator %s has given you the leadership-badge of the %s orgnization.",sendername,FactionInfo[faction][FactionName]);
                        SendClientMessage(para1, COLOR_LIGHTRED, string);
                        PlayerInfo[para1][pLeader] = faction;
                        PlayerInfo[para1][pMember] = faction;
                        PlayerInfo[para1][pDivision] = 0;
                        SetPlayerToTeamColor(para1);
                        OnPlayerSave(para1);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, GREY, "    You are not authorized to use that command.");
            }
        }
        return 1;
    }
Reply


Messages In This Thread
/makeleader problem - by freaxas - 29.06.2014, 19:27
Re: /makeleader problem - by VladimirMark - 29.06.2014, 20:10
Re: /makeleader problem - by freaxas - 30.06.2014, 03:38
Re: /makeleader problem - by tandytanz - 30.06.2014, 05:45
Re: /makeleader problem - by freaxas - 30.06.2014, 08:47
Re: /makeleader problem - by freaxas - 30.06.2014, 14:31
Re: /makeleader problem - by greentarch - 30.06.2014, 14:39
Re: /makeleader problem - by freaxas - 30.06.2014, 18:50
Re: /makeleader problem - by PrivatioBoni - 30.06.2014, 19:35
Re: /makeleader problem - by Stereotype - 30.06.2014, 20:18

Forum Jump:


Users browsing this thread: 1 Guest(s)