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

m_iMaxHealth is NOT WORKING! ON TF2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iamf2p
Member
Join Date: Nov 2018
Old 01-03-2019 , 20:32   m_iMaxHealth is NOT WORKING! ON TF2
Reply With Quote #1

SetEntProp(client, Prop_Send, "m_iMaxHealth", 50); //NOT WORKING

HELP ME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
iamf2p is offline
Whai
Senior Member
Join Date: Jul 2018
Old 01-03-2019 , 20:51   Re: m_iMaxHealth is NOT WORKING! ON TF2
Reply With Quote #2

Can you describe more your problem please
__________________
Whai is offline
iamf2p
Member
Join Date: Nov 2018
Old 01-04-2019 , 02:30   Re: m_iMaxHealth is NOT WORKING! ON TF2
Reply With Quote #3

here

PROBLEM CODE IS HERE!


#include <sourcemod>
#include <entity>

public Plugin myinfo =
{
name = "NONE",
author = "NONE",
description = "NONE",
version = "0.0.0.0",
url = "http://www.sourcemod.net/"
}

public void OnPluginStart()
{
RegConsoleCmd("sm_notworking", callvak);
}

public Action callvak(int client, int args){

SetEntProp(client, Prop_Send, "m_iMaxHealth", 500);

return Plugin_Handled;

}

Last edited by iamf2p; 01-04-2019 at 02:36.
iamf2p is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 01-04-2019 , 03:51   Re: m_iMaxHealth is NOT WORKING! ON TF2
Reply With Quote #4

Excellent observation and implied question. Could you make your posts less painful to look at, though?

Pretty sure m_iMaxHealth gets overwritten in multiple places (like CTFPlayer::GetMaxHealth()), so you'll need to DHook those.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)

Last edited by nosoop; 01-04-2019 at 03:57.
nosoop is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 01-04-2019 , 03:59   Re: m_iMaxHealth is NOT WORKING! ON TF2
Reply With Quote #5

SDKHooks has a SDKHook_GetMaxHealth for this use.
__________________
asherkin is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 01-04-2019 , 06:47   Re: m_iMaxHealth is NOT WORKING! ON TF2
Reply With Quote #6

Change Prop_Send to Prop_Data

PHP Code:
SetEntProp(clientProp_Data"m_iMaxHealth"500); 
__________________
Ilusion9 is offline
Whai
Senior Member
Join Date: Jul 2018
Old 01-04-2019 , 06:57   Re: m_iMaxHealth is NOT WORKING! ON TF2
Reply With Quote #7

I think it’s TF2 itself the problem, because when I see your code, I understand the game will set the value into OVERHEAL and not into MAXHEALTH I tested long ago. Try with tf2attributes of FlamingSarge
__________________
Whai is offline
XiLuo
Member
Join Date: Mar 2018
Old 01-04-2019 , 20:52   Re: m_iMaxHealth is NOT WORKING! ON TF2
Reply With Quote #8

try this
PHP Code:
SetEntData(clientFindDataMapOffs(client"m_iMaxHealth"), 10004true);//set max health 1000
SetEntData(clientFindDataMapOffs(client"m_iHealth"), 10004true);//set now health 1000 
XiLuo 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 07:36.


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