AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [TF2] Sentry Immunity (https://forums.alliedmods.net/showthread.php?t=151433)

Tylerst 02-23-2011 23:19

[TF2] Sentry Immunity
 
1 Attachment(s)
Sentry Immunity

Fairly simple plugin that I was suprised didn't exist already(or at least I couldn't find one).

Allows you to set a target(s) to be invisible to sentry targetting(You can still be manually hit with the wrangler, obviously).

Commands:
sm_sentryimmunity <target> <0/1> -Slay Flag

Examples:
sm_sentryimmunity Thetarget 1 - give Thetarget immunity
sm_sentryimmunity @me 1 - give yourself immunity
sm_sentryimmunity @humans 1 - give humans immunity
sm_sentryimmunity @bots 1 - give bots immunity
sm_sentryimmunity @red 1 - give red team immunity
sm_sentryimmunity @blue 1 - give blue team immunity
sm_sentryimmunity @all 1 - give everyone immunity
sm_sentryimmunity @!me 0 - remove immunity for everyone but yourself

CVARs:
sm_sentryimmunity_version "1.1.1"
sm_sentryimmunity_chat "1" - Enable/Disable(1/0) Showing Sentry Immunity changes in chat
sm_sentryimmunity_log "1"- Enable/Disable(1/0) Logging of Sentry Immunity changes
sm_sentryimmunity_all "0" - Enable/Disable(1/0) Sentry Immunity for everyone

Changelog:
Code:

Version 1.0.0 - February 23, 2011
* Initial release.
Version 1.0.1 - February 24, 2011
* Small coding change.
Version 1.1.0 - April 17, 2001
* Coding change to make use of new SetEntityFlags function.
Version 1.1.1 - April 25, 2001
* By request, added a cvar to allow immunity for everyone at all times


FunkyLoveCow 02-23-2011 23:59

Re: [TF2] Sentry Immunity
 
HA! Awesome. I was just working on something like this today. I'll give it a test this weekend.

Leonardo 02-24-2011 01:53

Re: [TF2] Sentry Immunity
 
amazing! it works just great!

Tylerst 02-24-2011 03:09

Re: [TF2] Sentry Immunity
 
Funny story, I actually created this with making people invisible to bots in mind, but apparently the notarget flag doesn't affect the tf bots.

So far only using the nb_blind 1 cvar makes bots unable to see people, but of course thats everyone, not specific targets. Meh, back to square one on that end.

Well , got this much usage out of it anyway, so it wasn't a waste of effort. :lol:

Cookies.net 02-24-2011 04:04

Re: [TF2] Sentry Immunity
 
Looks cool so i decided to look at the source, and what i notice is this

PHP Code:

new flags GetEntityFlags(target_list[i])+(1<<16);
new 
flags GetEntityFlags(target_list[i])-(1<<16); 

im pretty sure that isn't a good way of dealing with it (+-)

i think this is what you should be using
PHP Code:

new flags GetEntityFlags(target_list[i])|(1<<16); // | instead of +
new flags GetEntityFlags(target_list[i])&~(1<<16); // &~ instead of - 


Tylerst 02-24-2011 12:28

Re: [TF2] Sentry Immunity
 
Quote:

Originally Posted by Cookies.net (Post 1422556)
Looks cool so i decided to look at the source, and what i notice is this

PHP Code:

new flags GetEntityFlags(target_list[i])+(1<<16);
new 
flags GetEntityFlags(target_list[i])-(1<<16); 

im pretty sure that isn't a good way of dealing with it (+-)

i think this is what you should be using
PHP Code:

new flags GetEntityFlags(target_list[i])|(1<<16); // | instead of +
new flags GetEntityFlags(target_list[i])&~(1<<16); // &~ instead of - 



A fair suggestion, but out of curiousity, why does it matter?

Also, if I do use bitwise operators, shouldn't I use ^ instead of &~ ?

Just curious, If +- are going to cause a problem I'll change it but I'd like to know why it's a problem xD

dirtyminuth 02-24-2011 13:59

Re: [TF2] Sentry Immunity
 
I'm a little surprised. My understanding was that this feature was not this easily implemented (e.g. setting a single entity flag). The only other implementation I've seen was to spawn an invisible, non-solid pillar prop around a player, which is clearly more complex. Does this affect other aspects of TF2 gameplay?

Finally, is there a name / constant associated with bit (1 << 16) of m_fFlags?

psychonic 02-24-2011 14:17

Re: [TF2] Sentry Immunity
 
Quote:

Originally Posted by dirtyminuth (Post 1422954)
I'm a little surprised. My understanding was that this feature was not this easily implemented (e.g. setting a single entity flag). The only other implementation I've seen was to spawn an invisible, non-solid pillar prop around a player, which is clearly more complex. Does this affect other aspects of TF2 gameplay?

Finally, is there a name / constant associated with bit (1 << 16) of m_fFlags?

I blew that mystery open a week ago https://forums.alliedmods.net/showpo...5&postcount=33 :3

(1<<16) is the FL_NOTARGET flag, just many of the flags shifted in ep2v.

Leonardo 02-24-2011 15:12

Re: [TF2] Sentry Immunity
 
PHP Code:

#define    FL_NOTARGET            (1 << 15)
#define    FL_AIMTARGET            (1 << 16)    // set if the crosshair needs to aim onto the entity 

hmm
and should use FL_NOTARGET anyway..?

psychonic 02-24-2011 15:21

Re: [TF2] Sentry Immunity
 
Quote:

Originally Posted by Leonardo (Post 1423019)
PHP Code:

#define    FL_NOTARGET            (1 << 15)
#define    FL_AIMTARGET            (1 << 16)    // set if the crosshair needs to aim onto the entity 

hmm
and should use FL_NOTARGET anyway..?

The define in entity_prop_stocks is correct for all engines except Source 2009 (CSS/TF2/DODS/GMOD).

For 2009/ep2v/orangeboxvalve, you either need to hardcode it as (1<<16) or undefine and redefine it in your code.


All times are GMT -4. The time now is 01:08.

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