| Doc-Holiday |
07-29-2011 01:41 |
Re: This Code Not Work :(
PHP Code:
#pragma semicolon 1
#include <amxmodx> #include <cstrike> #include <hamsandwich>
#define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers )
new g_iMaxPlayers;
public plugin_init( ) { register_plugin( "No Knife Damage", "0.0.1", "SavSin" ); RegisterHam( Ham_TakeDamage, "player", "PlayerHurt"); g_iMaxPlayers = get_maxplayers(); }
public PlayerHurt(iVictim, iInflictor, iAttacker, Float:fDamage, iDmgbits) { if(!IsPlayer(iAttacker)) return HAM_IGNORED; if(cs_get_user_team(iAttacker) != CS_TEAM_CT) return HAM_IGNORED; if(cs_get_user_team(iVictim) == cs_get_user_team(iAttacker)) return HAM_IGNORED; if(get_user_weapon(iAttacker) != CSW_KNIFE) return HAM_IGNORED; SetHamParamFloat(4, 0.0); return HAM_OVERRIDE; }
Should work just fine havnt tested.
Changed the get user team so that it would only work if victim is a ct and not a teammate.
|