Raised This Month: $ Target: $400
 0% 

Possible or Impossible?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-11-2014 , 13:24   Re: Possible or Impossible?
Reply With Quote #1

Quote:
Originally Posted by YamiKaitou View Post
Hook the Damage event in Pre and check who the attacker is. If the attacker is not part of the duel, block the damage.
In deep:
1. Hook Ham_TakeDamage as pre.
2. Check if the damage comes from other players, a bool like in_duel[33] or by backuping players ids( the ones that are dueling )
3. Return HAM_SUPERCEDE to block the function.
__________________
HamletEagle is offline
omgdpcwtf
Member
Join Date: Apr 2011
Old 10-12-2014 , 05:19   Re: Possible or Impossible?
Reply With Quote #2

Got it, CTs cant kill T during duel but T can kill other CTs. How to solve it?

CT_Player = id
T_Player = T

Code:
public player_attack(victim, attacker, Float:damage, Float:direction[3], tracehandle, damagebits)
{
	if(!is_user_connected(victim) || !is_user_connected(attacker) || victim == attacker)
		return HAM_IGNORED
		
	if( (CT_Player != attacker ) && ( T_Player != attacker ) )
	{
		if( ( CT_Player == victim ) || ( T_Player == victim ) )
		return HAM_SUPERCEDE;
	}
	return HAM_IGNORED
}
omgdpcwtf is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-13-2014 , 17:15   Re: Possible or Impossible?
Reply With Quote #3

PHP Code:
New bool:inDuel[33]
// add this to plugin init
RegisterHam(Ham_TakeDamage"player"player_damage1)

public 
player_damage(victimattackerFloat:damageFloat:direction[3], tracehandledamagebits)
{
 if(!
is_user_connected(victim) || !is_user_connected(attacker) || victim == attacker)
          return 
HAM_IGNORED
 
if(!inDuel[attacker] || !inDuel[victim])
          return 
HAM_SUPERCED    
 
return HAM_IGNORED


Last edited by Natsheh; 10-14-2014 at 09:01.
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 17:30.


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