Raised This Month: $ Target: $400
 0% 

Possible or Impossible?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
omgdpcwtf
Member
Join Date: Apr 2011
Old 10-11-2014 , 12:45   Possible or Impossible?
Reply With Quote #1

Hi,
how make protection for 2 players during duel on deathrun? More precisely other alive players(CTs) cant kill T which has duel with choosen CT. But they can kill themselves. I didnt fin anything about this possibility. I will be grateful for every advice thanks.

Last edited by omgdpcwtf; 10-11-2014 at 12:48.
omgdpcwtf is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 10-11-2014 , 12:53   Re: Possible or Impossible?
Reply With Quote #2

Hook the Damage event in Pre and check who the attacker is. If the attacker is not part of the duel, block the damage.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
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 #3

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 #4

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 #5

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
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 10-12-2014 , 18:09   Re: Possible or Impossible?
Reply With Quote #6

when you block only takedamage, other players can still interfere by applying aimpunch, i think this can be stopped when you also block traceattack
jimaway is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 10-13-2014 , 02:37   Re: Possible or Impossible?
Reply With Quote #7

Quote:
Originally Posted by jimaway View Post
when you block only takedamage, other players can still interfere by applying aimpunch, i think this can be stopped when you also block traceattack
dass true mane
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
Reply


Thread Tools
Display Modes

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