AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=109)
-   -   [TF2] Medic Godmode (no weapons, except medigun) (https://forums.alliedmods.net/showthread.php?t=101773)

SilentLikeSilence 08-27-2009 05:50

[TF2] Medic Godmode (no weapons, except medigun)
 
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;
    }



pheadxdll 08-27-2009 09:56

Re: [TF2] Medic Godmode (no weapons, except medigun)
 
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. :>

SilentLikeSilence 08-27-2009 10:34

Re: [TF2] Medic Godmode (no weapons, except medigun)
 
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.

pheadxdll 08-27-2009 10:56

Re: [TF2] Medic Godmode (no weapons, except medigun)
 
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.

Greg_Sucks 08-27-2009 11:27

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

Originally Posted by pheadxdll (Post 914408)
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.

SilentLikeSilence 08-27-2009 12:33

Re: [TF2] Medic Godmode (no weapons, except medigun)
 
Thanks Greg :)

noodleboy347 08-28-2009 01:13

Re: [TF2] Medic Godmode (no weapons, except medigun)
 
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.

SilentLikeSilence 08-28-2009 03:52

Re: [TF2] Medic Godmode (no weapons, except medigun)
 
Ok, you don't need.

Frus 08-28-2009 20:12

Re: [TF2] Medic Godmode (no weapons, except medigun)
 
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.

noodleboy347 08-29-2009 02:50

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

Originally Posted by Frus (Post 915924)
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.


All times are GMT -4. The time now is 21:59.

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