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

deathrun trap kills


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 02-07-2023 , 09:56   deathrun trap kills
Reply With Quote #1

hello, I need a plugin in witch it saves your Terrorist kills (CT kills T) and Trap kills (Terr kills CT with traps)! I'm using this points plugin from below and i'd like to add that kills to it!
PHP Code:
#include <amxmodx>
#include <csx>

#define STATS_KILLS 0
#define MAX_BUFFER_LENGTH 2047
#define MAX_NAME_LENGTH 31

new const g_szImageLink[ ] = "https://i.imgur.com/yzy666q.jpg";
new const 
g_szEndMessage[ ] = "Top players ranked by points<br>DeathRun";

new 
g_szBufferMAX_BUFFER_LENGTH +];

public 
plugin_init()
{
    
register_plugin("Rank with points""1.0""cyby")
    
register_clcmd("say /rank""cmdRank")
    
register_clcmd("say_team /rank""cmdRank")
    
register_clcmd("say /top15""cmdTop15")
    
register_clcmd("say_team /top15""cmdTop15")
}

public 
cmdRank(id)
{
    new 
izStats[8], izBody[8]
    new 
iRankPosiRankMax
    
    iRankPos 
get_user_stats(idizStatsizBody)
    
iRankMax get_statsnum()
    
    
chat_color(id".v|prefix|.g Your rank is.v %d.g from.v %d.g with.v %d.g points."iRankPosiRankMaxizStats[STATS_KILLS])
    
    return 
PLUGIN_CONTINUE
}

public 
cmdTop15(id)
{
    
format_top15g_szBuffer )
    
show_motd(idg_szBuffer"Top 15")
    
    return 
PLUGIN_CONTINUE
}

format_top15g_szBufferMAX_BUFFER_LENGTH ] )
{
    
    static 
szNameMAX_NAME_LENGTH +], iLeniMaxiiStats], iBody];
    
iMax clampget_statsnum( ), 015 );
    
iLen 0;
    
0;
    
    
iLen formatexg_szBufferMAX_BUFFER_LENGTH"<body bgcolor=#2b2a89><br><center><img src=^"%s^"</center>"g_szImageLink );
    
iLen += formatg_szBufferiLen ], MAX_BUFFER_LENGTH iLen"<br><br><br><table width=58%% cellpadding=2 cellspacing=0 border=0> <tr align=center bgcolor=#52697B>" );
    
iLen += formatg_szBufferiLen ], MAX_BUFFER_LENGTH iLen"<th width=8%% > # <th width=25%%> Name<th width=25%%> Points");
    
    for( 
0iMax && MAX_BUFFER_LENGTH iLen 0i++ )
    {
        
get_statsiiStatsiBodyszNameMAX_NAME_LENGTH );
        while( 
containiszName "<") != -)
            
replaceszName MAX_NAME_LENGTH"<""<" );
        while( 
containiszName">") != -)
            
replaceszName MAX_NAME_LENGTH">"">" );
            
        
iLen += formatg_szBufferiLen ], MAX_BUFFER_LENGTH iLen"<tr align=center%s> <td> %d <td> %s <td> %i", ( ( i%) == ) ? "" " bgcolor=#A4BED6", ( 1), szNameiStatsSTATS_KILLS ] );
        
    }
    
    
iLen += formatg_szBufferiLen ], MAX_BUFFER_LENGTH iLen"</table></body>" );
    
iLen += formatg_szBufferiLen ], MAX_BUFFER_LENGTH iLen"<tr><center><b><br>%s"g_szEndMessage );
    
}
stock chat_color(const id, const input[], any:...)
{
    new 
count 1players[32]
    static 
msg[191]
    
vformat(msg190input3)

    
replace_all(msg190".v""^4")
    
replace_all(msg190".g""^1")
    
replace_all(msg190".e""^3")

    if (
idplayers[0] = id; else get_players(playerscount"ch")
    {
        for (new 
0counti++)
        {
            if (
is_user_connected(players[i]))
            {
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i])
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }

it should appear when you say /rank.. Your rank is x from x with x ct kills and x trap kills!
Thank you!

edit: im also using (https://forums.alliedmods.net/showthread.php?t=266396) which T gets kills from traps
__________________
a simple act of caring creates an endless ripple.

Last edited by Nutu_; 02-07-2023 at 09:57.
Nutu_ is offline
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 17:48.


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