Raised This Month: $51 Target: $400
 12% 

About top15


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Andu.
Member
Join Date: Oct 2013
Location: Belgravistan
Old 05-24-2015 , 16:24   About top15
Reply With Quote #1

Hello, i want to know how to make a new top, for example to get player kills in a nvault file and show it in a motd, but i dont know how to make a top
I tried more methods but still nothing ..

Last edited by Andu.; 05-24-2015 at 16:24.
Andu. is offline
Andu.
Member
Join Date: Oct 2013
Location: Belgravistan
Old 05-24-2015 , 16:52   Re: About top15
Reply With Quote #2

SOLVED !
Andu. is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 05-25-2015 , 06:14   Re: About top15
Reply With Quote #3

If you solved your problem, you should post the solution so others that have the same question will find the answer.
__________________
HamletEagle is offline
Andu.
Member
Join Date: Oct 2013
Location: Belgravistan
Old 05-25-2015 , 09:00   Re: About top15
Reply With Quote #4

I used this code from Alka played time
PHP Code:
public show_top15(id)  
{  
    new 
icount;  
    static 
sort[33][2], maxPlayers;  
    
    if(!
maxPlayersmaxPlayers get_maxplayers();  
    
    for(
i=1;i<=maxPlayers;i++)  
    {  
        
sort[count][0] = i;  
        
sort[count][1] = TotalPlayedTime[i] + (get_user_time(i1) / 60);  
        
count++;  
    }  
    
    
SortCustom2D(sort,count,"stats_custom_compare");  
    
    new 
motd[1024], len      
    
    len 
format(motd1023,"<body bgcolor=#000000><font color=#FFB000><pre>")  
    
len += format(motd[len], 1023-len,"%s %-22.22s %3s^n""#""Name""Time")  
    
    new 
players[32], num  
    get_players
(playersnum)  
    
    new 
clamp(count,0,15)  
    
    new 
name[32], player  
    
    
for(new 0ba++)  
    {  
        
player sort[a][0]  
        
        
get_user_name(playername31)          
        
len += format(motd[len], 1023-len,"%d %-22.22s %d^n"a+1namesort[a][1])  
    }  
    
    
len += format(motd[len], 1023-len,"</body></font></pre>")  
    
show_motd(idmotd"Played-Time Top 15")  
    
    return 
PLUGIN_CONTINUE  

public 
stats_custom_compare(elem1[],elem2[])  
{  
    if(
elem1[1] > elem2[1]) return -1;  
    else if(
elem1[1] < elem2[1]) return 1;  
        
    return 
0;  

But it show top from the players that are online, how can i get top 15 from an nvault file?

Last edited by Andu.; 05-25-2015 at 09:01.
Andu. is offline
Obada
Senior Member
Join Date: Dec 2014
Location: Abu Dhabi
Old 05-25-2015 , 11:12   Re: About top15
Reply With Quote #5

You can check Played Time Extended code.

It uses nVault_util to get top15 players from an nVault file.

Here: https://forums.alliedmods.net/showthread.php?t=201869
Obada is offline
Andu.
Member
Join Date: Oct 2013
Location: Belgravistan
Old 05-25-2015 , 11:30   Re: About top15
Reply With Quote #6

Thanks, it's hard for me to understand , but i will try it.
Andu. is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:15.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode