[SOLVED] Ranks problem
#1

Код:
        if(PlayerInfo[playerid][pKills] < 0) { statrank = "0"; }
		else if(PlayerInfo[playerid][pKills] < 50) { statrank = "1"; }
		else if(PlayerInfo[playerid][pKills] < 100) { statrank = "2"; }
		else if(PlayerInfo[playerid][pKills] < 150) { statrank = "3"; }
		else if(PlayerInfo[playerid][pKills] < 200) { statrank = "4"; }
		else if(PlayerInfo[playerid][pKills] < 300) { statrank = "5"; }
		else if(PlayerInfo[playerid][pKills] < 400) { statrank = "6"; }
		else if(PlayerInfo[playerid][pKills] < 500) { statrank = "7"; }
But shows i got 58 rank. Because theres only 1-7 ?
Reply
#2

Please, could you please give me the entire code, of that ranking system?
Reply
#3

Код:
if(strcmp(cmd, "/stats", true) == 0)
	{
	  ClearChatbox(playerid, 6);
	  new statdonator[20];
		if(PlayerInfo[playerid][pDonator] == 0) { statdonator = "No"; }
		else if(PlayerInfo[playerid][pDonator] == 1) { statdonator = "Yes"; }
		new statadmin[20];
		if(PlayerInfo[playerid][pAdmin] == 0) { statadmin = "No"; }
		else if(PlayerInfo[playerid][pAdmin] == 1) { statadmin = "Yes"; }
		else if(PlayerInfo[playerid][pAdmin] == 2) { statadmin = "Owner"; }
		new statrank[20];
		if(PlayerInfo[playerid][pKills] < 0) { statrank = "0"; }
		else if(PlayerInfo[playerid][pKills] < 50) { statrank = "1"; }
		else if(PlayerInfo[playerid][pKills] < 100) { statrank = "2"; }
		else if(PlayerInfo[playerid][pKills] < 150) { statrank = "3"; }
		else if(PlayerInfo[playerid][pKills] < 200) { statrank = "4"; }
		else if(PlayerInfo[playerid][pKills] < 300) { statrank = "5"; }
		else if(PlayerInfo[playerid][pKills] < 400) { statrank = "6"; }
		else if(PlayerInfo[playerid][pKills] < 500) { statrank = "7"; }
		new stattitle[20];
		if(PlayerInfo[playerid][pKills] < 0) { stattitle = "None"; }
		else if(PlayerInfo[playerid][pKills] < 50) { stattitle = "Privet"; }
		else if(PlayerInfo[playerid][pKills] < 100) { stattitle = "Sergeant"; }
		else if(PlayerInfo[playerid][pKills] < 150) { stattitle = "Major"; }
		else if(PlayerInfo[playerid][pKills] < 200) { stattitle = "Captian"; }
		else if(PlayerInfo[playerid][pKills] < 300) { stattitle = "Lieuteant nr 1"; }
		else if(PlayerInfo[playerid][pKills] < 400) { stattitle = "Lieuteant nr 2"; }
		else if(PlayerInfo[playerid][pKills] < 500) { stattitle = "General"; }
		new Cash = PlayerInfo[playerid][pCash];
		new Kills = PlayerInfo[playerid][pKills];
		new Deaths = PlayerInfo[playerid][pDeaths];
		new coordsstring[256];
	  SendClientMessage(playerid, COLOR_SAY, "_ World of War - Stats _");
	  format(coordsstring, sizeof(coordsstring),"* Money: %d, Score: %d, Rank: %d, Title: %s", Cash, Kills, statrank, stattitle);
	  SendClientMessage(playerid, COLOR_SAY, coordsstring);
	  format(coordsstring, sizeof(coordsstring),"* Kills: %d, Deaths: %d", Kills, Deaths);
	  SendClientMessage(playerid, COLOR_SAY, coordsstring);
	  format(coordsstring, sizeof(coordsstring),"* Donator: %s, Admin: %s", statdonator, statadmin);
	  SendClientMessage(playerid, COLOR_SAY, coordsstring);
	  return 1;
	}
Reply
#4

pawn Код:
format(coordsstring, sizeof(coordsstring),"* Money: %d, Score: %d, Rank: %d, Title: %s", Cash, Kills, statrank, stattitle);
Change Rank: %d to Rank: %s.

pawn Код:
format(coordsstring, sizeof(coordsstring),"* Money: %d, Score: %d, Rank: %s, Title: %s", Cash, Kills, statrank, stattitle);
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)