Raised This Month: $32 Target: $400
 8% 

last matches results


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
666
Senior Member
Join Date: Mar 2015
Old 02-12-2019 , 18:24   last matches results
Reply With Quote #1

someone could help me do this, it is possible to do it with adv_vault or another saved better, with the name of the server the time and date and the map only

__________________

Last edited by 666; 02-13-2019 at 16:18.
666 is offline
666
Senior Member
Join Date: Mar 2015
Old 02-13-2019 , 15:59   Re: results of the match
Reply With Quote #2

but I do not know what to do to save the results of each game
__________________

Last edited by 666; 02-13-2019 at 16:39.
666 is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 02-14-2019 , 09:45   Re: last matches results
Reply With Quote #3

I'm developing this again with a more complete stats.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
666
Senior Member
Join Date: Mar 2015
Old 02-16-2019 , 12:14   Re: last matches results
Reply With Quote #4

Quote:
Originally Posted by ^SmileY View Post
I'm developing this again with a more complete stats.

Until now I can do this, but I do not have a problem that does not work out as I always show position # 1, and if the map changes it changes everything and position # 2 is not shown, I do not have much knowledge and if I can recommend a hand in this please

what do I have to do to sort the positions by match played

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <adv_vault>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

enum
{
    
CAMPO_MAP,
    
CAMPO_FECHA,
    
CAMPO_HORA,
    
CAMPO_SERVER,
    
MAX_FIELDS
}

new 
g_campos[MAX_FIELDS],g_vault,g_Sort_MATCH,g_iMaxPlayers,motd[1536],g_szAuthID[33][35];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("HLTV""event_round_start""a""1=0""2=0");
    
register_clcmd("say .match""MATCHS");
    
    
g_iMaxPlayers get_maxplayers();
    
vault_init();
}

public 
client_authorizedid )
{
    
get_user_authidid g_szAuthID[id], charsmaxg_szAuthID[ ] ) )
}

public 
client_putinserverid )
{
    
load_data(id);
}

public 
event_round_start()
{
    for(new 
id=1id <= g_iMaxPlayersid++)
    {
        if(
is_user_connected(id)) save_data(id);
    }
    
    
adv_vault_sort_update(g_vaultg_Sort_MATCH)
}

vault_init()
{
    
g_vault adv_vault_open("MATCHS"false)
    
g_campos[CAMPO_MAP]     = adv_vault_register_field(g_vault"MAPA")
    
g_campos[CAMPO_FECHA]     = adv_vault_register_field(g_vault"FECHA"DATATYPE_STRING32)
    
g_campos[CAMPO_HORA]     = adv_vault_register_field(g_vault"HORA"DATATYPE_STRING32)
    
g_campos[CAMPO_SERVER]     = adv_vault_register_field(g_vault"SERVER"DATATYPE_STRING32)
    
    
adv_vault_init(g_vault)
    
    
g_Sort_MATCH adv_vault_sort_create(g_vaultORDER_DESC02000,g_campos[CAMPO_MAP]);
}

save_data(id)
{
    static 
HORA[32],FECHA[32],MAPA[32],g_pHostName,SERVERname[32]
    
get_time("%H:%M:%S %p"HORAcharsmax(HORA));
    
get_time("%d-%m-%Y"FECHAcharsmax(FECHA));
    
get_mapname(MAPAcharsmax(MAPA));
    
g_pHostName get_cvar_pointer("hostname");
    
get_pcvar_string(g_pHostName,SERVERname,charsmax(SERVERname));
    
    
adv_vault_set_start(g_vault)
    
adv_vault_set_field(g_vaultg_campos[CAMPO_MAP], MAPA)
    
adv_vault_set_field(g_vaultg_campos[CAMPO_FECHA], FECHA)
    
adv_vault_set_field(g_vaultg_campos[CAMPO_HORA], HORA)
    
adv_vault_set_field(g_vaultg_campos[CAMPO_SERVER], SERVERname)
    
adv_vault_set_end(g_vault0g_szAuthID[id])
}

load_data(id)
{
    static 
HORA[32],FECHA[32],MAPA[32],g_pHostName,SERVERname[32]
    
get_time("%H:%M:%S %p"HORAcharsmax(HORA));
    
get_time("%d-%m-%Y"FECHAcharsmax(FECHA));
    
get_mapname(MAPAcharsmax(MAPA));
    
g_pHostName get_cvar_pointer("hostname");
    
get_pcvar_string(g_pHostName,SERVERname,charsmax(SERVERname));
    
    if(!
adv_vault_get_prepare(g_vault0g_szAuthID[id]))
    return;
    
    
adv_vault_get_field(g_vaultg_campos[CAMPO_MAP], MAPAcharsmax(MAPA))
    
adv_vault_get_field(g_vaultg_campos[CAMPO_FECHA], FECHAcharsmax(FECHA))
    
adv_vault_get_field(g_vaultg_campos[CAMPO_HORA], HORAcharsmax(HORA))
    
adv_vault_get_field(g_vaultg_campos[CAMPO_SERVER], SERVERnamecharsmax(SERVERname))
}

public 
MATCHS(id)
{
    static 
HORA[32],FECHA[32],MAPA[32],g_pHostName,SERVERname[32]
    
get_time("%H:%M:%S %p"HORAcharsmax(HORA));
    
get_time("%d-%m-%Y"FECHAcharsmax(FECHA));
    
get_mapname(MAPAcharsmax(MAPA));
    
g_pHostName get_cvar_pointer("hostname");
    
get_pcvar_string(g_pHostName,SERVERname,charsmax(SERVERname));
    
    new 
keyindexlen
    motd
[0] = 0
    
    add
(motdcharsmax(motd),
    
"<html><meta charset=utf-8><style>\
    body {background-color:#000000;}\
    .header {background-color:#00FF00;color:#000000;}\
    .style2 {color:#FF0000;font-family:arial black}\
    </style><body>\
    <table border=10 cellspacing=0 bordercolor=white class=style2 width=100%>\
    <tr class=header><th>#\
    <th>MAPA\
    <th>FECHA\
    <th>HORA\
    <th>SERVER"
)
    
    
len strlen(motd)

    new 
toploop min(adv_vault_sort_numresult(g_vaultg_Sort_MATCH), 100)

    for(new 
position=1position <= toploopposition++)
    {
        
keyindex adv_vault_sort_position(g_vaultg_Sort_MATCHposition)

        if(!
adv_vault_get_prepare(g_vaultkeyindex)) continue
        
        
adv_vault_get_field(g_vaultg_campos[CAMPO_MAP], MAPAcharsmax(MAPA))
        
adv_vault_get_field(g_vaultg_campos[CAMPO_FECHA], FECHAcharsmax(FECHA))
        
adv_vault_get_field(g_vaultg_campos[CAMPO_HORA], HORAcharsmax(HORA))
        
adv_vault_get_field(g_vaultg_campos[CAMPO_SERVER], SERVERnamecharsmax(SERVERname))
        
        
len += formatex(motd[len], charsmax(motd)-len,
        
"<tr><th>%d\
        <th>%s\
        <th>%s\
        <th>%s\
        <th>%s"
,position,MAPA,FECHA,HORA,SERVERname)
    }

    
add(motdcharsmax(motd), "</table></body></html>")

    
show_motd(idmotd"MATCHS")

__________________
666 is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 02-19-2019 , 08:25   Re: last matches results
Reply With Quote #5

You just need to save match id (accumulative) and sort the array, in other words i preffer sql to do this. Can try sqlite locally better than vault in this case
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:43.


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