How to create a faction?
#8

Код:
enum pInfo
{
pLeader,
pRank,
pMember
};
Thats defining the information you'll be using for the factions.

So if there a pLeader then they will be classed as a rank 6(or whatevers your highest rank in the faction).

The pRank is meaning what rank they are, so for eg: /giverank [playerid] [rank] - It will give them a new rank, like
PlayerInfo[playerid][pRank] = rank;

The pMember is basically just saying they are in a faction and which one.

Making someone a higher/lower rank;
Код:
CMD:giverank(playerid, params[])
{
    new pID, value;
    new rank = PlayerInfo[playerid][pLeader];
    if(rank < 6) return SCM(playerid, COLOR_WHITE, "You are not authorised to use that command.");
	else if (sscanf(params, "ui", pID, value)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /giverank [playerid/partofname] [rank 0-6]");
	else if (value < 0 || value > 6) return SendClientMessage(playerid, COLOR_WHITE, "Unknown rank! [0 - 6]");
	else if(pID == INVALID_PLAYER_ID) return SCM(playerid, COLOR_WHITE,"Invalid player ID.");
	else
	{
	   	new pName[MAX_PLAYER_NAME], tName[MAX_PLAYER_NAME], string[128];
	   	GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
	    GetPlayerName(pID, tName, MAX_PLAYER_NAME);
	    format(string, sizeof(string), "You have promoted %s to rank %i!", tName, value);
	    SCM(playerid, COLOR_LIGHTBLUE, string);
	    format(string, sizeof(string), "You have been promoted to rank %i!", value, pName);
	    SCM(pID, COLOR_LIGHTBLUE, string);
	    PlayerInfo[pID][pRank] = value;
    }
    return 1;
}
As I said above, your adding the playerID you chosen through sscanf and assigning it to the rank; PlayerInfo[pID][pRank] = value;

You can also changed pID to giveplayerid and add new giveplayerid at the top of the CMD.

Hope this says everything, im not exactly a good scripter so im learning it myself, so if you need anymore help PM me!
Reply


Messages In This Thread
How to create a faction? - by MrBorsh - 15.09.2012, 15:43
Re: How to create a faction? - by doreto - 15.09.2012, 15:45
Re: How to create a faction? - by Sig Hansen - 15.09.2012, 15:45
Re: How to create a faction? - by RLGaming - 15.09.2012, 15:55
Re: How to create a faction? - by Sig Hansen - 15.09.2012, 15:57
Re: How to create a faction? - by MrBorsh - 15.09.2012, 16:03
Re: How to create a faction? - by Sig Hansen - 15.09.2012, 16:05
Re: How to create a faction? - by RLGaming - 15.09.2012, 16:07
Re: How to create a faction? - by Stanford - 15.09.2012, 16:25
Re: How to create a faction? - by MrBorsh - 15.09.2012, 16:35

Forum Jump:


Users browsing this thread: 1 Guest(s)