Raised This Month: $44 Target: $400
 11% 

Stats Top5


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lantimilan
Senior Member
Join Date: May 2016
Location: KOSOVA
Old 11-05-2021 , 08:10   Stats Top5
Reply With Quote #1

Hello i found one plugin in https://amxmodx-es.com/showthread.php?tid=21823
I install in my server i write /top5 not open anything do you know where is problem
PHP Code:
/*<!------ [ Enumeradores ] ------!>*/
enum _:DATA HeadShotsFragsDeathsDamagesHitsBPBDKnifes };
enum _:ADV_DATA Cargar 0Guardar };
/*<!------ [ Defines ] ------!>*/
#define is_player_valid(%1) ( (1<=get_user_team(%1)<=2) && is_user_connected(%1) && !is_user_hltv(%1) && !is_user_bot(%1) )
#define MAX_AVATAR_LENGHT 200
/*<!------ [ Librerias ] ------!>*/
#include <amxmodx>
#include <amxmisc>
#include <adv_vault>
#include <csx>
#include <steamdata>

/*<!------ [ Variables ] ------!>*/
new g_Plugin[ ][ ]= 
{
    
"AMXX-CsTop5",
    
"1.0",
    
"Alejandro-."
}

new 
g_DataBase                 [ ] = "LSTop5";
new 
g_Tag                     [ ] = "^4[LS]^1";

new 
gz_DefaultAvatar        [ ] = "https://i.ibb.co/HB7q1P9/profile.png";
new 
gz_bgCsStats            [ ] = "https://imgfz.com/i/zh69Gtp.jpeg"
new 
gz_bgCsTop                [ ] = "https://fotos.subefotos.com/711db44d9b7cbeaf0bc417b8b15dc688o.jpg";

new 
g_PlayerDataMAX_PLAYERS ][ _:DATA ],
g_playernameMAX_PLAYERS ][ MAX_NAME_LENGTH ],
g_PlayerAvatarMAX_PLAYERS ][ MAX_AVATAR_LENGHT ],
g_PlayerOldConexionMAX_PLAYERS ][ 30 ];

new 
iMaxPlayers;

new 
g_vault
g_sort;

new 
g_Campos_:DATA ];
new 
g_CampoAvatarg_CampoOldConexion;
/*<!------ [ Plugin init ] ------!>*/
public plugin_init( ) 
{
    
register_plugin(g_Plugin], g_Plugin], g_Plugin] );
    
/* COMANDOS */
    
register_clcmd("say /top5""DisplayTop");
    
register_clcmd("say top5""DisplayTop");
    
register_clcmd("say_team /top5""DisplayTop");
    
register_clcmd("say_team top5""DisplayTop");
    
register_concmd("amx_avatar""cmd_avatar"_"https://i.ibb.co/HB7q1P9/profile.png");
    
register_concmd("say""hooksay");
    
register_concmd("say_team""hooksay");
    
/* EVENTOS */
    
register_event("DeathMsg""Event_Death""a");
    
register_event("Damage""Event_Dmg""b");

    
g_vault adv_vault_openg_DataBasefalse);
    
iMaxPlayers get_maxplayers();
    
    
/* ADV_VAULT */
    
static i;
    for( 
0<sizeofg_PlayerData[ ] ); i++ )
    {
        
g_Campos] =  adv_vault_register_field(g_vaultfmt"PLAYERDATA-#%d") );
    }
    
g_CampoAvatar adv_vault_register_field(g_vault"PLAYERDATA-AVATAR"DATATYPE_STRINGcharsmaxg_PlayerAvatar[ ] ) );
    
g_CampoOldConexion adv_vault_register_field(g_vault"PLAYERDATA-OLD"DATATYPE_STRINGcharsmaxg_PlayerOldConexion[ ] ) );

    
adv_vault_init(g_vault);
    
g_sort adv_vault_sort_create(g_vaultORDER_DESC02000g_CamposDamages ], g_CamposFrags ], g_CamposHeadShots ]);
}
/*<!------ [ Hook Say ] ------!>*/
public hooksayindex )
{
    new 
szMensaje74 ];
    
read_argsszMensajecharsmaxszMensaje ) );   
    
remove_quotesszMensaje ); 

    new 
Cmd15 ], PlayerMAX_NAME_LENGTH ];
    
parseszMensajeCmdcharsmaxCmd ), PlayercharsmaxPlayer ) );

    if( 
equalCmd"stats" ) || equalCmd"/stats" ) || equalCmd"/stats" ) || equalCmd"stats" ) )
    {
        new 
PlayerNameMAX_NAME_LENGTH ];
        new 
