Ranks and Tiers
#1

Alright.
When i do /makeleader , the leader gets invited into the faction and he will get tier 2 (highest), on stats it says: Faction rank: [] Faction tier: [2]
when he does /setrank he can edit his rank name, for example Hi
After that this happens:
Faction rank: [Hi] Faction tier: [ ]

Both of the CMD's:
(settier and setrank)

Код:
CMD:settier(playerid, params[])
{
	new playerb, tier, string[128];
	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(!PlayerInfo[playerid][pFacLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not a faction leader.");
	if(sscanf(params, "ui", playerb, tier)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /settier [playerid] [tier]");
	if(playerid == playerb) return SendClientMessage(playerid, COLOR_GREY, "You can't change your tier.");
	if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
	if(PlayerInfo[playerb][pFac] != PlayerInfo[playerid][pFac]) return SendClientMessage(playerid, COLOR_GREY, "Player is not in your faction.");
	if(tier < 0 || tier > 2) return SendClientMessage(playerid, COLOR_GREY, "Tiers are between 0 and 2.");
	if(PlayerInfo[playerb][pFacTier] == tier) return SendClientMessage(playerid, COLOR_GREY, "Player already has that tier.");
	if(PlayerInfo[playerb][pFacTier] < tier)
	{
	    PlayerInfo[playerb][pFacTier] = tier;
		format(string, sizeof(string), "You have {33AA33}promoted {33CCFF}%s to tier:{33AA33}%s (%d){33CCFF}.", RPN(playerb), RPFACTIER(playerb), tier);
		SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
		format(string, sizeof(string), "%s has {33AA33}promoted {33CCFF}you to tier:{33AA33}%s (%d){33CCFF}.", RPN(playerid), RPFACTIER(playerb), tier);
		SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
	}
	else if(PlayerInfo[playerb][pFacTier] > tier)
	{
	    PlayerInfo[playerb][pFacTier] = tier;
		format(string, sizeof(string), "You have {FF9900}demoted {33CCFF}%s to tier:{FF9900}%s (%d){33CCFF}.", RPN(playerb), RPFACTIER(playerb), tier);
		SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
		format(string, sizeof(string), "%s has {FF9900}demoted {33CCFF}you to tier:{FF9900}%s (%d){33CCFF}.", RPN(playerid), RPFACTIER(playerb), tier);
		SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
	}
	return 1;
}

CMD:setrank(playerid, params[])
{
	new name[32], playerb, string[128];
	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(!PlayerInfo[playerid][pFacLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not a faction leader.");
	if(sscanf(params, "is[32]", playerb, name)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /adjustrankname [player] [name]");

    {
        format(PlayerInfo[playerb][pFRank], 32,"%s", params);
        format(string, sizeof(string), "You have editted the rankname to %s", name);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	}

	return 1;
}
Reply


Messages In This Thread
Ranks and Tiers - by ThaCrypte - 20.04.2013, 10:29
Re: Ranks and Tiers - by denNorske - 20.04.2013, 10:34
Re: Ranks and Tiers - by ThaCrypte - 20.04.2013, 10:39
Re: Ranks and Tiers - by denNorske - 20.04.2013, 10:46
Re: Ranks and Tiers - by zxc1 - 20.04.2013, 11:19
Re: Ranks and Tiers - by ThaCrypte - 20.04.2013, 17:17
Re: Ranks and Tiers - by ThaCrypte - 21.04.2013, 16:04
Re: Ranks and Tiers - by ThaCrypte - 22.04.2013, 18:15
Re: Ranks and Tiers - by ThaCrypte - 23.04.2013, 06:02

Forum Jump:


Users browsing this thread: 3 Guest(s)