making top10
#1

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

I don't know much but it will contain your register system's things
Reply
#3

What? don't want do mysql i want in pawn
Reply
#4



It will be in pawno with the stats of players in database (I think so)
Reply
#5

No you don't understand i only use online players with variables nothing load stats
Reply
#6

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

Use quickSort: https://sampforum.blast.hk/showthread.php?pid=1792412#pid1792412
Reply
#8

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 ?
Reply
#9

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
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)