Faction ID's
#1

I have faction numbers 1 to 7 but how can I make the command /makeleader [playerid / name] [factionid]

I've tried multiple things but it wouldn't work.
Reply
#2

You must have two variables, one to store the players faction and another one to store the player rank into that faction, for example, if you have PlayerInfo[playerid][pMember] to store the faction and PlayerInfo[playerid][pRank] to store the rank in the faction, just make a command that stores the given factionid in the first array and the maximum allowed rank in the second array.
Reply
#3

Yes I can store them but how do I get the factionid the admin typed and when its 2 for example, so I can
pawn Код:
PlayerInfo[playerid][pTeam] = 2;
PlayerInfo[playerid][pLeader] = 2;
PlayerInfo[playerid][pRank] = 6;
Reply
#4

Suposing that you use zcmd and sscanf2, this could be the code for that command:
pawn Код:
CMD:makeleader(playerid, params[])
{
    new player, faction;
    if(sscanf(params, "ud", player, faction)) return SendClientMessage(playerid, Blanco, "USAGE: /makeleader [playerid / name] [factionid]");
    if(player!= INVALID_PLAYER_ID)
    {
        if((PlayerInfo[playerid][pLeader] != faction) SendClientMessage(playerid, Rojo, "* You are not the leader of that faction.");
        else
        {
            PlayerInfo[player][pTeam] = faction;
            PlayerInfo[player][pLeader] = faction;
            PlayerInfo[player][pRank] = 6;
        }
    }
    else SendClientMessage(playerid, Rojo, "* The player is not online.");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)