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

[Reqeust] Kill player only use kinfe


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hachunowoo
New Member
Join Date: Jul 2018
Old 08-18-2018 , 02:13   [Reqeust] Kill player only use kinfe
Reply With Quote #1

Kill player only use knife,gun don't take damage for player.
But not ban weapon.
hachunowoo is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 08-18-2018 , 05:29   Re: [Reqeust] Kill player only use kinfe
Reply With Quote #2

Try this, wont work grenades too;

Code:
#include <amxmodx>
#include <hamsandwich>

public plugin_init()
{
RegisterHam(Ham_TakeDamage, "player", "Ham_PlayerTakeDamage_Pre");
}

public Ham_PlayerTakeDamage_Pre(VictimID, InflictorID, AttackerID, Float:Damage, DamageBits)
{

if (!is_user_alive(AttackerID) || get_user_weapon(AttackerID) != CSW_KNIFE)
return HAM_SUPERCEDE;

return HAM_IGNORED;
}
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 08-18-2018 at 05:29.
Ghosted is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-18-2018 , 08:25   Re: [Reqeust] Kill player only use kinfe
Reply With Quote #3

Quote:
Originally Posted by Ghosted View Post
Try this, wont work grenades too;

Code:
#include <amxmodx>
#include <hamsandwich>

public plugin_init()
{
RegisterHam(Ham_TakeDamage, "player", "Ham_PlayerTakeDamage_Pre");
}

public Ham_PlayerTakeDamage_Pre(VictimID, InflictorID, AttackerID, Float:Damage, DamageBits)
{

if (!is_user_alive(AttackerID) || get_user_weapon(AttackerID) != CSW_KNIFE)
return HAM_SUPERCEDE;

return HAM_IGNORED;
}
For preventing also hegrenade damage ch3ck if the inflictor is equal to the attacker id.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 03:08.


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