Raised This Month: $ Target: $400
 0% 

[....]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Erdener
Senior Member
Join Date: Apr 2010
Location: Turkey
Old 07-29-2011 , 01:31   [....]
Reply With Quote #1

[....]
__________________

Last edited by Erdener; 07-29-2013 at 07:34.
Erdener is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 07-29-2011 , 01:41   Re: This Code Not Work :(
Reply With Quote #2

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" );
    
    
RegisterHamHam_TakeDamage"player""PlayerHurt");
    
    
g_iMaxPlayers get_maxplayers();
}

public 
PlayerHurt(iVictimiInflictoriAttackerFloat:fDamageiDmgbits)
{
    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(40.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.

Last edited by Doc-Holiday; 07-30-2011 at 01:10.
Doc-Holiday 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 19:37.


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