IndexNameMAX_NAME_LENGTH ];

        if( !
Player] ) get_user_nameindexPlayerNamecharsmaxPlayerName ) ); 
        else 
formatPlayerNamecharsmaxPlayerName ), Player );

        new 
iDatasizeofg_PlayerData[ ] ) ], 
            
szAvatar150 ], 
            
szOldConexion30 ];

        new 
szMotd1536 ];

        static 
iLen;    
        
iLen 0;

        if( !
adv_vault_get_prepareg_vault_PlayerName ) ) 
        {
            
client_print_colorindex print_chat"%s Statistikat e lojtarit nuk jane te mundshme."g_Tag );
            return 
PLUGIN_HANDLED;
        }

        static 
i;
        for( 
0<sizeofg_PlayerData[ ] ); i++ )
        {
            
iData] = adv_vault_get_fieldg_vaultg_Campos] );
        }

        
adv_vault_get_fieldg_vaultg_CampoAvatarszAvatar199 );
        
adv_vault_get_fieldg_vaultg_CampoOldConexionszOldConexion29 );

        
iLen += formatexszMotdiLen ], sizeof szMotd iLen,
            
"<body><style>\
            body{color:#121212;background:url(^"
%s^");\
            display: flex;\
            min-height: 100vh;\
            background-position: center center;\
            background-repeat: no-repeat;\
            background-attachment: fixed;\
            background-size: cover;\
            font-family:arial,sans-serif}\
            img{border-radius:110;width:40%%;}\
            h1{font-size:15px;background:#F4DA06}\
            h4{color:white}\
            .left,.right {width:38%%;text-align:center;margin-top:4%%;padding:3%%}\
            .left{float:left;margin-left:4.5%%}\
            .right{float:right;margin-right:4.5%%}\
            table{border:1px solid #F4DA06;font-size:10px}\
            th{background: #F4DA06}\
            td{border:1px solid #F4DA06;color:white}</style>"
gz_bgCsStats );
        
iLen += formatexszMotdiLen ], sizeof szMotd iLen"<div class=left><h1>PROFILI</h1></br><img src=%s></br><h4>%s</h4>"szAvatarPlayerName );
        
iLen += formatexszMotdiLen ], sizeof szMotd iLen"</div><div class=right>\
            <h1>STATISTIKAT</h1>\
            </br>\
            <table width=100%%>\
            <tr align=center>\
            <th width=25%%>Vrasjet\
            <th width=25%%>Koke\
            <th width=20%%>BP\
            <th width=30%%>Demtimet"
);
        
iLen += formatexszMotdiLen ], sizeof szMotd iLen"\
            <tr align=center>\
            <td>%s\
            <td>%s\
            <td>%s\
            <td>%s"
add_pointiDataFrags ] ), add_pointiDataHeadShots ] ),  add_pointiDataBP ] ), add_pointiDataDamages ] ) );
        
iLen += formatexszMotdiLen ], sizeof szMotd iLen"</table><table width=100%%>\
            <tr align=center>\
            <th width=25%%>Vdekjet\
            <th width=25%%>Thike\
            <th width=20%%>BD\
            <th width=30%%>Goditjet"
);
        
iLen += formatexszMotdiLen ], sizeof szMotd iLen"\
            <tr align=center>\
            <td>%s\
            <td>%s\
            <td>%s\
            <td>%s"
add_pointiDataDeaths ] ), add_pointiDataKnifes ] ),  add_pointiDataBD ] ), add_pointiDataHits ] ) );
        
iLen += formatexszMotdiLen ], sizeof szMotd iLen"</table><table width=100%%>\
            <tr align=center>\
            <th width=25%%>Aktiviteti Fundit:" 
);
        
iLen += formatexszMotdiLen ], sizeof szMotd iLen"\
            <tr align=center>\
            <td>%s</table>"
szOldConexion );
        
iLen += formatexszMotdiLen ], sizeof szMotd iLen"</br>" );
        
iLen += formatexszMotdiLen ], sizeof szMotd iLen"</body>" );

        if( !
equalPlayerIndexName ) ) client_print_color0print_team_default"%s Lojtari: ^4%s^1 po shikon statistikat e: ^3%s"g_TagIndexNamePlayerName )
        
show_motdindexszMotdfmt"Narcos STATS | %s"PlayerName ) );
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE;
}
/*<!------ [ Csx Bomb Planted ] ------!>*/
public bomb_plantedindex )
{
    if( !
is_user_connectedindex ) )
    return;

    
g_PlayerDataindex ][BP]++;
    
