AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Target glow (https://forums.alliedmods.net/showthread.php?t=87845)

TheRadiance 03-17-2009 07:37

Target glow
 
1 Attachment(s)
I used the "search" button, but couldn't find similiar plugin, sorry if plugin allready exists :)

Description:
While a player (any player) aims at another player (target), target will glow only for aimer (glow color depends on team. CT - blue, T - red), and when a player stops aiming, glow will instantly removed :).
Used AddToFullPack method.

Modules:
fakemeta

Arkshine 03-17-2009 08:12

Re: Target glow
 
You should use static because it's called quite often.

About the fade, it doesn't appear for me at all. Glow is removed instantly when stop aiming.

Also I was wondering if it's not better to get the last hit (TR_pHit ) in FM_TraceLine instead of using get_user_aiming().

beckham9224 03-17-2009 08:21

Re: Target glow
 
Quote:

Glow is removed instantly when stop aiming
Always?

TheRadiance 03-17-2009 08:32

Re: Target glow
 
Quote:

Glow is removed instantly when stop aiming

Always?
Yes.

Quote:

Also I was wondering if it's not better to get the last hit (TR_pHit ) in FM_TraceLine instead of using get_user_aiming().
Just tried FM_TraceLine, works, but not so instant like get_user_aiming(..) in function..

Nextra 03-17-2009 10:54

Re: Target glow
 
You basically issue get_user_aiming way too often because you do it on updating against every single player in the game (31 times at max) wich is not necessary if you rely on FM_TraceLine. Even if there is minor difference it should not be noticeable in most cases.

TheRadiance 03-17-2009 11:03

Re: Target glow
 
Quote:

You basically issue get_user_aiming way too often because you do it on updating against every single player in the game (31 times at max) wich is not necessary if you rely on FM_TraceLine. Even if there is minor difference it should not be noticeable in most cases.
ok, i'll change it to TraceLine. thx for suggest

tuty 03-17-2009 11:26

Re: Target glow
 
like in left 4 dead.. i had this idea a few days ago.. gg :crab:

TheRadiance 03-17-2009 11:30

Re: Target glow
 
Updated to 1.1:
- Added FM_TraceLine instead of get_user_aiming...

Nextra 03-17-2009 13:19

Re: Target glow
 
This check is now redundant since you already require the target alive in TraceLine forward:

PHP Code:

is_user_aliveent 

If you add

PHP Code:

else if( g_Glowid ] )
      
g_Glowid ] = 

at the end of TraceLine the only necessary check on AddToFullPack would be this:

PHP Code:

if ( !player || g_iGlowhost ] != ent )
      return 
FMRES_IGNORED 


Arkshine 03-17-2009 13:28

Re: Target glow
 
In TraceLine, I would do only : g_iGlow[ id ] = get_tr2( trace, TR_pHit ); ; since you (should) filter with is_user_alive() in AddToFullPack.


All times are GMT -4. The time now is 07:58.

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