Veteran Member
|
10-20-2010
, 16:41
Re: [ES] Colocar columnas HTML en el /top15 (Solucionado)
|
#18
|
Quote:
Originally Posted by Asdito´^
Por que me anda esto
PHP Code:
#include <amxmodx>
public plugin_init()
{
register_plugin( "Test", "1.0", "G_often" )
register_clcmd( "say /top15", "CmdTestTop15" )
}
public CmdTestTop15( id )
{
static Name[33], iMotd[1501], iLen;
get_user_name( id, Name, 32 )
iLen = format(iMotd, sizeof iMotd - 1,"<body bgcolor=#ff0000><font color=#2efe9a><pre>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<center><h2> Top 15 </h2></center>^n^n");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<table border=1>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<tr>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<th>#</th>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<th>Nick</th>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<th>Kills</th>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<th>Hits</th>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<th>Shots</th>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<th>HS</th>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<th>Eff.</th>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<th>Acc.</th>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"</tr>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<tr>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%9i</td>",1 )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%-22.22s</td>",Name )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%8i</td>",10 )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%7i</td>", 5 )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%6i</td>", 131 )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%5i</td>",3 )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%4i</td>",130)
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%3i%%</td>", 7 )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"</tr>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"</table>");
show_motd( id, iMotd, "Top15");
return PLUGIN_HANDLED;
}
y no esto?
PHP Code:
#include <amxmodx>
public plugin_init()
{
register_plugin( "Test", "1.0", "G_often" )
register_clcmd( "say /top15", "CmdTestTop15" )
}
public CmdTestTop15( id )
{
static Name[33], iMotd[1501], iLen;
get_user_name( id, Name, 32 )
iLen = format(iMotd, sizeof iMotd - 1,"<body bgcolor=#ff0000><font color=#2efe9a><pre>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<center><h2> Top 15 </h2></center>^n^n");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<table border=1>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<tr>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<th>#</th>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<th>Nick</th>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<th>Kills</th>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<th>Hits</th>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<th>Shots</th>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<th>HS</th>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<th>Eff.</th>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<th>Acc.</th>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"</tr>");
for(new i = 0; i >= 2; i++) {
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<tr>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%9i</td>",1 )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%-22.22s</td>",Name )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%8i</td>",10 )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%7i</td>", 5 )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%6i</td>", 131 )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%5i</td>",3 )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%4i</td>",130)
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%3i%%</td>", 7 )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"</tr>");
}
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"</table>");
show_motd( id, iMotd, "Top15");
return PLUGIN_HANDLED;
}
(con el for)
|
de las 2 maneras anda
fijate aca no hago for y es igual al tuyo con for.
PHP Code:
#include <amxmodx>
public plugin_init()
{
register_plugin( "Test", "1.0", "G_often" )
register_clcmd( "say /top15", "CmdTestTop15" )
}
public CmdTestTop15( id )
{
static Name[33], iMotd[1501], iLen;
get_user_name( id, Name, 32 )
iLen = format(iMotd, sizeof iMotd - 1,"<body bgcolor=#ff0000><font color=#2efe9a><pre>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<center><h2> Top 15 </h2></center>^n^n");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<table border=1>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<tr>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<th>#</th>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<th>Nick</th>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<th>Kills</th>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<th>Hits</th>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<th>Shots</th>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<th>HS</th>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<th>Eff.</th>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<th>Acc.</th>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"</tr>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<tr>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%9i</td>",1 )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%-22.22s</td>",Name )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%8i</td>",10 )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%7i</td>", 5 )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%6i</td>", 131 )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%5i</td>",3 )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%4i</td>",130)
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%3i%%</td>", 7 )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"</tr>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<tr>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%9i</td>",1 )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%-22.22s</td>",Name )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%8i</td>",10 )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%7i</td>", 5 )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%6i</td>", 131 )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%5i</td>",3 )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%4i</td>",130)
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"<td>%3i%%</td>", 7 )
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"</tr>");
iLen += format(iMotd[iLen], (sizeof iMotd - 1) - iLen,"</table>");
show_motd( id, iMotd, "Top15");
return PLUGIN_HANDLED;
}
|
|