making top10 - 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)
+--- Thread: making top10 (
/showthread.php?tid=616728)
making top10 -
MerryDeer - 09.09.2016
Hi,
What easiest and shortest way making top10 by money, score? maybe using sorting functions? but i want to write money, score or whatever and top player name. But also if i want to make any top, top20, top100 how it look. I know with mysql it's easy but how do with pawn
Re: making top10 -
Gotham - 09.09.2016
I don't know much but it will contain your register system's things
Re: making top10 -
MerryDeer - 09.09.2016
What? don't want do mysql i want in pawn
Re: making top10 -
Gotham - 09.09.2016
It will be in pawno with the stats of players in database (I think so)
Re: making top10 -
MerryDeer - 09.09.2016
No you don't understand

i only use online players with variables nothing load stats
Re: making top10 -
Dignity - 09.09.2016
Quote:
Originally Posted by Gotham
It will be in pawno with the stats of players in database (I think so)
|
If you don't have anything useful to reply, why reply at all? You're literally contributing nothing.
Quote:
Originally Posted by MerryDeer
No you don't understand  i only use online players with variables nothing load stats
|
In that case, try something like this:
http://forum.sa-mp.com/showpost.php?...10&postcount=6
Re: making top10 -
SickAttack - 09.09.2016
Use quickSort:
https://sampforum.blast.hk/showthread.php?pid=1792412#pid1792412
Re: making top10 -
MerryDeer - 09.09.2016
for(new t = top; t >= 0; t--)
{
top using getplayerscore? what if score 1million? it do cikle million times? and then max_players 1000000*MAX_PLAYERS ?
Re: making top10 -
MerryDeer - 09.09.2016
Quote:
Originally Posted by SickAttack
|
Код:
stock OrdenarLista(list[],out_pos[],size=sizeof(list), bool:desc=false) {
if(size <= 1) return 0;
QuickSort(list,out_pos,0,size-1,desc);
return 1;
}
stock QuickSort(v[],index[],b,t,desc)
{
new
pivote,
t_var,
vp,i;
if(b<t) {
pivote=b;
vp=v[pivote];
for(i=b+1; i<=t; i++){
if(desc?(v[i]>vp):(v[i]<vp)) {
pivote++;
t_var=v[i];
v[i]=v[pivote];
v[pivote]=t_var;
t_var=index[i];
index[i]=index[pivote];
index[pivote]=t_var;
}
}
t_var=v[b];
v[b]=v[pivote];
v[pivote]=t_var;
t_var = index[b];
index[b] = index[pivote];
index[pivote] = t_var;
QuickSort(v, index,b, pivote-1,desc);
QuickSort(v, index,pivote+1, t,desc);
}
}
out_pos what it mean
Please show example with this function
Re: making top10 -
SickAttack - 09.09.2016
Quote:
Originally Posted by MerryDeer
Код:
stock OrdenarLista(list[],out_pos[],size=sizeof(list), bool:desc=false) {
if(size <= 1) return 0;
QuickSort(list,out_pos,0,size-1,desc);
return 1;
}
stock QuickSort(v[],index[],b,t,desc)
{
new
pivote,
t_var,
vp,i;
if(b<t) {
pivote=b;
vp=v[pivote];
for(i=b+1; i<=t; i++){
if(desc?(v[i]>vp):(v[i]<vp)) {
pivote++;
t_var=v[i];
v[i]=v[pivote];
v[pivote]=t_var;
t_var=index[i];
index[i]=index[pivote];
index[pivote]=t_var;
}
}
t_var=v[b];
v[b]=v[pivote];
v[pivote]=t_var;
t_var = index[b];
index[b] = index[pivote];
index[pivote] = t_var;
QuickSort(v, index,b, pivote-1,desc);
QuickSort(v, index,pivote+1, t,desc);
}
}
out_pos what it mean
Please show example with this function
|
http://forum.sa-mp.com/showpost.php?...postcount=1737