AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   something goes wrong [trace attack] (https://forums.alliedmods.net/showthread.php?t=208633)

avril-lavigne 02-15-2013 21:08

something goes wrong [trace attack]
 
I need valid code for

PHP Code:

  if(  get_tr2traceresult TR_iHitgroup ) == ( HIT_CHEST|HIT_LEFTARM|HIT_LEFTARM|HIT_STOMACH|HIT_RIGHTLEG|HIT_LEFTLEG|HIT_HEAD )) 

it doesnt work
but stupid this

PHP Code:

 if( get_tr2traceresult TR_iHitgroup ) == HIT_CHEST || get_tr2traceresult TR_iHitgroup ) == HIT_LEFTARM  || get_tr2traceresult TR_iHitgroup ) == HIT_RIGHTARM  || get_tr2traceresult TR_iHitgroup ) == HIT_STOMACH || get_tr2traceresult TR_iHitgroup ) == HIT_HEAD || get_tr2traceresult TR_iHitgroup ) == HIT_RIGHTLEG || get_tr2traceresult TR_iHitgroup ) == HIT_LEFTLEG 

works.
I need first variant working please

Sylwester 02-15-2013 22:10

Re: something goes wrong [trace attack]
 
First obviously doesn't work. Use this:
PHP Code:

if( get_tr2traceresult TR_iHitgroup ) != HIT_GENERIC 


ConnorMcLeod 02-16-2013 02:56

Re: something goes wrong [trace attack]
 
PHP Code:

const HIT_SHIELD 8
if( HIT_GENERIC get_tr2traceresult TR_iHitgroup ) < HIT_SHIELD )



avril-lavigne 02-16-2013 16:03

Re: something goes wrong [trace attack]
 
yes I forgot about shield, thanks


All times are GMT -4. The time now is 21:43.

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