Raised This Month: $ Target: $400
 0% 

bonus kill


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
nnajko
Senior Member
Join Date: May 2009
Location: Sweden
Old 01-19-2013 , 21:09   Re: bonus kill
Reply With Quote #4

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>

#define PLUGIN "Health on Kill"
#define VERSION "1.0"
#define AUTHOR "NNAJKO."

new pCvar_killhp;
new 
pCvar_bonushp;

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_message("DeathMsg""eventDeath""a");
    
    
pCvar_killhp register_cvar("hp_kill""5");
    
pCvar_bonushp register_cvar("hp_bonuskill""10");
}

public 
eventDeath()
{
    new 
iKiller read_data(1);
    new 
iVictim read_data(2);
    new 
iHS read_data(3);
    
    new 
szWeapon[20];
    
read_data(4szWeaponcharsmax(szWeapon));
    
    if( 
cs_get_user_team(iKiller) != cs_get_user_team(iVictim) )
    {
        if( 
is_user_alive(iKiller) )
        {
            new 
iHealth get_user_health(iKiller);
            
            if( 
equal(szWeapon"grenade") || iHS || equal(szWeapon"knife") )
            {
                
set_user_health(iKilleriHealth get_pcvar_num(pCvar_bonushp));
            }
            else
            {
                
set_user_health(iKilleriHealth get_pcvar_num(pCvar_killhp));
            }
        }
    }


Last edited by nnajko; 01-19-2013 at 21:10.
nnajko is offline
 


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 00:18.


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