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

[TF2] Medic Godmode (no weapons, except medigun)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
SilentLikeSilence
Senior Member
Join Date: Jul 2009
Plugin ID:
1121
Plugin Version:
1.0.0
Plugin Category:
Fun Stuff
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Unapprover:
    Reason for Unapproving:
    Author not updating this anymore since 3 weeks.
    Old 08-27-2009 , 05:50   [TF2] Medic Godmode (no weapons, except medigun)
    Reply With Quote #1

    Bug: I had to disable locker for every class or medic could regenerate his weapons.
    If somebody know how could i disable it just for medic, let me know. Thanks.

    Description: Medics have godmode, but they can't use their weapons, except their medigun.

    PHP Code:
    #pragma semicolon 1
     
    #include <sourcemod> 
    #include <tf2_stocks>

    public Plugin:myinfo =
    {
        
    name "[TF2] Medic Godmode",
        
    author "[FG] Silent",
        
    description "Medics have godmode but they can't use their weapons, except their medigun",
        
    version "1.0.0",
        
    url "www.finalgaming.co.uk",
    }
     
    public 
    OnPluginStart()

        
    HookEvent("player_hurt"Event_player_hurt);
        
    HookEvent("player_spawn"Event_player_spawn); 
    }

    public 
    Action:Event_player_hurt(Handle:event, const String:name[], bool:dontBroadcast)
    {  
        new 
    client GetClientOfUserId(GetEventInt(event"userid"));
        new 
    TFClassType:class = TF2_GetPlayerClass(client);
        
        if(class == 
    TFClass_Medic)
        {
             
    SetEntProp(clientProp_Send"m_iHealth"150); 
            
    SetEntProp(clientProp_Data"m_iHealth"150);
        }
        else
        {
            return;
        }
    }

    public 
    Action:Event_player_spawn(Handle:event, const String:name[], bool:dontBroadcast)
    {
        new 
    client GetClientOfUserId(GetEventInt(event"userid"));
        new 
    TFClassType:class = TF2_GetPlayerClass(client);
        new 
    weapon GetPlayerWeaponSlot(client1);
        new 
    iRegenerate = -1;

        if(class == 
    TFClass_Medic)
        {
            for(new 
    0<= 5i++)
            {
                if(
    == 1)
                {
                    continue;
                }
                
    TF2_RemoveWeaponSlot(clienti);
            }

            while((
    iRegenerate FindEntityByClassname(iRegenerate"func_regenerate")) != -1)
            {
                
    AcceptEntityInput(iRegenerate"Disable");
            }

            
    SetEntPropEnt(clientProp_Send"m_hActiveWeapon"weapon);

            
    PrintToChat(client"\x01\x04[MGM] \x01You have a godmode but you can't use your weapons, except your medigun!");
        }
        else
        {
            return;
        }


    Last edited by SilentLikeSilence; 08-27-2009 at 09:31.
    SilentLikeSilence is offline
    pheadxdll
    AlliedModders Donor
    Join Date: Jun 2008
    Old 08-27-2009 , 09:56   Re: [TF2] Medic Godmode (no weapons, except medigun)
    Reply With Quote #2

    You don't need to disable ammo cabnits on every medic spawn. You only need to do it once. Besides, you should hook the sound of the ammo cabnit opening, and then disable all medic weapons at that point.

    What you did is not godmode. If the medic gets shot in the head, they will die.

    It's a little overpowered to have invincible medics, but I won't go into that. :>
    pheadxdll is offline
    SilentLikeSilence
    Senior Member
    Join Date: Jul 2009
    Old 08-27-2009 , 10:34   Re: [TF2] Medic Godmode (no weapons, except medigun)
    Reply With Quote #3

    There's no delay so they wouldn't die i think. Or if i give them more hps it would look like buffed health. You don't get this spawn locker thing. Yea maybe it would be enough to disable it once, but medics can get back their weapons with using of spawn lockers.
    SilentLikeSilence is offline
    pheadxdll
    AlliedModders Donor
    Join Date: Jun 2008
    Old 08-27-2009 , 10:56   Re: [TF2] Medic Godmode (no weapons, except medigun)
    Reply With Quote #4

    I do get this locker thing, that's why I offered advice.

    Take a look at damizean's hat plugin. When a player activates an ammo cabnit, it reapplies the player's hat. You should use that, but remove the medics weapons, instead of hats. That's how you fix your problem.

    And yes, players will die if they get shot in the head, or receive enough damage at once to kill them. You have to use dukehacks to fix that.
    pheadxdll is offline
    Greg_Sucks
    Member
    Join Date: Jul 2009
    Old 08-27-2009 , 11:27   Re: [TF2] Medic Godmode (no weapons, except medigun)
    Reply With Quote #5

    Quote:
    Originally Posted by pheadxdll View Post
    I do get this locker thing, that's why I offered advice.

    Take a look at damizean's hat plugin. When a player activates an ammo cabnit, it reapplies the player's hat. You should use that, but remove the medics weapons, instead of hats. That's how you fix your problem.

    And yes, players will die if they get shot in the head, or receive enough damage at once to kill them. You have to use dukehacks to fix that.
    Dukehacks? Just use something like "SetEntProp(client, Prop_Data, "m_takedamage", 2, 1)" for god mode, and "SetEntProp(client, Prop_Data, "m_takedamage", 0, 1)" if you need them mortal again. It's worked fine for me in other plugins.
    Greg_Sucks is offline
    SilentLikeSilence
    Senior Member
    Join Date: Jul 2009
    Old 08-27-2009 , 12:33   Re: [TF2] Medic Godmode (no weapons, except medigun)
    Reply With Quote #6

    Thanks Greg
    SilentLikeSilence is offline
    noodleboy347
    AlliedModders Donor
    Join Date: Mar 2009
    Old 08-28-2009 , 01:13   Re: [TF2] Medic Godmode (no weapons, except medigun)
    Reply With Quote #7

    I wouldn't really use this, because you could grief with it. For example, a RED medic could stand at a door entrance and BLU could never get through.
    noodleboy347 is offline
    SilentLikeSilence
    Senior Member
    Join Date: Jul 2009
    Old 08-28-2009 , 03:52   Re: [TF2] Medic Godmode (no weapons, except medigun)
    Reply With Quote #8

    Ok, you don't need.
    SilentLikeSilence is offline
    Frus
    Senior Member
    Join Date: Aug 2009
    Old 08-28-2009 , 20:12   Re: [TF2] Medic Godmode (no weapons, except medigun)
    Reply With Quote #9

    This breaks the game in far too many ways. Without even going into detail as how it breaks the game balance, and opens up griefing in many ways.

    - On ctf maps, the medic can just waltz in and take the enemy intel and there is no way to stop it

    - On CP maps, the medic can just stand on his own cap point and make it impossible for the other team to capture it.

    - A medic could just run into sentry farms, and have every sentry shoot at him while his team effortlessly blows up the sentries.
    Frus is offline
    noodleboy347
    AlliedModders Donor
    Join Date: Mar 2009
    Old 08-29-2009 , 02:50   Re: [TF2] Medic Godmode (no weapons, except medigun)
    Reply With Quote #10

    Quote:
    Originally Posted by Frus View Post
    This breaks the game in far too many ways. Without even going into detail as how it breaks the game balance, and opens up griefing in many ways.

    - On ctf maps, the medic can just waltz in and take the enemy intel and there is no way to stop it

    - On CP maps, the medic can just stand on his own cap point and make it impossible for the other team to capture it.

    - A medic could just run into sentry farms, and have every sentry shoot at him while his team effortlessly blows up the sentries.
    This as well.
    noodleboy347 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 05:03.


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