Mensajes: 200
Temas: 56
Registro en: Oct 2020
Reputación:
1
24/01/2021, 12:47 AM
(Última modificación: 26/01/2021, 12:14 AM por Meliodas. Edited 1 time in total.)
como puedo crear el top 20 y top 30 usando el tut con adv_vault
http://amxmodx-es.com/Thread-TUT-Crear-r...-Adv-Vault
lo que quiero hacer es que si colocan top 10 solo salga los 10 mejores si coloco top 20 salgan del 11 hasta el 20 y asi con el top 30
Pawn Básico no critiquen xD
Mensajes: 138
Temas: 39
Registro en: Jul 2020
Reputación:
1
(13/05/2017, 02:11 PM)DiCHANHO escribió: off: pobre este ya quedo traumado con lo del autor y robo de plugins (26/07/2020, 08:32 PM)Hinami escribió: & si soy un gordo cagon, virgen, con posters de anime en todas partes ✅✅Aportes✅✅
✅ Datear Automáticamente CincoYA
✅ Efecto Trueno y Rayo
Mensajes: 200
Temas: 56
Registro en: Oct 2020
Reputación:
1
Pawn Básico no critiquen xD
Mensajes: 3,077
Temas: 33
Registro en: May 2017
Reputación:
34
(25/01/2021, 06:16 PM)Meliodas escribió:
Tiene lo que pedís, si no te sirve específica mejor.
Mensajes: 200
Temas: 56
Registro en: Oct 2020
Reputación:
1
(25/01/2021, 07:45 PM)Chema escribió: Tiene lo que pedís, si no te sirve específica mejor.
yo lo quiero es un ejemplo de como sacar el top20/30 pero con el guardado adv_vault
sacar top 20 y el top 30
Código PHP: public DisplayTop( index ) { new szMotd[ 1520 ]; static iLen; iLen = 0;
new keyindex, pj[ MAX_NAME_LENGTH ], count = 0;
new iData[ sizeof( g_PlayerData[ ] ) ], szAvatar[ 199 ];
new toploop = min( adv_vault_sort_numresult(g_vault, g_sort), 5 );
iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<body><style>body{color:white;background:url(^"%s^");\ font-family:Arial,sans-serif;\ background-position: center center}\ table{border:10px;width:87%%;margin-top:10%%;background:#121212}\ td{font-size:13px;background:#272727}\ th{color:black;font-size:14px;background:#F4DA06;padding:1%%}\ </style>\ <table align=center>\ <tr align=center>\ <th width=10%%>#\ <th width=3%% height=5%%>Logo\ <th width=30%%>Nombre\ <th width=25%%>Frags\ <th width=15%%>Muertes", gz_bgCsTop );
for( new position = 1; position <= toploop; position++ ) { keyindex = adv_vault_sort_position( g_vault, g_sort, position )
if( !adv_vault_get_prepare( g_vault, keyindex ) ) continue;
static i; for( i = 0; i <sizeof( g_PlayerData[ ] ); i++ ) { iData[ i ] = adv_vault_get_field( g_vault, g_Campos[ i ] ); }
adv_vault_get_field( g_vault, g_CampoAvatar, szAvatar, 199 ); adv_vault_get_keyname( g_vault, keyindex, pj, 31 ); iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<tr align=center>" ); iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<td>%d", position ); iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<td><img width=40px src=%s>", szAvatar ); iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<td>%s", pj); iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<td>%d (HS: %d)", iData[ Frags ], iData[ HeadShots ] ); iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<td>%d", iData[ Deaths ] ); count++; } iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "</table></body>" );
if( count ) show_motd( index, szMotd, "AMXX | TOP 5" ); else client_print_color( index, print_team_default, "%s No se encontraron jugadores posicionados en este top.", g_Tag ); }
Pawn Básico no critiquen xD
Mensajes: 3,077
Temas: 33
Registro en: May 2017
Reputación:
34
25/01/2021, 10:11 PM
(Última modificación: 25/01/2021, 10:11 PM por Valentina..)
Código PHP: new toploop = min( adv_vault_sort_numresult(g_vault, g_sort), 5 );
Acá tenés todo lo que necesitas.
Mensajes: 200
Temas: 56
Registro en: Oct 2020
Reputación:
1
(25/01/2021, 10:11 PM)Chema escribió: Código PHP: new toploop = min( adv_vault_sort_numresult(g_vault, g_sort), 5 );
Acá tenés todo lo que necesitas.
si lo subo a 20 este me mostrara en una sola motd los 20 mejores yo lo q quiero es seperar los motd top10 muestra en una motd los 10 primero top20 otra motd pero esta vez q muestre del top 10 al 20 top 30 igual
Pawn Básico no critiquen xD
Mensajes: 659
Temas: 97
Registro en: Feb 2016
Reputación:
12
Asi:
Código PHP: new toploop = min( adv_vault_sort_numresult(g_vault, g_sort), 20 );
Código PHP: for( new position = 11; position <= toploop; position++ ) { keyindex = adv_vault_sort_position( g_vault, g_sort, position )
if( !adv_vault_get_prepare( g_vault, keyindex ) ) continue;
static i; for( i = 0; i <sizeof( g_PlayerData[ ] ); i++ ) { iData[ i ] = adv_vault_get_field( g_vault, g_Campos[ i ] ); }
adv_vault_get_field( g_vault, g_CampoAvatar, szAvatar, 199 ); adv_vault_get_keyname( g_vault, keyindex, pj, 31 ); iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<tr align=center>" ); iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<td>%d", position ); iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<td><img width=40px src=%s>", szAvatar ); iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<td>%s", pj); iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<td>%d (HS: %d)", iData[ Frags ], iData[ HeadShots ] ); iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<td>%d", iData[ Deaths ] ); count++; }
Mensajes: 3,077
Temas: 33
Registro en: May 2017
Reputación:
34
25/01/2021, 11:59 PM
(Última modificación: 26/01/2021, 12:01 AM por Valentina.. Edited 1 time in total.)
(25/01/2021, 11:51 PM)Alejandro escribió: Asi:
El no quiere eso...
PD: Adaptalo o pasame el plugin entero para hacerlo por vos..
Código PHP: new g_sort_top[33];
public plugin_init() { register_clcmd("say", "Command_Say"); register_clcmd("say_team", "Command_Say"); }
public Command_Say(id) { static sData[191]; read_args(sData, charsmax(sData)); remove_quotes(sData);
if (sData[0] == '/') { if (sData[1] == 't' && sData[2] == 'o' && sData[3] == 'p') { if (sData[4] == '5') { g_sort_top[id] = 5; } else if (sData[4] == '1' && sData[5] == '0') { g_sort_top[id] = 10; } else if (sData[4] == '1' && sData[5] == '5') { g_sort_top[id] = 15; }
DisplayTop(id); } }
return PLUGIN_CONTINUE; }
public DisplayTop( index ) { new szMotd[ 1520 ]; static iLen; iLen = 0;
new keyindex, pj[ MAX_NAME_LENGTH ], count = 0;
new iData[ sizeof( g_PlayerData[ ] ) ], szAvatar[ 199 ];
new toploop = min( adv_vault_sort_numresult(g_vault, g_sort), g_sort_top[index] ? g_sort_top[index] : 15 );
iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<body><style>body{color:white;background:url(^"%s^");\ font-family:Arial,sans-serif;\ background-position: center center}\ table{border:10px;width:87%%;margin-top:10%%;background:#121212}\ td{font-size:13px;background:#272727}\ th{color:black;font-size:14px;background:#F4DA06;padding:1%%}\ </style>\ <table align=center>\ <tr align=center>\ <th width=10%%>#\ <th width=3%% height=5%%>Logo\ <th width=30%%>Nombre\ <th width=25%%>Frags\ <th width=15%%>Muertes", gz_bgCsTop );
for( new position = 1; position <= toploop; position++ ) { keyindex = adv_vault_sort_position( g_vault, g_sort, position )
if( !adv_vault_get_prepare( g_vault, keyindex ) ) continue;
static i; for( i = 0; i <sizeof( g_PlayerData[ ] ); i++ ) { iData[ i ] = adv_vault_get_field( g_vault, g_Campos[ i ] ); }
adv_vault_get_field( g_vault, g_CampoAvatar, szAvatar, 199 ); adv_vault_get_keyname( g_vault, keyindex, pj, 31 ); iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<tr align=center>" ); iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<td>%d", position ); iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<td><img width=40px src=%s>", szAvatar ); iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<td>%s", pj); iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<td>%d (HS: %d)", iData[ Frags ], iData[ HeadShots ] ); iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<td>%d", iData[ Deaths ] ); count++; } iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "</table></body>" );
if( count ) show_motd( index, szMotd, "AMXX | TOP 5" ); else client_print_color( index, print_team_default, "%s No se encontraron jugadores posicionados en este top.", g_Tag ); }
Mensajes: 7,178
Temas: 93
Registro en: Aug 2014
Reputación:
63
embeses devo entr4r a alludar
public DisplayTop( index, value ){
-.....
new toploop = min( adv_vault_sort_numresult(g_vault, g_sort), value > 19 ? 20 : value );
Mensajes: 200
Temas: 56
Registro en: Oct 2020
Reputación:
1
(25/01/2021, 11:51 PM)Alejandro escribió: Asi:
Código PHP: new toploop = min( adv_vault_sort_numresult(g_vault, g_sort), 20 );
Código PHP: for( new position = 11; position <= toploop; position++ ) { keyindex = adv_vault_sort_position( g_vault, g_sort, position )
if( !adv_vault_get_prepare( g_vault, keyindex ) ) continue;
static i; for( i = 0; i <sizeof( g_PlayerData[ ] ); i++ ) { iData[ i ] = adv_vault_get_field( g_vault, g_Campos[ i ] ); }
adv_vault_get_field( g_vault, g_CampoAvatar, szAvatar, 199 ); adv_vault_get_keyname( g_vault, keyindex, pj, 31 ); iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<tr align=center>" ); iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<td>%d", position ); iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<td><img width=40px src=%s>", szAvatar ); iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<td>%s", pj); iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<td>%d (HS: %d)", iData[ Frags ], iData[ HeadShots ] ); iLen += formatex( szMotd[ iLen ], sizeof szMotd - iLen, "<td>%d", iData[ Deaths ] ); count++; }
Gracias me funciono!
Pawn Básico no critiquen xD
|