Raised This Month: $ Target: $400
 0% 

[Half-Life] Ham_TakeHealth but for armor chargers


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Flipper_SPb
Senior Member
Join Date: Jun 2009
Location: Worldspawn
Old 10-05-2010 , 15:25   [Half-Life] Ham_TakeHealth but for armor chargers
Reply With Quote #1

I use Ham_TakeHealth to change capacity of wall mounted healthkit (just return 2 * health )
How to do the same with HEV chargers?

I tried to use Ham_Use, but function calls much faster then armor adds to player.
Flipper_SPb is offline
Send a message via ICQ to Flipper_SPb
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-05-2010 , 16:11   Re: [Half-Life] Ham_TakeHealth but for armor chargers
Reply With Quote #2

If you use HL, you have cvars for that. sk_ something. See skill.cfg
__________________
Arkshine is offline
Flipper_SPb
Senior Member
Join Date: Jun 2009
Location: Worldspawn
Old 10-05-2010 , 16:23   Re: [Half-Life] Ham_TakeHealth but for armor chargers
Reply With Quote #3

I can change the healthkit only.

PHP Code:
sk_healthcharger1        "50"
sk_healthcharger2        "40"
sk_healthcharger3        "25" 
sk_healthcharger1 works for multiplayer

There are:

PHP Code:
sk_suitcharger1        "75"
sk_suitcharger2        "50"
sk_suitcharger3        "35" 
But it doesn't work for multiplayer. Suitcharger in HLDM has 30 armor points.

Last edited by Flipper_SPb; 10-05-2010 at 16:25.
Flipper_SPb is offline
Send a message via ICQ to Flipper_SPb
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-05-2010 , 16:36   Re: [Half-Life] Ham_TakeHealth but for armor chargers
Reply With Quote #4

Like you can see in the HLSDK-multiplayer :

healthkit : if ( pPlayer->TakeHealth( gSkillData.healthkitCapacity, DMG_GENERIC ) )
battery : m_iJuice = static_cast<int>(gSkillData.suitchargerCapaci ty);

It uses the cvars.
__________________
Arkshine is offline
Flipper_SPb
Senior Member
Join Date: Jun 2009
Location: Worldspawn
Old 10-05-2010 , 16:46   Re: [Half-Life] Ham_TakeHealth but for armor chargers
Reply With Quote #5

Unfortunately cvar that I need is hardcoded in hlsdk.

PHP Code:
void CHalfLifeMultiplay::RefreshSkillDatavoid )
{
// load all default values
 
CGameRules::RefreshSkillData();

// override some values for multiplay.

 // suitcharger
 
gSkillData.suitchargerCapacity 30
Flipper_SPb is offline
Send a message via ICQ to Flipper_SPb
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-05-2010 , 17:24   Re: [Half-Life] Ham_TakeHealth but for armor chargers
Reply With Quote #6

So, modify manually m_iJuice when the item spawn.
__________________
Arkshine is offline
Flipper_SPb
Senior Member
Join Date: Jun 2009
Location: Worldspawn
Old 10-06-2010 , 03:26   Re: [Half-Life] Ham_TakeHealth but for armor chargers
Reply With Quote #7

And how to do that?
Ham_TakeHealth better than changing sk_healthcharger1 because I can get double health for the same time.
Flipper_SPb is offline
Send a message via ICQ to Flipper_SPb
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-06-2010 , 04:58   Re: [Half-Life] Ham_TakeHealth but for armor chargers
Reply With Quote #8

m_iJuice is an offset, the value is 62 for windows.

Hook Ham_Spawn with "func_recharge" and as post, and use set_pdata_int( entity, 62, your_new_value );

Quote:
Ham_TakeHealth better than changing sk_healthcharger1 because I can get double health for the same time.
I don't understand what you are saying and I don't see the point to hook TakeHealth if the cvar work unless if the value may not the same.
__________________
Arkshine is offline
Flipper_SPb
Senior Member
Join Date: Jun 2009
Location: Worldspawn
Old 10-06-2010 , 05:48   Re: [Half-Life] Ham_TakeHealth but for armor chargers
Reply With Quote #9

Quote:
Originally Posted by Arkshine View Post
m_iJuice is an offset, the value is 62 for windows.
Ok. Thank you.




Quote:
Originally Posted by Arkshine View Post
I don't understand what you are saying and I don't see the point to hook TakeHealth if the cvar work unless if the value may not the same.
If I use TakeHealth and return (health * 2), I get HP two times faster.
Flipper_SPb is offline
Send a message via ICQ to Flipper_SPb
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-06-2010 , 05:52   Re: [Half-Life] Ham_TakeHealth but for armor chargers
Reply With Quote #10

I don't get, whatever you change gSkillData.healthkitCapacity or changing the param on the fly in TakeHealth, it's the same result...
__________________
Arkshine 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 10:19.


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