adv_dataindexGuardar );
}
/*<!------ [ Csx Bomb Defused ] ------!>*/
public bomb_defusedindex )
{
    if( !
is_user_connectedindex ) )
    return;

    
g_PlayerDataindex ][ BD ]++;
    
adv_dataindexGuardar );
}
/*<!------ [ Comand avatar ] ------!>*/
public cmd_avatarindexlevelcid )
{
    if( !
cmd_accessindexlevelcid2) )
    return 
PLUGIN_HANDLED;

    new 
arg150 ];
    
read_argv1argcharsmaxarg ) );
    
    if( !
containarg"https://" ) && !containarg"http://" ) && !containarg"www." )  )
    {
        
client_printindexprint_console"[Narcos] Duhet te jete skedari i ngarkuar ne web.")
        return 
PLUGIN_HANDLED;
    }

    if( 
strlenarg ) > 100 )
    {    
        
client_printindexprint_console"[Narcos] Nuk mund te jete URL me shum se 50 karaktere");
        return 
PLUGIN_HANDLED;
    }

    if( 
is_player_steamindex ) )
    {
        
client_printindexprint_console"[Narcos] Vetem STEAM mund te ndryshoj fotografin" );
        return 
PLUGIN_HANDLED;        
    }

    
formatg_PlayerAvatarindex ], charsmaxg_PlayerAvatar[ ] ), arg );
    
client_printindexprint_console"[Narcos] Foto u ngarkua me sukses!!");
    
adv_dataindexGuardar );
    return 
PLUGIN_HANDLED;
}
/*<!------ [ Display Top 5 ] ------!>*/
public DisplayTopindex )
{
    new 
szMotd1520 ];
    static 
iLen;
    
iLen 0;

    new 
keyindex
        
pjMAX_NAME_LENGTH ], 
        
count 0;

    new 
iDatasizeofg_PlayerData[ ] ) ], 
        
szAvatar199 ];

    new 
toploop minadv_vault_sort_numresult(g_vaultg_sort), );

    
iLen += formatexszMotdiLen ], 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%%>Emri\
        <th width=25%%>Vrasjet\
        <th width=15%%>Vdekjet"
gz_bgCsTop );

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

        if( !
adv_vault_get_prepareg_vaultkeyindex ) ) 
            continue;

        static 
i;
        for( 
0<sizeofg_PlayerData[ ] ); i++ )
        {
            
iData] = adv_vault_get_fieldg_vaultg_Campos] );
        }

        
adv_vault_get_fieldg_vaultg_CampoAvatarszAvatar199 );
        
adv_vault_get_keynameg_vaultkeyindexpj31 );
        
        
iLen += formatexszMotdiLen ], sizeof szMotd iLen"<tr align=center>" );
        
iLen += formatexszMotdiLen ], sizeof szMotd iLen"<td>%d"position );
        
iLen += formatexszMotdiLen ], sizeof szMotd iLen"<td><img width=40px src=%s>"szAvatar );
        
iLen += formatexszMotdiLen ], sizeof szMotd iLen"<td>%s"pj);
        
iLen += formatexszMotdiLen ], sizeof szMotd iLen"<td>%d       (HS: %d)"iDataFrags ], iDataHeadShots ] );
        
iLen += formatexszMotdiLen ], sizeof szMotd iLen"<td>%d"iDataDeaths ] );
        
count++;
    }
    
    
iLen += formatexszMotdiLen ], sizeof szMotd iLen"</table></body>" );

    if( 
count 
        
show_motdindexszMotd"Narcos | TOP 5" );
    else 
        
client_print_colorindexprint_team_default"%s Asnje lojtar nuk u gjete ne Top5."g_Tag );
}
/*<!------ [ Client Putinserver ] ------!>*/
public client_putinserverindex )
{
    
get_user_nameindexg_playernameindex ], charsmaxg_playername[ ] ) );

    static 
i;
    for( 
0<sizeofg_PlayerData[ ] ); i++ )
    {
        
g_PlayerDataindex ][ ] = EOS;
    }

    
g_PlayerOldConexionindex ] = "^0";
    
g_PlayerAvatarindex ] = "^0";

    if( 
is_player_steamindex ) )
    {
        
formatg_PlayerAvatarindex ], charsmaxg_PlayerAvatar[ ] ), gz_DefaultAvatar );
        
adv_dataindexCargar );
    }    
    else 
    {
        
set_task1.0"SteamLoadData"index );
    }
}
/*<!------ [ Steam Load Data ] ------!>*/
public SteamLoadDataindex )
{
    
adv_dataindexCargar );
    
