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 i, count; static sort[33][2], maxPlayers; if(!maxPlayers) maxPlayers = get_maxplayers(); for(i=1;i<=maxPlayers;i++) { sort[count][0] = i; sort[count][1] = TotalPlayedTime[i] + (get_user_time(i, 1) / 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(players, num) new b = clamp(count,0,15) new name[32], player for(new a = 0; a < b; a++) { player = sort[a][0] get_user_name(player, name, 31) len += formatex(html_motd [ len ], charsmax(html_motd)-len, "<tr><td>%i.</td><td>%s</td><td>%i</td></tr>", a+1, name, sort[a][1]) } } len += formatex(html_motd [ len ], charsmax(html_motd)-len, "</table></body></html>") { show_motd(id, html_motd, "Played Time Top15") } return PLUGIN_HANDLED; }
and this is the original code:
PHP Code:
public show_top15(id) { new i, count; static sort[33][2], maxPlayers; if(!maxPlayers) maxPlayers = get_maxplayers(); for(i=1;i<=maxPlayers;i++) { sort[count][0] = i; sort[count][1] = TotalPlayedTime[i] + (get_user_time(i, 1) / 60); count++; } SortCustom2D(sort,count,"stats_custom_compare"); new motd[1024], len len = format(motd, 1023,"<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(players, num) new b = clamp(count,0,15) new name[32], player for(new a = 0; a < b; a++) { player = sort[a][0] get_user_name(player, name, 31) len += format(motd[len], 1023-len,"%d %-22.22s %d^n", a+1, name, sort[a][1]) } len += format(motd[len], 1023-len,"</body></font></pre>") show_motd(id, motd, "Played-Time Top 15") return PLUGIN_CONTINUE }
Somebody out there to help me?:),
////Sorry My Bad English////
|