PDA

View Full Version : [CoD4] Disable Health Regeneration



DjTranceFire
7th March 2014, 12:11
Hey there.. :)
I'm trying to disable health regeneration in my mod.
I know there is a dvar like "scr_player_healthregeneration" but setting it to "0" doesnt work.
Because of that i tried to force the health:



_health()
{
while(1)
{
health = self.health;
self.maxhealth = health;
self iprintln("Health:" + health);
wait 1;
}
}


Its working but its not the best way to do it.
If the player gets damage, he's breathing all the time and if he gets enough damage to get <1 its like a godmode.
Does someone knows a better way to disable health regeneration in cod4?

kung foo man
7th March 2014, 12:36
In CoD2 you can comment just one line out in maps/mp/gametypes/tdm.gsc as example, I don't know much about CoD4:



thread maps\mp\gametypes\_menus::init();
thread maps\mp\gametypes\_serversettings::init();
thread maps\mp\gametypes\_clientids::init();
thread maps\mp\gametypes\_teams::init();
thread maps\mp\gametypes\_weapons::init();
thread maps\mp\gametypes\_scoreboard::init();
thread maps\mp\gametypes\_killcam::init();
thread maps\mp\gametypes\_shellshock::init();
thread maps\mp\gametypes\_hud_teamscore::init();
thread maps\mp\gametypes\_deathicons::init();
thread maps\mp\gametypes\_damagefeedback::init();
//thread maps\mp\gametypes\_healthoverlay::init();
thread maps\mp\gametypes\_friendicons::init();
thread maps\mp\gametypes\_spectating::init();
thread maps\mp\gametypes\_grenadeindicators::init();

DjTranceFire
7th March 2014, 13:05
Thank you! :)
It works the exact same way in cod4 :P
I already opend the file but last time i cant find anything about it..
Now it works and if i use that way i can also use dvars in server.cfg to enable or disable it! :)
Thank you very much! :)