The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Top 3
Author Message
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #2
RE: Top 3
PHP Code:
[function allplayers]
for 
i 0 <eval <serv.accounts>-1>
    for 
x 0 <eval <serv.account.<local.i>.chars> - 1>
        
ref1=<serv.account.<local.i>.char.<local.x>>
        if (<
ref1>)
            
ref1.<args>
        endif    
    endfor
endfor    

[function 
top3_pk]
allplayers m_top3_pk
for 1 3
    ref1
=<var.kills_<dlocal._for>_uid>
    
serv.log <dlocal._for>. <ref1.name> <ref1.kills>
    var.
kills_<dlocal._for>_uid=
    var.
kills_<dlocal._for>=
endfor



[function 
m_top3_pk]
for 
1 3
    
if (<kills> >= <var.kills_<dlocal._for>>)
        var.
kills_<dlocal._for>=<kills
        var.
kills_<dlocal._for>_uid=<uid>
        return 
1
    
endif
endfor 

not tested, also its not a fastest one. for best performance you can store kills of all players in mysql. you can't call that function from players, for example you can't use this method for top 10 gumps because it will create lag on your server. maybe you can run this function in every world save etc.
(This post was last modified: 07-13-2012 02:03 AM by Shaklaban.)
07-13-2012 02:02 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Top 3 - Alias - 07-12-2012, 10:21 PM
RE: Top 3 - Shaklaban - 07-13-2012 02:02 AM
RE: Top 3 - Alias - 07-13-2012, 02:52 AM
RE: Top 3 - Shaklaban - 07-13-2012, 03:30 AM
RE: Top 3 - Alias - 07-13-2012, 04:15 AM
RE: Top 3 - Alias - 07-13-2012, 10:34 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)