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

Special Kill Rewards


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay       
PvtSmithFSSF
Senior Member
Join Date: Jul 2008
Old 04-16-2009 , 20:50   Special Kill Rewards
Reply With Quote #1

This plugin will allow players to get extra kills for their grenade kills or knife kills. It usually takes skill for these types of kills so it's nice to give your players a reward for them!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
CVARS:

amx_skmod
-- 0 means plugin is off, 1 means plugin is on.

amx_nadekill
-- How many kills are awarded for a grenade kill.
-- Example: amx_nadekill 2
---- This would give you 2 kills for each grenade kill.

amx_knifekill

-- How many kills are awarded for a knife kill.
-- Example: amx_knifekill 3
---- This would give you 3 kills for each knife kill.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

=-=-=-=-=-=-=-=-=-=-
Thanks to Starsailor for compiling issue help.
=-=-=-=-=-=-=-=-=-=-
Attached Files
File Type: sma Get Plugin or Get Source (SpecialKills.sma - 922 views - 2.3 KB)
PvtSmithFSSF is offline
homeboy619
BANNED
Join Date: Mar 2008
Old 04-16-2009 , 20:58   Re: Special Kill Rewards
Reply With Quote #2

wow!
good idea!
homeboy619 is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-16-2009 , 21:08   Re: Special Kill Rewards
Reply With Quote #3

PHP Code:
/* 
***************************************************
*** Plugin by PvtSmithFSSF @ AlliedMods.net       *
*** Special thanks to Starsailor for              *
*** help with compiling issues.                   *
*** Enjoy! +K Appreciated.                        *
***************************************************
*/

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>

#define PLUGIN "Special Kills MOD"
#define VERSION "1.0"
#define AUTHOR "PvtSmithFSSF"
#define isPlayer(%1) (1<=(%1)<=32)

enum Weapon
{
    
Knife,
    
Nade
}

new 
WeaponsCSW[Weapon] = {CSW_KNIFE,CSW_HEGRENADE}
new 
WeaponsCvars[Weapon
new 
WeaponsCvarsLabels[Weapon][] = {"amx_knifekill","amx_nadekill"}
new 
WeaponsCvarsDefault[Weapon][] = {"2","3"}

new 
CvarPluginOn

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    for(new 
Weapon:i=Weapon:0;i<Weapon;i++)
        
WeaponsCvars[i] = register_cvar(WeaponsCvarsLabels[i],WeaponsCvarsDefault[i]);
    
    
CvarPluginOn register_cvar("amx_skmod""1")
    
    
RegisterHam(Ham_Killed,"player","death");
}

public 
client_putinserver(id)
{
    
set_task(4.0"OnOffNotify"id)
    
set_task(2.0"SKMDetailsNotify"id)
}


public 
OnOffNotify(id)
{
    
client_print(idprint_chat"[AMXModX] 'Special Kills Mod' is currently %s.",get_pcvar_num(CvarPluginOn) ? "ENABLED" "DISABLED");
}

public 
SKMDetailsNotify(id)
{
    if(
get_pcvar_num(CvarPluginOn))
    {
        
client_print(idprint_chat"[AMXModX] Try to get knife/grenade kills! They will give you a special +Kill Bonus!");
    }
}

public 
death(idid_attackershouldgib)
{
    new 
weapon get_user_weapon(id_attacker)
    
    if(
id != id_attacker && isPlayer(id_attacker) && get_pcvar_num(CvarPluginOn))
    {
        for(new 
Weapon:i=Weapon:0;i<Weapon;i++)
        {
            if(
weapon == WeaponsCSW[i])
            {
                
set_user_frags(id_attacker,get_user_frags(id_attacker) + get_pcvar_num(WeaponsCvars[i]));
                return 
HAM_SUPERCEDE;
            }
        }
    }    
    
    return 
HAM_IGNORED;

__________________

Last edited by joaquimandrade; 04-16-2009 at 21:15.
joaquimandrade is offline
PvtSmithFSSF
Senior Member
Join Date: Jul 2008
Old 04-16-2009 , 21:11   Re: Special Kill Rewards
Reply With Quote #4

My way is just fine
PvtSmithFSSF is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-16-2009 , 21:12   Re: Special Kill Rewards
Reply With Quote #5

Quote:
Originally Posted by PvtSmithFSSF View Post
My way is just fine
You have to add the check
Code:
id != id_attacker
The rest is fine.
__________________
joaquimandrade is offline
PvtSmithFSSF
Senior Member
Join Date: Jul 2008
Old 04-16-2009 , 21:17   Re: Special Kill Rewards
Reply With Quote #6

Why do I need that?

Last edited by PvtSmithFSSF; 04-16-2009 at 21:19.
PvtSmithFSSF is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-16-2009 , 21:19   Re: Special Kill Rewards
Reply With Quote #7

Quote:
Originally Posted by PvtSmithFSSF View Post
Why do I need that?

Because hegrenades explode.
__________________
joaquimandrade is offline
PvtSmithFSSF
Senior Member
Join Date: Jul 2008
Old 04-16-2009 , 21:22   Re: Special Kill Rewards
Reply With Quote #8

Thanks I'll add it soon I gotta go =] +k
PvtSmithFSSF is offline
ExeCute
BANNED
Join Date: Apr 2009
Old 04-16-2009 , 21:43   Re: Special Kill Rewards
Reply With Quote #9

This plugin sounds nice
ExeCute is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 04-17-2009 , 07:24   Re: Special Kill Rewards
Reply With Quote #10

Quote:
Originally Posted by joaquimandrade View Post
PHP Code:

public death(idid_attackershouldgib)
{
    new 
weapon get_user_weapon(id_attacker)
    
    if(
id != id_attacker && isPlayer(id_attacker) && get_pcvar_num(CvarPluginOn))
    {
        for(new 
Weapon:i=Weapon:0;i<Weapon;i++)
        {
            if(
weapon == WeaponsCSW[i])
            {
                
set_user_frags(id_attacker,get_user_frags(id_attacker) + get_pcvar_num(WeaponsCvars[i]));
                return 
HAM_SUPERCEDE;
            }
        }
    }    
    
    return 
HAM_IGNORED;

Not correct...if i throw a grenade and switch to deagle for instance -- no results.
DeathMsg is fine.
__________________

anakin_cstrike 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 01:13.


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