get_steamdataindexg_PlayerAvatarindex ], charsmaxg_PlayerAvatar[ ] ), STD_AVATAR_FULL );
}
/*<!------ [ Client Disconected ] ------!>*/
public client_disconnectedindex )
{
    
get_time"%d/%m/%Y - %H:%M:%S"g_PlayerOldConexionindex ], charsmaxg_PlayerOldConexion[ ] ) );
    
adv_dataindexGuardar );
}

/*<!------ [ Evento Damage ] ------!>*/
public Event_Dmgindex )
{
    new 
get_user_attackerindex )
    new 
damage read_data(2)

    if(!
is_user_alive(a) || !(<= <= iMaxPlayers) || == index || damage <= 0)
    {
        return
    }

    
g_PlayerData][ Damages ] += damage
    g_PlayerData
][ Hits ] += 1
    adv_data
aGuardar );
}
/*<!------ [ Evento Death Msg ] ------!>*/
public Event_Death()
{
    new 
Atack read_data(1);
    new 
Victm read_data(2);
    new 
hs read_data(3);
    new 
Weapon get_user_weapon(Atack);

    if( !
is_player_validAtack ) || !is_player_validVictm ) )
    return;

    if(
Atack == Victm)
    {
        
g_PlayerDataAtack ][ Frags ] -= 1;
        
g_PlayerDataAtack ][ Deaths ]++;
        
adv_dataAtackGuardar );
        return;
    }

    if(
Weapon == CSW_KNIFEg_PlayerDataAtack ][ Knifes ]++;

    if(
hsg_PlayerDataAtack ][ HeadShots ]++;

    
g_PlayerDataAtack ][ Frags ]++;
    
g_PlayerDataVictm ][ Deaths ]++;
    
adv_dataVictmGuardar );
    
adv_dataAtackGuardar );
}
/*<!------ [ Adv Vault Save/Load ] ------!>*/
public adv_dataindextype_adv_use )
{
    if( !
is_user_connectedindex ) )
    return;

    switch( 
type_adv_use )
    {
        case 
Cargar:{

            if( !
adv_vault_get_prepareg_vault_g_playernameindex ] ) )    
            return;

            static 
i;
            for( 
0<sizeofg_PlayerData[ ] ); i++ )
            {
                
g_PlayerDataindex ][ ] = adv_vault_get_fieldg_vaultg_Campos] );
            }

            
adv_vault_get_fieldg_vaultg_CampoAvatarg_PlayerAvatarindex ], charsmaxg_PlayerAvatar[ ] ) );
            
adv_vault_get_fieldg_vaultg_CampoOldConexiong_PlayerOldConexionindex ], charsmaxg_PlayerOldConexion[ ] ) );
            return;
        }
        case 
Guardar:{

            
adv_vault_set_startg_vault );

            static 
i;
            for( 
0<sizeofg_PlayerData[ ] ); i++ )
            {
                
adv_vault_set_fieldg_vaultg_Campos], g_PlayerDataindex ][ ] );
            }

            
adv_vault_set_field(g_vaultg_CampoAvatarg_PlayerAvatarindex ] );
            
adv_vault_set_field(g_vaultg_CampoOldConexiong_PlayerOldConexionindex ] );
            
adv_vault_set_endg_vault0g_playernameindex ] );
            
adv_vault_sort_updateg_vaultg_sort );
        }
    }
    return;
}
/*<!------ [ Stock Add_Points ] ------!>*/
stock add_point(number)

    new 
countistr[29], str2[35], len
    num_to_str
(numberstrcharsmax(str))
    
len strlen(str)

    for (
0leni++)
    {
        if (
!= && ((len i) %== 0))
        {
            
add(str2charsmax(str2), "."1)
            
count++
            
add(str2[i+count], 1str[i], 1)
        }
        else
        
add(str2[i+count], 1str[i], 1)
    }

    return 
str2;


/*<!------ [ Stock Add_Points ] ------!>*/
stock bool:is_player_steam( const index )
{
    new 
authid25 ];
    
get_user_authidindexauthid24 );

    if( 
containiauthid"STEAM_" ) == -)
        return 
true;
    return 
false;


Last edited by lantimilan; 11-05-2021 at 08:12.
lantimilan is offline
Send a message via MSN to lantimilan
Emanuelitop15
New Member
Join Date: Aug 2020
Location: Argentina
Old 11-07-2021 , 15:02   Re: Stats Top5
Reply With Quote #2

Check if some plugin is hooking say, maybe that's the problem.
Cause plugin it's okey.
__________________
_____________________________
MY DISCORD:Emanuelitop15#5005
Im argentino
Emanuelitop15 is offline
Reply


Thread Tools
Display Modes

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 08:04.


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