11.10.2009, 22:16
Hi ! I'm trying to make a ranking system, to know who has the most of points for example.
Here is the actual script
now i want to add there position on the "Top List", to get a file like this :
And not like this:
The problem is that i have no idea about how to make that, can someone helps me ?
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; }
Код:
Name,Rank,Points Player3,1,41000 Player1,2,32000 Player2,3,9000
Код:
Player1=32000 Player2=9000 Player3=41000