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

[TF2] Increase Max Health of Player?


Post New Thread Reply   
 
Thread Tools Display Modes
Marcus101RR
Veteran Member
Join Date: Aug 2009
Location: Tampa, FL
Old 03-04-2013 , 23:03   Re: [TF2] Increase Max Health of Player?
Reply With Quote #11

Quote:
Originally Posted by Oshizu View Post
Hello i'm looking for a working way for increasing client's max health in tf2. I've searched on forums but couldn't really find working way.


Help would be really great
Thanks
max health? try m_iMaxHealth netprop on the client.
__________________
Marcus101RR is offline
Send a message via AIM to Marcus101RR Send a message via Skype™ to Marcus101RR
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 03-04-2013 , 23:17   Re: [TF2] Increase Max Health of Player?
Reply With Quote #12

Quote:
Originally Posted by Marcus101RR View Post
max health? try m_iMaxHealth netprop on the client.
Quote:
Originally Posted by 11530 View Post
Does the m_iMaxHealth property not work?
Quote:
Originally Posted by ReFlexPoison View Post
Nope
__________________
Dr. McKay is offline
psychonic

BAFFLED
Join Date: May 2008
Old 03-04-2013 , 23:22   Re: [TF2] Increase Max Health of Player?
Reply With Quote #13

MaxHealth in TF2 is dynamic based on class, items, and conditions.

SDKHooks has a GetMaxHealth health that can override this (for any entity in any game, not just players in TF2).

Last edited by psychonic; 03-04-2013 at 23:23.
psychonic is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 03-05-2013 , 05:01   Re: [TF2] Increase Max Health of Player?
Reply With Quote #14

Quote:
Originally Posted by Powerlord View Post
I know FlaminSarge has been doing some work on finding the offsets of methods that allow you to add attributes directly to players and weapons (instead of giving them entirely new weapons with TF2Items); we were talking about it on Steam the other day. Unfortunately, I don't think he's released it yet.

Attributes 26 (max health additive bonus) and 125 (max health additive penalty) are used to adjust a player's max health.
I'm trying to add attribute to player using signature
CTFPlayer::AddPlayerAttribute(CEconItemAttrib ute *)
but i'm not sure what value i'm suppose to add or how it should look like
PHP Code:
#include <sourcemod>
#include <sdktools>
 
new Handle:hGameConf;
new 
Handle:hGiveAttribute;

public 
Plugin:myinfo =
{
    
name "[TF2] Attribute Add",
    
author "Oshizu",
    
description "Test",
    
version "0.1d",
    
url "none"
};
 
public 
OnPluginStart()
{

    
hGameConf LoadGameConfigFile("oshizu.attribute");
    
StartPrepSDKCall(SDKCall_Player);
    
PrepSDKCall_SetFromConf(hGameConfSDKConf_Signature"CTFPlayer::AddPlayerAttribute");
    
PrepSDKCall_AddParameter(SDKType_PlainOldDataSDKPass_Plain);
    
hGiveAttribute EndPrepSDKCall();
 
    
RegConsoleCmd("sm_maxhealth"SetMaxHealth);
}

