AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Motd Code Help! (https://forums.alliedmods.net/showthread.php?t=184045)

StepZeN 04-30-2012 08:16

Motd Code Help!
 
Hello There!

I am transcodes on a played time with top15 and i don't get the motd code to work.

this is the code i need help with:
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 
html_motd 2500 ], len
       
        len 
formatex html_motd len ], charsmax html_motd ) - len"<STYLE>body{background:#808080;color:#000000;font-family:sand-serif}table{width:100%%;font-size:16px}</STYLE><table cellpadding=2 cellspacing=0 border=0>" );
        
len += formatex html_motd len ], charsmax html_motd ) - len"<center><img src=^"http://i44.tinypic.com/w97052.png^"></center></img>");
        
len += formatex html_motd len ], charsmax html_motd ) - len"<tr align=center bgcolor=%52697B><th width=8%% align=left><font color=white> <th width=8%% align=left><font color=white>Name: <th width=8%% align=left><font color=white>Total 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 += formatex(html_motd len ], charsmax(html_motd)-len"<tr><td>%i.</td><td>%s</td><td>%i</td></tr>"a+1namesort[a][1])
                }
        }
       
        
len += formatex(html_motd len ], charsmax(html_motd)-len"</table></body></html>")
        {
        
show_motd(idhtml_motd"Played Time Top15")
      }
        return 
PLUGIN_HANDLED;


and this is the original code:

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


Somebody out there to help me?:),

////Sorry My Bad English////

Napoleon_be 04-30-2012 20:09

Re: Motd Code Help!
 
What should the .txt file be called? make sure it has the same name as in your code.

StepZeN 04-30-2012 21:01

Re: Motd Code Help!
 
hmm,i will look tomorrow i am on my phone right now:)

StepZeN 05-01-2012 05:47

Re: Motd Code Help!
 
Quote:

Originally Posted by Napoleon_be (Post 1699629)
What should the .txt file be called? make sure it has the same name as in your code.

hmm what "txt"?,this is not a txt motd^^


All times are GMT -4. The time now is 07:48.

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