Welsh Mullet wrote:Right, heres the code.
Edits are made to sdk_shareddefs.h, sdk_gamerules.cpp, sdk_playerclass_info_parse.cpp (and .h) and sdk_player_shared.h
WARNING!!!
My bots are now bugged, but i'm not sure if it was this code edit that did it. This was written on a late night coding stint and is not fully tested, but does seem to do exactly what you wanted to do.
sdk_player_shared.h: Add
- Code: Select all
int m_iHealth;
int m_iMaxHealth;
at around line 128, just after some stuff about sprinting.
sdk_gamerules.cpp: Add
- Code: Select all
pPlayer->SetHealth(pClassInfo.m_iHealth);
pPlayer->SetMaxHealth(pClassInfo.m_iMaxHealth);
at about line 705, just after the players armour is also set in a similar way.
sdk_shareddefs.h: Add
- Code: Select all
#define SDK_DEFAULT_PLAYER_HEALTH 100
#define SDK_DEFAULT_PLAYER_MAXHEALTH 100
at line 138, around where the default runspeeds are declaired as well.
sdk_playerclass_info_parse.cpp: Add
- Code: Select all
m_iHealth = pKeyValuesData->GetInt( "health", 0);
m_iMaxHealth = pKeyValuesData->GetInt( "maxhealth", 0);
at line 136, just after m_iArmor.
sdk_playerclass_info_parse.h: Add
- Code: Select all
int m_iHealth;
int m_iMaxHealth;
at line 50 ish, also after m_iArmor.
Now you need to add the lines
"health" and "maxhealth" to your class scripts (These work the same as armour)
Just let me know of any problems, and i can try and sort them out.
Oo thanks alot man!
Maybe you would like to help out with our mod? So far theres 3 on the team. Me (3d modelling, textures, a bit mapping, a bit programming ++)
ThePeanutBaron (mapping, textures, logos ++)
ChaoZ (mapping, textures)
I barely know how to use C++, so we really need a programmer. We might have some content to show you later this week.
If you are intrested add me on steam: Osteper94