public 
Action:SetMaxHealth(clientargs)
{
 
SDKCall(hGiveAttributeclient"26 500.0");

Gamedata
PHP Code:
"Games"
{
    
/* Team Fortress 2 */
    
"tf"
    
{
        
"Signatures"
        
{
            
"CTFPlayer::AddPlayerAttribute"
            
{
                
"library"            "server"
                "windows"            "\x55\x8B\xEC\x8B\x45\x08\x85\xC0\x74\x2A\x50\x81\xC1\x04\x0A\x00\x00"
                "linux" "@_ZN9CTFPlayer18AddPlayerAttributeEP18CEconItemAttribute"
                "mac" "@_ZN9CTFPlayer18AddPlayerAttributeEP18CEconItemAttribute"
            
}
        }
    }

Seems to crash my server. Probatly line 'SDKCall(hGiveAttribute, client, "26 500.0");' is incorrectly made.
__________________
...

Last edited by Oshizu; 03-05-2013 at 05:35.
Oshizu is offline
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 03-05-2013 , 05:33   Re: [TF2] Increase Max Health of Player?
Reply With Quote #15

Don't worry about it, oshizu. In a day or two I'm posting the stuff I use to add attributes to players and weapons.

Using that call you'd have to create CEconItemAttribute (which isn't hard...?) but you're not doing that, but there's a much easier way (ish) that lets you edit attributes on the fly as well. Sit tight, I'll post it soon.
__________________
Bread EOTL GunMettle Invasion Jungle Inferno will break everything. Don't even ask.

All plugins: Randomizer/GiveWeapon, ModelManager, etc.
Post in plugin threads with questions.
Steam is for playing games.
You will be fed to javalia otherwise.
Psyduck likes replays.

Last edited by FlaminSarge; 03-05-2013 at 05:38.
FlaminSarge is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 03-05-2013 , 05:36   Re: [TF2] Increase Max Health of Player?
Reply With Quote #16

Quote:
Originally Posted by FlaminSarge View Post
Don't worry about it, oshizu. In a day or two I'm posting the stuff I use to add attributes to players and weapons.
Thats really great
__________________
...
Oshizu is offline
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 03-05-2013 , 05:51   Re: [TF2] Increase Max Health of Player?
Reply With Quote #17

One thing, I'm not sure whether I should be releasing this as a set of functions and SDKCalls that developers would have to add into their plugins on their own, or as a plugin that offers a set of natives for devs to call. The first is more flexible and the second is 'easier to use', so... thoughts?
__________________
Bread EOTL GunMettle Invasion Jungle Inferno will break everything. Don't even ask.

All plugins: Randomizer/GiveWeapon, ModelManager, etc.
Post in plugin threads with questions.
Steam is for playing games.
You will be fed to javalia otherwise.
Psyduck likes replays.

Last edited by FlaminSarge; 03-05-2013 at 05:52.
FlaminSarge is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 03-05-2013 , 09:11   Re: [TF2] Increase Max Health of Player?
Reply With Quote #18

Quote:
Originally Posted by FlaminSarge View Post
One thing, I'm not sure whether I should be releasing this as a set of functions and SDKCalls that developers would have to add into their plugins on their own, or as a plugin that offers a set of natives for devs to call. The first is more flexible and the second is 'easier to use', so... thoughts?
I think second one is better. But that's ofcourse my opinion, some people may preffer first option.
__________________
...

Last edited by Oshizu; 03-05-2013 at 09:11.
Oshizu is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 03-05-2013 , 09:48   Re: [TF2] Increase Max Health of Player?
Reply With Quote #19

Quote:
Originally Posted by FlaminSarge View Post
One thing, I'm not sure whether I should be releasing this as a set of functions and SDKCalls that developers would have to add into their plugins on their own, or as a plugin that offers a set of natives for devs to call. The first is more flexible and the second is 'easier to use', so... thoughts?
It's really up to you. However, I'll note that having it as its own plugin may present advantages, such as making it easier to do GameData updates (if you can convince Asherkin or psychonic to allow your plugin's GameData to be in the SourceMod Updater).
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Marcus101RR
Veteran Member
Join Date: Aug 2009
Location: Tampa, FL
Old 03-05-2013 , 16:22   Re: [TF2] Increase Max Health of Player?
Reply With Quote #20

Quote:
Originally Posted by Dr. McKay View Post
Quote with Quote
Damn, should have read the posts before posting.

Quote:
Originally Posted by psychonic View Post
MaxHealth in TF2 is dynamic based on class, items, and conditions.

SDKHooks has a GetMaxHealth health that can override this (for any entity in any game, not just players in TF2).
I hate SDKHooks so much, its more complicated than the actual netProp, but the bright side is it is very effective when the signatures are correct.
__________________
Marcus101RR is offline
Send a message via AIM to Marcus101RR Send a message via Skype™ to Marcus101RR
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 20:05.


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