Need help for a ranking system - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need help for a ranking system (
/showthread.php?tid=101760)
Need help for a ranking system -
Alice[WS] - 11.10.2009
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 ?
Re: Need help for a ranking system -
Tigerbeast11 - 12.10.2009
I need help with this too, plz can someone reply!!!!
Re: Need help for a ranking system -
coole210 - 12.10.2009
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..
Re: Need help for a ranking system -
Tigerbeast11 - 12.10.2009
It sounds complicated, how can i do this?
Re: Need help for a ranking system -
Alice[WS] - 22.10.2009
Any idea ?
Re: Need help for a ranking system -
Alice[WS] - 25.10.2009
.