LSPD Rank System
#1

Ok, so here's my problem, i've tried adding more ranks to the LSPD. Did it the way i was supposed to (the way the other ranks were listed). And it still says Chief rank is Officer first class. Here's all the scripting from it. First ones the correct scripting that i used as a reference, the second one, and everything after is what i did.

Code i used as a reference
Код:
case 2: // fbi
			{
				switch(PlayerInfo[playerid][pRank])
				{
					case 6: string = "Director";
					case 5: string = "Assistant Director";
					case 4: string = "Veteran Agent";
					case 3: string = "Special Agent in Charge";
					case 2: string = "Special Agent";
					case 1: string = "Special Agent Trainee";
					default: string = "Intern";
And the rest down is my apparent mess up

Код:
case 1: // police
			{
				switch(PlayerInfo[playerid][pRank])
				{
				    case 10: string = "Chief";
				    case 9: string = "Deputy Chief";
				    case 8: string = "Captain";
				    case 7: string = "SWAT Captain";
					case 6: string = "SWAT Seargent";
					case 5: string = "SWAT Officer";
					case 4: string = "Seargent";
					case 3: string = "Detective";
					case 2: string = "Officer 3rd Class";
					case 1: string = "Officer 2nd Class";
					default: string = "Officer 1st Class";
Now the /makeleader scripting

else if(faction == 1) { PlayerInfo[para1][pModel] = 265; PlayerInfo[para1][pRank] = 11; ftext = "Police Force"; }


i made a second /giverank command, so the actual /giverank one won't interfere with the new lspd ranks

Код:
if(strcmp(cmd, "/lspdrank", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /giverank [playerid/PartOfName] [Number(1-10)]");
				return 1;
			}
			new para1;
			new level;
			para1 = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			level = strvalEx(tmp);
			if(level >= 10 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "   Dont go below number 0, or above number 6!"); return 1; }
			if(PlayerInfo[playerid][pLeader] >= 11)
			{
			    if(IsPlayerConnected(para1))
			    {
			        if(para1 != INVALID_PLAYER_ID)
			        {
			            if(PlayerInfo[para1][pMember] == PlayerInfo[playerid][pLeader])
			            {
			                GetPlayerName(para1, giveplayer, sizeof(giveplayer));
							GetPlayerName(playerid, sendername, sizeof(sendername));
							PlayerInfo[para1][pRank] = level;
							format(string, sizeof(string), "* You have been promoted to a higher Rank by Leader %s.", sendername);
							SendClientMessage(para1, COLOR_LIGHTBLUE, string);
							format(string, sizeof(string), "* You have given %s Rank %d.", giveplayer,level);
							SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
			            }
			            else
			            {
							SendClientMessage(playerid, COLOR_GREY, "   That player is not a member of your Faction / Family !");
			            	return 1;
			            }
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   You are not authorized to use that command (Leaders Only) !");
			}
		}
		return 1;
	}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)