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
#2

I need help with this too, plz can someone reply!!!!
Reply
#3

Make a limit, if a person gets over the limit, set the limit to what he has and then if someon beats that limit changes to that etc..
Reply
#4

It sounds complicated, how can i do this?
Reply
#5

Any idea ?
Reply
#6

.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)