Some problem. [ REP ]
#1

Player rank is not showing
Код:
stock ShowStats(playerid, targetid)
{
	if(IsPlayerConnected(targetid))
	{
	    if(PlayerInfo[targetid][LoggedIn] == 1)
	    {
			new Float:ratio = (float(PlayerInfo[targetid][Kills])/float(PlayerInfo[targetid][pDeaths]));
			new yes[4] = "Yes", no[3] = "No";
            new string[350], string2[1600], count, ranks[90], pRank[128], RegDate[256], h, m, file[256],descp[100];
            format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(PlayerName2(targetid)));
			pRank[targetid] = GetPlayerScore(targetid);
			RegDate = dini_Get(file,"RegisteredDate");
	        TotalGameTime(targetid, h, m);
			strcat(string2, "{C0C0C0}Player's Statistics.\n\n");
	        strcat(string2, "{FF0000}General Statistics\n");
			switch(PlayerInfo[targetid][Level])
			{
			    case 0: ranks = "Regular";
			    case 1: ranks = "Trial Moderator";
			    case 2: ranks = "Moderator";
			    case 3: ranks = "Administrator";
			    case 4: ranks = "Senior Administrator";
			    case 5: ranks = "Head Administrator";
				case 6: ranks = "Manager/CEO";
			}
			switch(pRank[targetid])
			{
			    case 0: if(GetPlayerScore(targetid) >= 0 && GetPlayerScore(targetid) < 100)
				{
					pRank = "Noobie";
				}
			    case 1: if(GetPlayerScore(targetid) >= 100 && GetPlayerScore(targetid) < 250)
				{
			 		pRank = "Hobo";
				}
			    case 2: if(GetPlayerScore(targetid) >= 250 && GetPlayerScore(targetid) < 500)
				{
					pRank = "Madman";
				}
			    case 3: if(GetPlayerScore(targetid) >= 500 && GetPlayerScore(targetid) < 1000)
			    {
					pRank = "Thug";
				}
			    case 4: if(GetPlayerScore(targetid) >= 1000 && GetPlayerScore(targetid) < 2500)
				{
					pRank = "Theif";
				}
			    case 5: if(GetPlayerScore(targetid) >= 2500 && GetPlayerScore(targetid) < 5000)
	    		{
					pRank = "Killer";
				}
			    case 6: if(GetPlayerScore(targetid) >= 5000 && GetPlayerScore(targetid) < 10000)
			    {
					pRank = "Psycho";
				}
			    case 7: if(GetPlayerScore(targetid) >= 10000 && GetPlayerScore(targetid) < 25000)
			    {
					pRank = "Hitman";
				}
			    case 8: if(GetPlayerScore(targetid) >= 25000 && GetPlayerScore(targetid) < 50000)
			    {
					pRank = "Shooter";
				}
			    case 9: if(GetPlayerScore(targetid) >= 50000 && GetPlayerScore(targetid) < 100000)
			    {
					pRank = "The Terror Maker";
				}
				case 10: if(GetPlayerScore(targetid) >= 100000 && GetPlayerScore(targetid) < 9999999)
				{
					pRank = "King";
				}
		   }

			if(PlayerInfo[targetid][pVip] == 1)
	        {
	            count++;
	            strcat(string, "V.I.P: ");
            }
			if(PlayerInfo[targetid][isDJ] == 1)
	        {
	            count++;
	            strcat(string, "DJ Status: ");
            }
			if(PlayerInfo[targetid][Jailed] == 1)
	        {
	            count++;
	            strcat(string, "Jailed: ");
            }
			format(string, sizeof(string), "{FFFFFF}Name: %s{FFFFFF}\n", pName(targetid));
	        strcat(string2, string);
	        format(string, sizeof(string), "Rank: %s\n", ranks);
	        strcat(string2, string);
		    format(string, sizeof(string), "V.I.P: %s\n", PlayerInfo[targetid][pVip] ? yes : no);
	        strcat(string2, string);
			format(string, sizeof(string), "{FFFFFF}Member Since: %s{FFFFFF}\n", RegDate[targetid]);
	        strcat(string2, string);
			format(string, sizeof(string), "Total Online Time: %02d hours and %02d minutes\n", h,m);
	        strcat(string2, string);
			format(string, sizeof(string), "Score: %d\n", GetPlayerScore(targetid));
	        strcat(string2, string);
	        format(string, sizeof(string), "Cash: {00FF00}${FFFFFF}%d\n", GetPlayerMoneyEx(targetid));
	        strcat(string2, string);
	        format(string, sizeof(string), "Cookies: %d\n", PlayerInfo[targetid][pCookies]);
	        strcat(string2, string);
	        format(string, sizeof(string), "Brownies: %d\n", PlayerInfo[targetid][pBrownies]);
	        strcat(string2, string);
		    format(string, sizeof(string), "DJ Status: %s\n\n", PlayerInfo[targetid][isDJ] ? yes : no);
	        strcat(string2, string);
	        strcat(string2, "{FF0000}Other Statistics\n");
			format(string, sizeof(string), "{FFFFFF}ID: %d{FFFFFF}\n", targetid);
	        strcat(string2, string);
	        format(string, sizeof(string), "Current Online Time: %d hours and %d minutes\n", PlayerInfo[targetid][Hours], PlayerInfo[targetid][Minutes]);
	        strcat(string2, string);
			format(string, sizeof(string), "Player Rank: %s\n", pRank[targetid]);
	        strcat(string2, string);
			format(string, sizeof(string), "Mathematics Won: %d\n", PlayerInfo[targetid][Mathematics]);
	        strcat(string2, string);
			format(string, sizeof(string), "Reactions Won: %d\n", PlayerInfo[targetid][Reactions]);
	        strcat(string2, string);
			format(string, sizeof(string), "CheckPoints: %d\n", PlayerInfo[targetid][CheckPoints]);
	        strcat(string2, string);
			format(string, sizeof(string), "Money Bags Found: %d\n", PlayerInfo[targetid][MoneyBags]);
	        strcat(string2, string);
	        format(string, sizeof(string), "Cookies Jars Found: %d\n", PlayerInfo[targetid][CookieJars]);
	        strcat(string2, string);
			format(string, sizeof(string), "Horseshoes Found: %d/30\n", PlayerInfo[targetid][HS]);
	        strcat(string2, string);
			format(string, sizeof(string), "Kills: %d\n", PlayerInfo[targetid][Kills]);
	        strcat(string2, string);
	        format(string, sizeof(string), "Deaths: %d\n\n", PlayerInfo[targetid][pDeaths]);
	        strcat(string2, string);
	        strcat(string2, "{FF0000}More Statistics\n");
			format(string, sizeof(string), "{FFFFFF}Skin ID: %d{FFFFFF}\n", GetPlayerSkin(targetid));
            strcat(string2, string);
			format(string, sizeof(string), "Jailed: %s\n", PlayerInfo[targetid][Jailed] ? yes : no);
	        strcat(string2, string);
			format(string, sizeof(string), "Warnings: %d\n", PlayerInfo[targetid][Warnings]);
	        strcat(string2, string);
			format(string, sizeof(string), "Ratio (K/D): %.3f\n", ratio);
	        strcat(string2, string);
			format(descp, sizeof(descp), "%s", PlayerInfo[targetid][accDescp]);
			strcat(string2, "\nSelf Description:\n");

			format(string, sizeof string, "{%06x}%s", GetPlayerColor(targetid) >>> 8, pName(targetid));
			ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, string, string2, "Close", "");
		}
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)