Rank help.
#1

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:
Код:
//----------------------------------[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;
	}
Reply
#2

Anyone?
Reply
#3

Does all the other factions work?
Reply
#4

Yes.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)