Raised This Month: $202 Target: $400
 50% 

[TF2] Sentry Immunity


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Tylerst
Veteran Member
Join Date: Oct 2010
Plugin ID:
2240
Plugin Version:
1.1.1
Plugin Category:
Admin Commands
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
    30 
    Plugin Description:
    Set Sentry Immunity on a target(s)
    Old 02-23-2011 , 23:19   [TF2] Sentry Immunity
    Reply With Quote #1

    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
    Attached Files
    File Type: sp Get Plugin or Get Source (TF2 Sentry Immunity.sp - 2100 views - 4.8 KB)

    Last edited by Tylerst; 04-25-2011 at 02:57.
    Tylerst is offline
    FunkyLoveCow
    Senior Member
    Join Date: May 2010
    Old 02-23-2011 , 23:59   Re: [TF2] Sentry Immunity
    Reply With Quote #2

    HA! Awesome. I was just working on something like this today. I'll give it a test this weekend.
    FunkyLoveCow is offline
    Leonardo
    Veteran Member
    Join Date: Feb 2010
    Location: Soviet Union
    Old 02-24-2011 , 01:53   Re: [TF2] Sentry Immunity
    Reply With Quote #3

    amazing! it works just great!
    __________________
    Leonardo is offline
    Tylerst
    Veteran Member
    Join Date: Oct 2010
    Old 02-24-2011 , 03:09   Re: [TF2] Sentry Immunity
    Reply With Quote #4

    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.
    Tylerst is offline
    Cookies.net
    Senior Member
    Join Date: Jan 2011
    Old 02-24-2011 , 04:04   Re: [TF2] Sentry Immunity
    Reply With Quote #5

    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 - 
    Cookies.net is offline
    Tylerst
    Veteran Member
    Join Date: Oct 2010
    Old 02-24-2011 , 12:28   Re: [TF2] Sentry Immunity
    Reply With Quote #6

    Quote:
    Originally Posted by Cookies.net View Post
    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

    Last edited by Tylerst; 02-24-2011 at 12:30.
    Tylerst is offline
    dirtyminuth
    Senior Member
    Join Date: Sep 2009
    Old 02-24-2011 , 13:59   Re: [TF2] Sentry Immunity
    Reply With Quote #7

    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?
    __________________
    dirtyminuth is offline
    psychonic

    BAFFLED
    Join Date: May 2008
    Old 02-24-2011 , 14:17   Re: [TF2] Sentry Immunity
    Reply With Quote #8

    Quote:
    Originally Posted by dirtyminuth View Post
    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

    (1<<16) is the FL_NOTARGET flag, just many of the flags shifted in ep2v.
    psychonic is offline
    Leonardo
    Veteran Member
    Join Date: Feb 2010
    Location: Soviet Union
    Old 02-24-2011 , 15:12   Re: [TF2] Sentry Immunity
    Reply With Quote #9

    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..?
    __________________

    Last edited by Leonardo; 02-24-2011 at 15:16.
    Leonardo is offline
    psychonic

    BAFFLED
    Join Date: May 2008
    Old 02-24-2011 , 15:21   Re: [TF2] Sentry Immunity
    Reply With Quote #10

    Quote:
    Originally Posted by Leonardo View Post
    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.
    psychonic 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 15:54.


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