Raised This Month: $12 Target: $400
 3% 

Stats for Knife


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
barvi
New Member
Join Date: May 2020
Old 05-20-2020 , 12:13   Stats for Knife
Reply With Quote #1

Hello i searched but i didnt found knife stats for exmp: how many kills only with knife,
like say /knifetop or /kniferank and shows how many have you killed with knife and top15
thanks
barvi is offline
saarthbhosale
Member
Join Date: Feb 2020
Old 05-24-2020 , 06:10   Re: Stats for Knife
Reply With Quote #2

Quote:
Originally Posted by barvi View Post
Hello i searched but i didnt found knife stats for exmp: how many kills only with knife,
like say /knifetop or /kniferank and shows how many have you killed with knife and top15
thanks
https://forums.alliedmods.net/showthread.php?t=102413
saarthbhosale is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 05-24-2020 , 09:21   Re: Stats for Knife
Reply With Quote #3

try this plugin

PHP Code:
#include <amxmodx>
#include <adv_vault>
#include <cromchat>

#define PLUGIN "Top Knife Stats"
#define VERSION "1.0"
#define AUTHOR "Jacare de Sunga"

#if defined client_disconnected
    #define client_disconnect client_disconnected
#endif

new g_knife33 ]

new 
g_vault
new g_sort
new g_playername33 ][ 32 ]
new 
motd8000 ]
new 
g_maxplayers

enum 
{
    
KNIFE,
    
MAX_FIELDS
}

new 
g_campos[MAX_FIELDS]

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event"DeathMsg""Hook_Deathmessage""a" );
    
    
register_event("HLTV""round_start""a""1=0""2=0")
    
    
register_clcmd("say /kniferank""ranking")
    
register_clcmd("say /knifetop""top10_knife")
    
    
g_vault adv_vault_open("topknife"false)
    
g_campos[KNIFE]     = adv_vault_register_field(g_vault"Knife")
    
adv_vault_init(g_vault)
    
    
g_sort adv_vault_sort_createg_vaultORDER_DESC02000g_camposKNIFE ] )
    
    
g_maxplayers get_maxplayers()
    
    
CC_SetPrefix("&x04[&x03Knife Stats&x04]")
}

public 
Hook_Deathmessage()
{
    new 
killer read_data);
    new 
victim read_data);
    new 
weapon get_user_weaponkiller )
    
    if( 
killer == victim )
    {
        return 
PLUGIN_HANDLED;
    }
    
    if ( 
weapon == CSW_KNIFE )
             
g_knifekiller ]++
         
    return 
PLUGIN_CONTINUE     


public 
client_putinserverid )
{
    
get_user_name(idg_playername[id], 31 );
    
    
g_knifeid ] = 0
    
    set_task
15.0"advert"id)
    
    
LoadDataid )
}

public 
client_disconnectid )
{
    
SaveDataid )
}

public 
advertid )
{
    
CC_SendMessageid"^x01Type ^x04/kniferank ^x01to see your ^x03Knife Rank!n." )
    
CC_SendMessageid"^x01Type ^x04/knifetop ^x01to see your ^x03Knife TOP10!n." )
}
    
public 
rankingid )
{
    new 
rank adv_vault_sort_key(g_vaultg_sort0g_playernameid ] )
    
    if( !
rank 
    {
        
        
CC_SendMessage(id"^x01You are not in the rank yet.")
    }
    else 
CC_SendMessage(id"^x01Your knife rank is ^x04%d"rank)
}

public 
round_start()
{
    for(new 
id=1id <= g_maxplayersid++)
    {
        if( 
is_user_connectedid ) )
        
SaveDataid )
    }
    
    
adv_vault_sort_update(g_vaultg_sort)
}

public 
top10_knifeid )
{
    new 
knife11,  keyindexpj32 ], g_sort
    
    
static len
    
    len 
0

    
new toploop minadv_vault_sort_numresultg_vaultg_sort ), 10 )
    
    
len += formatex(motd[len], sizeof motd-len,
    
"<body bgcolor=#A4BED6>\
    <table width=100%% cellpadding=2 cellspacing=0 border=0>\
    <tr align=center bgcolor=#52697B>\
    <th width=20%%>Position\
    <th width=20%% align=left>Name\
    <th width=20%%>Kills"
);
    
    for( new 
position=1position <= toploopposition++ )
    {
        
keyindex adv_vault_sort_positiong_vaultg_sortposition )
        
        if( !
adv_vault_get_prepareg_vaultkeyindex ) ) continue
        
        
knife11 adv_vault_get_fieldg_vaultg_camposKNIFE ] )
        
        
adv_vault_get_keynameg_vaultkeyindexpj31 )

        
len += formatex(motd[len], sizeof motd-len"<tr align=center>");
        
len += formatex(motd[len], sizeof motd-len"<td>%d"position);
        
len += formatex(motd[len], sizeof motd-len"<td align=left>%s"pj);
        
len += formatex(motd[len], sizeof motd-len"<td>%d"knife11);
    }
    
    
len += formatex(motd[len], sizeof motd-len"</table></body>");
    
    
show_motdidmotd"TOP KNIFE STATS");


public 
client_infochangedid )
{
    if( !
is_user_connectedid ) ) return
    
    static 
newname32 ]
    
    
get_user_infoid"name"newnamecharsmaxnewname ) )    
    
    if( !
equal(newnameg_playernameid ] ) )
    {
        
set_task0.1"LoadData"id )
    }
}
public 
SaveDataid )
{
    if(!
is_user_connectedid ) ) return;
    
    
adv_vault_set_startg_vault )
    
adv_vault_set_fieldg_vaultg_camposKNIFE ], g_knifeid ] )
    
adv_vault_set_endg_vault0g_playernameid ] )
}
public 
LoadDataid )
{
    
    if(!
adv_vault_get_prepare(g_vault_g_playernameid ] ) )        
             return;
    
    
g_knifeid ] = adv_vault_get_fieldg_vaultg_camposKNIFE ] )

tarsisd2 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 19:33.


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