Need help with ranks!
#1

I need help!
I want to have like a Power system and Rank system for factions. (depending on your power you will have acces to commands)
I want leaders to be able to do: /Adjustrank (player's ID) (Text for rank)
Then it will save in the user's his .INI, and can be used for like /factionchat and /radio and stuff like that.

I am wondering how i can do this? I've been trying for ages and i cant figure it out how to?
Please help! Once i know how to make that i am also able to make a power system myself, i just need to know this.
Currently my /adjustrank cmd =
Код:
CMD:adjustrankname(playerid, params[])
{
	new rank, name[32], 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]", rank, name)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /adjustrankname [rank] [name]");
	switch(rank)
	{
	   case 0:
     {
	        format(FacInfo[PlayerInfo[playerid][pFac]][fRank0], 32, "%s", name);
	        format(string, sizeof(string), "You have set rank 0's name to %s", name);
	        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
     }
	    case 1:
	    {
	        format(FacInfo[PlayerInfo[playerid][pFac]][fRank1], 32, "%s", name);
	        format(string, sizeof(string), "You have set rank 1's name to %s", name);
	        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	    }
	    case 2:
	    {
	        format(FacInfo[PlayerInfo[playerid][pFac]][fRank2], 32, "%s", name);
	        format(string, sizeof(string), "You have set rank 2's name to %s", name);
	        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	    }
	    case 3:
	    {
	        format(FacInfo[PlayerInfo[playerid][pFac]][fRank3], 32, "%s", name);
	        format(string, sizeof(string), "You have set rank 3's name to %s", name);
	        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	    }
	    case 4:
	    {
	        format(FacInfo[PlayerInfo[playerid][pFac]][fRank4], 32, "%s", name);
	        format(string, sizeof(string), "You have set rank 4's name to %s", name);
	        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	    }
	    case 5:
	    {
	        format(FacInfo[PlayerInfo[playerid][pFac]][fRank5], 32, "%s", name);
	        format(string, sizeof(string), "You have set rank 5's name to %s", name);
	        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	    }
	    case 6:
	    {
	        format(FacInfo[PlayerInfo[playerid][pFac]][fRank6], 32, "%s", name);
	        format(string, sizeof(string), "You have set rank 6's name to %s", name);
	        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	    }
	}
	return 1;
}
I've been trying this:
Код:
CMD:adjustrankname(playerid, params[])
{
	new rank, name[32], 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]", rank, name)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /adjustrankname [rank] [name]");
	switch(rank)
	 {
	        format(PlayerInfo[Playerid[pFac]][pFacRank], 32, "%s", name);
	        format(string, sizeof(string), "You have editted the rankname to %s", name);
	        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

	 }
	return 1;
}
Reply


Messages In This Thread
Need help with ranks! - by ThaCrypte - 19.04.2013, 10:19
Re: Need help with ranks! - by ThaCrypte - 19.04.2013, 10:25
Re: Need help with ranks! - by Syntax - 19.04.2013, 13:17
Re: Need help with ranks! - by ThaCrypte - 19.04.2013, 13:30
Re: Need help with ranks! - by PaulDinam - 19.04.2013, 13:45
Re: Need help with ranks! - by ThaCrypte - 19.04.2013, 14:10
Re: Need help with ranks! - by ThaCrypte - 19.04.2013, 15:10
Re: Need help with ranks! - by BigGroter - 19.04.2013, 15:17
Re: Need help with ranks! - by Chris_Morrison - 19.04.2013, 16:17
Re: Need help with ranks! - by ThaCrypte - 19.04.2013, 17:57

Forum Jump:


Users browsing this thread: 2 Guest(s)