This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[L4D] Get overflowed tank hp


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 07-25-2019 , 09:32   [L4D] Get overflowed tank hp
Reply With Quote #1

Hi,

you cannot set tank hp > 65535 with:
PHP Code:
SetEntProp(entityProp_Send"m_iMaxHealth"100000);
SetEntProp(entityProp_Send"m_iHealth"100000); 
but you can do it with changing "z_tank_health" ConVar.

Now, how to retrieve actual value of hp?

PHP Code:
public void OnPluginStart()
{
    
RegAdminCmd("sm_ent",            CmdEnt,            ADMFLAG_ROOT);
}

public 
Action CmdEnt(int clientint args)
{
    if( !
client ) return Plugin_Handled;
    
int entity GetClientAimTarget(clientfalse);
    if( 
entity != -)
    {
        
int iMaxHealth GetEntProp(entityProp_Send"m_iMaxHealth");
        
int iHealth GetEntProp(entityProp_Send"m_iHealth");
        
PrintToChat(client"\x01Health: \x05%i \x01Max: \x05%i"iHealthiMaxHealth);
    }
    return 
Plugin_Handled;

returns wrong result.
Thanks.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 07-25-2019 , 10:14   Re: [L4D] Get overflowed tank hp
Reply With Quote #2

because the send prop is 16bit and can only send/set max 65535, use Prop_Data that's 32bit.
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux 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 12:28.


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