Raised This Month: $51 Target: $400
 12% 

[TF2] Medic's Anti-Projectile Shield v1.1 (Updater Support!)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
404UserNotFound
BANNED
Join Date: Dec 2011
Plugin ID:
4198
Plugin Version:
1.1
Plugin Category:
Fun Stuff
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Old 05-15-2014 , 19:23   [TF2] Medic's Anti-Projectile Shield v1.1 (Updater Support!)
    Reply With Quote #1

    Use this version from now on, it's actually maintained!
    Attached Files
    File Type: sp Get Plugin or Get Source (TF2_MedicMvMShield.sp - 625 views - 4.9 KB)
    File Type: smx TF2_MedicMvMShield.smx (6.2 KB, 699 views)

    Last edited by 404UserNotFound; 11-20-2014 at 19:46.
    404UserNotFound is offline
    Mitchell
    ~lick~
    Join Date: Mar 2010
    Old 05-16-2014 , 01:42   Re: [TF2] Medic's Anti-Projectile Shield v1.0
    Reply With Quote #2

    add more fire.

    also you should add cvars so we dont have to re-compile the plugin.

    Last edited by Mitchell; 05-16-2014 at 01:44.
    Mitchell is offline
    404UserNotFound
    BANNED
    Join Date: Dec 2011
    Old 05-16-2014 , 02:07   Re: [TF2] Medic's Anti-Projectile Shield v1.0
    Reply With Quote #3

    Quote:
    Originally Posted by Mitchell View Post
    add more fire.

    also you should add cvars so we dont have to re-compile the plugin.
    Fire? Whaddya mean? Also,

    Quote:
    also you should add cvars so we dont have to re-compile the plugin.
    Quote:
    To Do
    • Add a convar so you can change how long the wait time is between spawning shields.
    404UserNotFound is offline
    rswallen
    SourceMod Donor
    Join Date: Jun 2013
    Location: 127.0.0.1
    Old 05-16-2014 , 02:31   Re: [TF2] Medic's Anti-Projectile Shield v1.0
    Reply With Quote #4

    Quote:
    Originally Posted by abrandnewday View Post
    If you die during the shield's 10 second lifetime, if the server has any amount of respawn time, you can control the shield while waiting to respawn and it will continue to damage any who touch it until its 10 second lifetime is up. I'm too dumb to figure out how to target an entity spawned by a specific player and kill it without killing every other instance of that entity. halp me plz
    Cache the entity reference of the shield when you create it.
    When the player dies, check if its still a valid entity, and kill it if it is

    PHP Code:
    new g_entCurrentShield[MAXPLAYERS+1] = { INVALID_ENT_REFERENCE, ... }

    EventHook_OnPlayerDeath(Handle:event, const String:name[], bool:dontbroadcast)
    {
        new 
    client GetClientOfUserId(GetEventInt(event"userid"));
        if (
    client != 0)
        {
            if (
    IsValidEntity(g_entCurrentShield[client]))
            {
                
    AcceptEntityInput(g_entCurrentShield[client], "Kill");
                
    g_entCurrentShield[client] = INVALID_ENT_REFERENCE;
            }
        }
    }

    //[OnShieldCreated]
    {
        new 
    shield CreateEntityByName("entity_medigun_shield");
        if(
    shield != -1)
        {
            
    g_entCurrentShield[client] = EntIndexToEntRef(shield);
            
    // do other stuff
        
    }


    Last edited by rswallen; 05-16-2014 at 03:07. Reason: fixed example :S
    rswallen is offline
    404UserNotFound
    BANNED
    Join Date: Dec 2011
    Old 05-16-2014 , 02:43   Re: [TF2] Medic's Anti-Projectile Shield v1.0
    Reply With Quote #5

    Quote:
    Originally Posted by rswallen View Post
    Cache the entity reference of the shield when you create it.
    When the player dies, check if its still a valid entity, and kill it if it is

    PHP Code:
    new g_entCurrentShield[MAXPLAYERS+1] = { INVALID_ENT_REFERENCE, ... }

    EventHook_OnPlayerDeath(Handle:event, const String:name[], bool:dontbroadcast)
    {
        new 
    client GetClientOfUserId(GetEventInt(event"userid));
        if ((client != 0) && IsClientInGame(client))
        {
            if (IsValidEntity(g_entCurrentShield[client]))
            {
                AcceptEntityInput(g_entCurrentShield[client], "
    Kill");
                g_entCurrentShield[client] = INVALID_ENT_REFERENCE;
            }
        }
    }

    -[OnShieldCreated]-
    {
        new shield = CreateEntityByName("
    entity_medigun_shield");
        if(shield != -1)
        {
            g_entCurrentShield[client] = EntIndexToEntRef(shield);
            // do other stuff
        }

    I'd give you a blowjob if that was socially acceptable behaviour and not gay in the slightest.
    404UserNotFound is offline
    rswallen
    SourceMod Donor
    Join Date: Jun 2013
    Location: 127.0.0.1
    Old 05-16-2014 , 03:21   Re: [TF2] Medic's Anti-Projectile Shield v1.0
    Reply With Quote #6

    First priority should deffo be restricting the shield based on the active weapon
    It seems that holding the ubersaw while damaging someone with the shield has...unforeseen cosequences...
    rswallen is offline
    404UserNotFound
    BANNED
    Join Date: Dec 2011
    Old 05-16-2014 , 03:33   Re: [TF2] Medic's Anti-Projectile Shield v1.0
    Reply With Quote #7

    Quote:
    Originally Posted by rswallen View Post
    First priority should deffo be restricting the shield based on the active weapon
    It seems that holding the ubersaw while damaging someone with the shield has...unforeseen cosequences...
    O_O Like what.....
    404UserNotFound is offline
    rswallen
    SourceMod Donor
    Join Date: Jun 2013
    Location: 127.0.0.1
    Old 05-16-2014 , 03:39   Re: [TF2] Medic's Anti-Projectile Shield v1.0
    Reply With Quote #8

    As you know, the ubersaw grants 25% ubercharge whenever it deals damage.
    This behaviour seems to be replicated by the shield if the ubersaw is being held (AKA instant ubercharge)
    rswallen is offline
    404UserNotFound
    BANNED
    Join Date: Dec 2011
    Old 05-16-2014 , 03:45   Re: [TF2] Medic's Anti-Projectile Shield v1.0
    Reply With Quote #9

    Quote:
    Originally Posted by rswallen View Post
    As you know, the ubersaw grants 25% ubercharge whenever it deals damage.
    This behaviour seems to be replicated by the shield if the ubersaw is being held (AKA instant ubercharge)
    Oh boy. That I did not expect. Any potential issues then with any of the other mediguns? I can't remember if any of the other Mediguns have any "on deal damage" related attributes.

    I do have to leave for work now, but I'll try to get as much work on this done as I can when I get home.

    Last edited by 404UserNotFound; 05-16-2014 at 03:45.
    404UserNotFound is offline
    Pelipoika
    Veteran Member
    Join Date: May 2012
    Location: Inside
    Old 05-16-2014 , 04:56   Re: [TF2] Medic's Anti-Projectile Shield v1.0
    Reply With Quote #10



    Here's an updated one (?Better?) one:

    Requires 75% uber and activates when you press reload.
    Attached Files
    File Type: sp Get Plugin or Get Source (shield.sp - 340 views - 3.9 KB)
    __________________

    Last edited by Pelipoika; 05-16-2014 at 05:56.
    Pelipoika is offline
    Reply



    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 03:05.


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