AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   I can't get top15 working properly (https://forums.alliedmods.net/showthread.php?t=147758)

sibox 01-13-2011 14:11

I can't get top15 working properly
 
1 Attachment(s)
Code:
public show_top15up(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] = PlayerMoney[i];         count++;     }     new MotdChars[1024], iLen     iLen += formatex(MotdChars[iLen], (charsmax(MotdChars) ) - iLen, STYLE)     iLen += formatex(MotdChars[iLen], (charsmax(MotdChars) ) - iLen, "<body><h2>Players Info</h2> <table width=100%% border=0 align=center cellpadding=0 cellspacing=1>")     iLen += formatex(MotdChars[iLen], (charsmax(MotdChars) ) - iLen, "<body><tr><th>#<th>Name<th>Money</tr>" )     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)                 iLen += formatex(MotdChars[iLen], (charsmax(MotdChars) ) - iLen,"<tr><td> %d <td> %s <td> %d </tr>", a+1, name, sort[a][1])     }     iLen += formatex(MotdChars[iLen], (charsmax(MotdChars) ) - iLen, "</table>" )     show_motd(id, MotdChars, "Push The Button Top 15")         return PLUGIN_CONTINUE }
And i get this See Pictures

Exolent[jNr] 01-13-2011 14:49

Re: I can't get top15 working properly
 
Code:
    iLen += formatex(MotdChars[iLen], (charsmax(MotdChars) ) - iLen, "<body><h2>Players Info</h2> <table width=100%% border=0 align=center cellpadding=0 cellspacing=1>")     iLen += formatex(MotdChars[iLen], (charsmax(MotdChars) ) - iLen, "<body><tr><th>#<th>Name<th>Money</tr>" )

You have 2 body tags.
Also, the top data is never sorted.

sibox 01-13-2011 16:07

Re: I can't get top15 working properly
 
But why I'm getting so much numbers. I want only 1 name 2900 without other number that are on pictures is it bug with <tags> ?

Exolent[jNr] 01-13-2011 16:49

Re: I can't get top15 working properly
 
Did you test after changing what I pointed out?

sibox 01-15-2011 12:56

Re: I can't get top15 working properly
 
Thanks Exolent :)


All times are GMT -4. The time now is 02:12.

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