Raised This Month: $ Target: $400
 0% 

No knife HIT


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kulers2010
Junior Member
Join Date: Oct 2011
Location: Latvia
Old 07-10-2012 , 11:39   No knife HIT
Reply With Quote #1

No hit attack 1 and 2

Quote:
public Fwd_PlayerPreThink(id)
{
static temp, weapon;
weapon = get_user_weapon(id, temp, temp);

if(weapon == CSW_KNIFE)
{
if(get_user_team(id) == 2)
{
//Code whitch not allow hit with attack1
static button;
button = pev(id, pev_button);
if(button & IN_ATTACK)
{
button = (button & ~IN_ATTACK ) | IN_ATTACK2;
set_pev(id, pev_button, button);
}
}
else
{
//Code whitch not allow hit with attack 1 or attack2
}
}
}
WRead this where i write, i dont know what need write (//Code whitch not allow hit with attack 1 or attack2)
kulers2010 is offline
Send a message via Skype™ to kulers2010
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 07-10-2012 , 12:23   Re: No knife HIT
Reply With Quote #2

Hmm look at :
Code:
/**
	 * Description:		Usually called whenever an entity takes any kind of damage.
	 *					Inflictor is the entity that caused the damage (such as a gun).
	 *					Attacker is the entity that tirggered the damage (such as the gun's owner).
	 * Forward params:	function(this, idinflictor, idattacker, Float:damage, damagebits);
	 * Return type:		Integer.
	 * Execute params:	ExecuteHam(Ham_TakeDamage, this, idinflictor, idattacker, Float:damage, damagebits);
	 */
	Ham_TakeDamage,
__________________
Pawn ? Useless
Aooka is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-11-2012 , 05:20   Re: No knife HIT
Reply With Quote #3

It would be bether to use traceAttack, I guess.
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 07-11-2012 , 10:33   Re: No knife HIT
Reply With Quote #4

Use Cmd_Start to block binds like that...
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
OnePL
BANNED
Join Date: May 2012
Location: GB
Old 07-11-2012 , 19:21   Re: No knife HIT
Reply With Quote #5

Maybe so?

PHP Code:
#include <amxmodx>
#include <fakemeta>

public plugin_init()
    
register_forward(FM_PlayerPreThink"PlayerPreThink")

public 
PlayerPreThink(id) {
    if(
is_user_connected(id) && is_user_alive(id) && get_user_weapon(id) == CSW_KNIFE && get_user_team(id) == 2)
        
set_pev(idpev_buttonpev(idpev_button) & ~IN_ATTACK && pev(idpev_button) & ~IN_ATTACK2)

    return 
FMRES_HANDLED

OnePL is offline
Send a message via ICQ to OnePL Send a message via AIM to OnePL Send a message via Yahoo to OnePL Send a message via Skype™ to OnePL
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-11-2012 , 19:30   Re: No knife HIT
Reply With Quote #6

Do you want to block the attacker from using the knife or just block the damage inflicted on the victim?
__________________
Bugsy 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 15:14.


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