AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Rank Exp Mod (https://forums.alliedmods.net/showthread.php?t=155919)

Sztandi 04-28-2011 09:19

Rank Exp Mod
 
hello i want create /top10 players experience
i got code but it does not work like I wanted

Save type nVault

PHP Code:

new PlayerXP[33];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /top" "showtop10");
}
public 
showtop10(id)
{    
    static 
Sort[33][2];
    new 
players[32],num,count,index;
    
get_players(players,num);
    
    for(new 
0numi++)
    {
        
index players[i];
        
Sort[count][0] = index;
        
Sort[count][1] = PlayerXP[index];
        
count++;
    }
    
    
SortCustom2D(Sort,count,"CompareXp");
    new 
motd[1501],iLen;
    
iLen formatex(motdsizeof motd 1,"<body bgcolor=#000000><font color=#ff9e04><pre>");
    
iLen += formatex(motd[iLen], (sizeof motd 1) - iLen,"%s %-22.22s %3s^n""#""Nick""# Exp");
    
    new 
clamp(count,0,10);
    new 
name[32],kindex;
    
    for(new 
0yx++)
    {
        
kindex Sort[x][0];
        
get_user_name(kindex,name,sizeof name 1);
        
iLen += formatex(motd[iLen], (sizeof motd 1) - iLen,"%d %-22.22s %d^n"1nameSort[x][1]);
    }
    
iLen += formatex(motd[iLen], (sizeof motd 1) - iLen,"</body></font></pre>");
    
show_motd(id,motd"ExpMod Top 10");


this code shows only online players.
I want save the best Experience players like / top15

please help me :cry:
Sorry for my English

Exolent[jNr] 04-28-2011 17:15

Re: Rank Exp Mod
 
Look here:
https://forums.alliedmods.net/showthread.php?t=153125

You'll need this:
https://forums.alliedmods.net/showthread.php?t=139584


All times are GMT -4. The time now is 04:30.

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