SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 23/12/2013, 06:37 PM   #1
Bost
Little Clucker
 
Join Date: Oct 2011
Posts: 47
Reputation: 0
Default Rank help.

I've created a new police faction and when I type /rank ID his rank dosen't show up, how can I fix it.
The faction is 25.
Here is the /rank command:
Code:
//----------------------------------[Team]-----------------------------------------------
	if(strcmp(cmd, "/badge", true) == 0 || strcmp(cmd, "/rank", true) == 0) // By CuervO_NegrO
	{
		if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /rank [playerid/PartOfName]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

			if(IsPlayerConnected(giveplayerid))
			{
				format(string, sizeof(string), "*** ------------------ %s ------------------ ***", giveplayer);
				SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
				if(PlayerInfo[giveplayerid][pMember] == 1 || PlayerInfo[giveplayerid][pLeader] == 1)
				{
				    if(PlayerInfo[giveplayerid][pRank] == 8) { format(string, sizeof(string), "* %s's SAPD Rank is Chief.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 7) { format(string, sizeof(string), "* %s's SAPD Rank is Deputy Chief.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 6) { format(string, sizeof(string), "* %s's SAPD Rank is Captain.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 5) { format(string, sizeof(string), "* %s's SAPD Rank is Lieutenant.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 4) { format(string, sizeof(string), "* %s's SAPD Rank is Sergeant.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 3) { format(string, sizeof(string), "* %s's SAPD Rank is Corporal.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 2) { format(string, sizeof(string), "* %s's SAPD Rank is Officer.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 1) { format(string, sizeof(string), "* %s's SAPD Rank is Cadet.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
				}
				else if(IsAFreecop(playerid))
				{
				    format(string, sizeof(string), "* %s's SAPD Rank is Voluntary Officer.",giveplayer);
					SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
				}
			 	if(PlayerInfo[giveplayerid][pMember] == 2 || PlayerInfo[giveplayerid][pLeader] == 2)
				{
				    if(PlayerInfo[giveplayerid][pRank] == 8) { format(string, sizeof(string), "* %s's FBI Rank is Director.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 7) { format(string, sizeof(string), "* %s's FBI Rank is Deputy Director.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 6) { format(string, sizeof(string), "* %s's FBI Rank is Assistant of Director.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 5) { format(string, sizeof(string), "* %s's FBI Rank is Divison Chief.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 4) { format(string, sizeof(string), "* %s's FBI Rank is Special Agent in Charge.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 3) { format(string, sizeof(string), "* %s's FBI Rank is Special Agent.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 2) { format(string, sizeof(string), "* %s's FBI Rank is Agent.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 1) { format(string, sizeof(string), "* %s's FBI Rank is Cadet.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
				}
		 		if(PlayerInfo[giveplayerid][pMember] == 25 || PlayerInfo[giveplayerid][pLeader] == 25)
				{
				    if(PlayerInfo[giveplayerid][pRank] == 8) { format(string, sizeof(string), "* %s's DEA Rank is Director.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 7) { format(string, sizeof(string), "* %s's DEA Rank is Deputy Director.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 6) { format(string, sizeof(string), "* %s's DEA Rank is Assistant of Director.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 5) { format(string, sizeof(string), "* %s's DEA Rank is Divison Chief.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 4) { format(string, sizeof(string), "* %s's DEA Rank is Special Agent in Charge.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 3) { format(string, sizeof(string), "* %s's DEA Rank is Special Agent.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 2) { format(string, sizeof(string), "* %s's DEA Rank is Agent.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 1) { format(string, sizeof(string), "* %s's DEA Rank is Cadet.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
				}
		 		if(PlayerInfo[giveplayerid][pMember] == 3 || PlayerInfo[giveplayerid][pLeader] == 3)
				{
				    if(PlayerInfo[giveplayerid][pRank] == 8) { format(string, sizeof(string), "* %s's Army Rank is General.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
				    else if(PlayerInfo[giveplayerid][pRank] == 7) { format(string, sizeof(string), "* %s's Army Rank is Sub General.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
				    else if(PlayerInfo[giveplayerid][pRank] == 6) { format(string, sizeof(string), "* %s's Army Rank is Captain.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 5) { format(string, sizeof(string), "* %s's Army Rank is Lieutenant.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 4) { format(string, sizeof(string), "* %s's Army Rank is Major.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 3) { format(string, sizeof(string), "* %s's Army Rank is Sergeant.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 2) { format(string, sizeof(string), "* %s's Army Rank is Soldier.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 1) { format(string, sizeof(string), "* %s's Army Rank is Private.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
				}
				if(PlayerInfo[giveplayerid][pMember] == 4 || PlayerInfo[giveplayerid][pLeader] == 4)
				{
				    if(PlayerInfo[giveplayerid][pRank] == 8) { format(string, sizeof(string), "* %s's EMS rank is Commissioner.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
				    else if(PlayerInfo[giveplayerid][pRank] == 7) { format(string, sizeof(string), "* %s's EMS Rank is Chief.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
				    else if(PlayerInfo[giveplayerid][pRank] == 6) { format(string, sizeof(string), "* %s's EMS Rank is Captain.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 5) { format(string, sizeof(string), "* %s's EMS Rank is Lieutenant.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 4) { format(string, sizeof(string), "* %s's EMS Rank is Driver.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 3) { format(string, sizeof(string), "* %s's EMS Rank is Firefighter.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 2) { format(string, sizeof(string), "* %s's EMS Rank is Probitionary.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 1) { format(string, sizeof(string), "* %s's EMS Rank is Explorer.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
				}
				if(PlayerInfo[giveplayerid][pMember] == 7 || PlayerInfo[giveplayerid][pLeader] == 7)
				{
    				if(PlayerInfo[giveplayerid][pRank] == 6) { format(string, sizeof(string), "* %s's Government Rank is President.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 5) { format(string, sizeof(string), "* %s's Government Rank is President's Assistant.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 4) { format(string, sizeof(string), "* %s's Government Rank is President's Security Chief.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 3) { format(string, sizeof(string), "* %s's Government Rank is President's Drivers Chief.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 2) { format(string, sizeof(string), "* %s's Government Rank is President's Bodyguard.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 1) { format(string, sizeof(string), "* %s's Government Rank is President's Driver.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
				}
				if(PlayerInfo[giveplayerid][pMember] == 12 || PlayerInfo[giveplayerid][pLeader] == 12)
				{
				    if(PlayerInfo[giveplayerid][pRank] == 8) { format(string, sizeof(string), "* %s's FD Rank is Chief.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
				    else if(PlayerInfo[giveplayerid][pRank] == 7) { format(string, sizeof(string), "* %s's FD Rank is Assistant Chief.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
				    else if(PlayerInfo[giveplayerid][pRank] == 6) { format(string, sizeof(string), "* %s's FD Rank is Captain.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 5) { format(string, sizeof(string), "* %s's FD Rank is Lieutenant.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 4) { format(string, sizeof(string), "* %s's FD Rank is Driver.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 3) { format(string, sizeof(string), "* %s's FD Rank is Firefighter.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 2) { format(string, sizeof(string), "* %s's FD Rank is Probitionary.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pRank] == 1) { format(string, sizeof(string), "* %s's FD Rank is Explorer.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
				}
				if(PlayerInfo[giveplayerid][pSwat] >= 1)
				{
			 		if(PlayerInfo[giveplayerid][pSwat] == 1) { format(string, sizeof(string), "* %s's S.W.A.T Rank is Operative.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pSwat] == 2) { format(string, sizeof(string), "* %s's S.W.A.T Rank is Instructor.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pSwat] == 3) { format(string, sizeof(string), "* %s's S.W.A.T Rank is Team Sub-Commander.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pSwat] == 4) { format(string, sizeof(string), "* %s's S.W.A.T Rank is Team Commander.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
				}
				if(PlayerInfo[giveplayerid][pTactical] >= 1)
				{
					if(PlayerInfo[giveplayerid][pTactical] == 1) { format(string, sizeof(string), "* %s's Tactical Team Rank is Trainee Unit.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pTactical] == 2) { format(string, sizeof(string), "* %s's Tactical Team Rank is Expert Agent.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pTactical] == 3) { format(string, sizeof(string), "* %s's Tactical Team Rank is Elite Agent.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pTactical] == 4) { format(string, sizeof(string), "* %s's Tactical Team Rank is Master Agent.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
				}
				if(PlayerInfo[giveplayerid][pSpecialF] >= 1)
				{
					if(PlayerInfo[giveplayerid][pSpecialF] == 1) { format(string, sizeof(string), "* %s's Special Forces Rank is 2º Soldier.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pSpecialF] == 2) { format(string, sizeof(string), "* %s's Special Forces Rank is Masterchief.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pSpecialF] == 3) { format(string, sizeof(string), "* %s's Special Forces Rank is Squad Sub-Leader.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
					else if(PlayerInfo[giveplayerid][pSpecialF] == 4) { format(string, sizeof(string), "* %s's Special Forces Rank is Squad Leader.",giveplayer); SendClientMessage(playerid, TEAM_GROVE_COLOR, string); }
				}
				if(OnDuty[giveplayerid] == 1)
    			{
    			    format(string, sizeof(string), "** %s Currently On Duty.", giveplayer);
				    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
				}
				if(PlayerInfo[giveplayerid][pDBanned] == 1)
				{
        			format(string, sizeof(string), "** %s Is banned From Cop duty.", giveplayer);
				    SendClientMessage(playerid, TEAM_CYAN_COLOR, string);
				}
				new y, m, d;
				new h,mi,s;
				getdate(y,m,d);
				gettime(h,mi,s);
				format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /badge",d,m,y,h,mi,s,sendername);
				CommandLog(string);
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "** Player is not connected!");
			}
		}
		return 1;
	}
__________________
Boooooooooooooooooooooooooo
Bost is offline   Reply With Quote
Old 23/12/2013, 07:08 PM   #2
Bost
Little Clucker
 
Join Date: Oct 2011
Posts: 47
Reputation: 0
Default Re: Rank help.

Anyone?
__________________
Boooooooooooooooooooooooooo
Bost is offline   Reply With Quote
Old 23/12/2013, 08:11 PM   #3
BizzyD
Gangsta
 
BizzyD's Avatar
 
Join Date: Jan 2011
Location: Home
Posts: 879
Reputation: 66
Default Re: Rank help.

Does all the other factions work?
__________________
We never fail, we only shine with brilliance. One king one faith one religion. And if you hear me come and join the revolution
BizzyD is offline   Reply With Quote
Old 24/12/2013, 05:30 AM   #4
Bost
Little Clucker
 
Join Date: Oct 2011
Posts: 47
Reputation: 0
Default Re: Rank help.

Yes.
__________________
Boooooooooooooooooooooooooo
Bost is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorial] Creating a rank system with textdraws for each rank + certain health/armour upon spawn. Strier Tutorials 10 07/03/2013 07:26 AM
[Pedido] Rank Mteck Português/Portuguese 3 20/08/2012 01:30 PM
How Do You Show "RANK UP" everytime a player reaches the rank? markjaysonpinoy Scripting Help 7 15/08/2012 01:19 PM
Rank SYstem With Rank Name in Up Head korzk7 Scripting Help 2 05/07/2012 06:08 AM


All times are GMT. The time now is 06:45 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.