Raised This Month: $ Target: $400
 0% 

Change the damage of the knife


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 12-24-2008 , 04:43   Re: Change the damage of the knife
Reply With Quote #2

Code:
#include <amxmodx>
#include <hamsandwich>
 
new g_iMaxPlayers;
 
public plugin_init(){
 
RegisterHam(Ham_TakeDamage, "player", "Function");
 
g_iMaxPlayers = get_maxplayers();
}
 
public Function(id, inflictor, attacker, Float:damage, damagebits){
 
  if ( !(1 <= attacker <= g_iMaxPlayers) || !(1 <= id <= g_iMaxPlayers) || !is_user_alive(id) )
      return HAM_IGNORED;
 
  new weapon = get_user_weapon(attacker, _, _);
 
  if (weapon == CSW_KNIFE )
  {
      SetHamParamFloat(4, damage * 2); //Here knife does double damage, ofc you can set it to 0.0 or anything.
      return HAM_HANDLED;
  }
 
  return HAM_IGNORED;
}
Edit: Original isn't mine.
SnoW is offline
Send a message via MSN to SnoW
 



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 09:17.


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