Raised This Month: $32 Target: $400
 8% 

[REQ] One Hit Knife Kill


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 04-13-2009 , 18:31   [REQ] One Hit Knife Kill
Reply With Quote #1

Just need a plugin or script that turns the stab into a 1 hit kill and the slashes into two slashes kill, Each slash carrying 50 dmg and the stab, 100 changed by cvar
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 04-14-2009 , 05:01   Re: [REQ] One Hit Knife Kill
Reply With Quote #2

This is very rong!!!

I typed 'One Hit Knife Kill' in the plugin compiler and there came one...

http://www.amxmodx.org/compiler.php?...hor=&go=search
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 04-14-2009 , 08:35   Re: [REQ] One Hit Knife Kill
Reply With Quote #3

yeah, I saw those, It could've been better coded and those plugins are from amxmodx v1.0
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-14-2009 , 08:57   Re: [REQ] One Hit Knife Kill
Reply With Quote #4

Try this ;

Code:
    #include <amxmodx>     #include <fakemeta>     #include <hamsandwich>     new gMaxClients;     new pCvarSlashDamage;     new pCvarStabDamage;         #define DMG_KNIFE  ( DMG_BULLET | DMG_NEVERGIB )         #define IsAttackerHasKnife(%1,%2) ( IsPlayer(%1) && ( %2 & DMG_KNIFE ) && get_user_weapon( %1 ) == CSW_KNIFE )     #define IsPlayer(%1)              ( 1 <= %1 <= gMaxClients )         public plugin_init ()     {         register_plugin( "Custom Knife Damage", "1.0.0", "Arkshine" );                 pCvarSlashDamage = register_cvar( "ckd_slash_damage", "50" );         pCvarStabDamage  = register_cvar( "ckd_stab_damage" , "100" );             RegisterHam( Ham_TakeDamage, "player", "Player_TakeDamage" );         gMaxClients = get_maxplayers();     }         public Player_TakeDamage ( const Victim, const Inflictor, const Attacker, Float:Damage, const DamageBits )     {         if ( IsAttackerHasKnife ( Attacker, DamageBits ) )         {             SetHamParamFloat( 4, get_pcvar_float( Damage == 15.0 ? pCvarSlashDamage : pCvarStabDamage ) );         }     }

Last edited by Arkshine; 04-14-2009 at 10:11.
Arkshine is offline
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 04-14-2009 , 09:51   Re: [REQ] One Hit Knife Kill
Reply With Quote #5

nice, you should release this in new plugin submissions, it would get accepted cause the older ones are outdated and bug filled
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-14-2009 , 10:06   Re: [REQ] One Hit Knife Kill
Reply With Quote #6

Plugin is too smal, and for the moment I don't know if it works as expected. btw, I've fixed a typo.
Arkshine is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 04-14-2009 , 10:18   Re: [REQ] One Hit Knife Kill
Reply With Quote #7

Quote:
Originally Posted by arkshine View Post
PHP Code:
SetHamParamFloat4get_pcvar_floatDamage == 15.0 pCvarSlashDamage pCvarStabDamage ) ); 
I doubt this Damage == 15.0 will be accurate as the slash will do different damage depending on the hitbox hit.
__________________
In Flames we trust!
Nextra is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-14-2009 , 11:00   Re: [REQ] One Hit Knife Kill
Reply With Quote #8

You're right.

So, something like should be more accurate :

Code:
    #include <amxmodx>     #include <fakemeta>     #include <hamsandwich>     new gMaxClients;     new pCvarSlashDamage;     new pCvarStabDamage;         const m_afButtonPressed = 246;     #define DMG_KNIFE  ( DMG_BULLET | DMG_NEVERGIB )         #define IsAttackerHasKnife(%1,%2) ( IsPlayer(%1) && ( %2 & DMG_KNIFE ) && get_user_weapon( %1 ) == CSW_KNIFE )     #define IsPlayer(%1)              ( 1 <= %1 <= gMaxClients )         public plugin_init ()     {         register_plugin( "Custom Knife Damage", "1.0.0", "Arkshine" );                 pCvarSlashDamage = register_cvar( "ckd_slash_damage", "50" );         pCvarStabDamage  = register_cvar( "ckd_stab_damage" , "100" );             RegisterHam( Ham_TakeDamage, "player", "Player_TakeDamage" );         gMaxClients = get_maxplayers();     }         public Player_TakeDamage ( const Victim, const Inflictor, const Attacker, Float:Damage, const DamageBits )     {         if ( IsAttackerHasKnife ( Attacker, DamageBits ) )         {             SetHamParamFloat( 4, get_pcvar_float( get_pdata_int( Attacker, m_afButtonPressed ) & IN_ATTACK ? pCvarSlashDamage : pCvarStabDamage ) );         }     }

Though, it's still possible to use both attack the same time but it should not happen ( very rarely I think )
Arkshine is offline
Zerk0o0o0
Member
Join Date: Feb 2010
Old 09-05-2011 , 08:51   Re: [REQ] One Hit Knife Kill
Reply With Quote #9

Hi! I have hns server.
I want two hit with knife for kill a player (ts)
Can you make a code for me? Me need when ct hit first time a ts with knife damage him 65 % and ts then have 35 hp.
Sorry for my english.
Zerk0o0o0 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 06:49.


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