Need help for a ranking system
#1

Hi ! I'm trying to make a ranking system, to know who has the most of points for example.

Here is the actual script
Код:
new Points[MAX_PLAYERS];



public OnPlayerConnect(playerid)
{
	Points[playerid] = 0;
	new Name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, Name, sizeof(Name));
	
	new str[128];
	format(str, 128,"%s", Name);
	Points[playerid] = dini_Int("AllPoints.ini",str);
	return 1;
}

public OnPlayerDisconnect(playerid)
{
	new Name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, Name, sizeof(Name));
	new str[128];
	format(str, 128,"%s", Name);
	dini_IntSet("AllPoints.ini", str, Points[playerid]);

	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp("/getpoints", cmdtext, true) == 0)
	{
		Points[playerid] += 1000;
		SendClientMessage(playerid, 0xffffffff, "+ 1000 points");
		return 1;
	}
	if(strcmp("/points", cmdtext, true) == 0)
	{
	  new string[128];
	  format(string,128,"you have %d Points", Points[playerid]);
		SendClientMessage(playerid, 0xffffffff, string);
		return 1;
	}
	return 0;
}
now i want to add there position on the "Top List", to get a file like this :
Код:
Name,Rank,Points
Player3,1,41000
Player1,2,32000
Player2,3,9000
And not like this:
Код:
Player1=32000
Player2=9000
Player3=41000
The problem is that i have no idea about how to make that, can someone helps me ?
Reply


Messages In This Thread
Need help for a ranking system - by Alice[WS] - 11.10.2009, 22:16
Re: Need help for a ranking system - by Tigerbeast11 - 12.10.2009, 16:35
Re: Need help for a ranking system - by coole210 - 12.10.2009, 16:44
Re: Need help for a ranking system - by Tigerbeast11 - 12.10.2009, 16:46
Re: Need help for a ranking system - by Alice[WS] - 22.10.2009, 05:14
Re: Need help for a ranking system - by Alice[WS] - 25.10.2009, 17:19

Forum Jump:


Users browsing this thread: 1 Guest(s)