It wont stay.
I've been meandering around the sourcemod forums for a while and couldn't find anything, just trying to set and keep health.
This is what I have so far but I don't know a way to keep health static other then setting arrays for every health value possible, intercepting damage and applying it to keep hp values right but that's so much more work then should be neccessary.
This is my current code, it sets the max hp just fine. That stupid overheal decay thing is what's killing me. Is there anyway to disable that on a client basis?
Code:
new DragonbornHealthMedic[5]={150,156,162,168,175};//Yay class specific health bonus's
new DragonbornHealthScout[5]={125,130,135,140,145};
new DragonbornHealthHeavy[5]={300,315,330,345,360};
new DragonbornHealthDemoMan[5]={175,183,190,198,205};
new DragonbornHealthSniper[5]={125,130,135,140,145};
new DragonbornHealthSpy[5]={125,130,135,140,145};
new DragonbornHealthSoldier[5]={200,210,220,230,240};
new DragonbornHealthPyro[5]={175,183,190,198,205};
new DragonbornHealthEngineer[5]={125,130,135,140,145};
public OnWar3EventSpawn(client)
{
CreateTimer(0.1, TimerPlayerSpawn, client);
}
public Action:TimerPlayerSpawn(Handle:timer, any:client)
{
new skilllevel_health=War3_GetSkillLevel(client,thisRaceID,SKILL_DRAGONBORN);
new TFClassType:class = TF2_GetPlayerClass(client);
if (class == TFClass_Medic)
{
new medhealth=DragonbornHealthMedic[skilllevel_health];
SetEntData(client, FindDataMapOffs(client, "m_iMaxHealth"), medhealth, 4, true);
SetEntData(client, FindDataMapOffs(client, "m_iHealth"), medhealth, 4, true);
}
if (class == TFClass_Scout)
{
new medhealth=DragonbornHealthScout[skilllevel_health];
SetEntData(client, FindDataMapOffs(client, "m_iMaxHealth"), medhealth, 4, true);
SetEntData(client, FindDataMapOffs(client, "m_iHealth"), medhealth, 4, true);
}
if (class == TFClass_Heavy)
{
new medhealth=DragonbornHealthHeavy[skilllevel_health];
SetEntData(client, FindDataMapOffs(client, "m_iMaxHealth"), medhealth, 4, true);
SetEntData(client, FindDataMapOffs(client, "m_iHealth"), medhealth, 4, true);
}
if (class == TFClass_DemoMan)
{
new medhealth=DragonbornHealthDemoMan[skilllevel_health];
SetEntData(client, FindDataMapOffs(client, "m_iMaxHealth"), medhealth, 4, true);
SetEntData(client, FindDataMapOffs(client, "m_iHealth"), medhealth, 4, true);
}
if (class == TFClass_Sniper)
{
new medhealth=DragonbornHealthSniper[skilllevel_health];
SetEntData(client, FindDataMapOffs(client, "m_iMaxHealth"), medhealth, 4, true);
SetEntData(client, FindDataMapOffs(client, "m_iHealth"), medhealth, 4, true);
}
if (class == TFClass_Spy)
{
new medhealth=DragonbornHealthSpy[skilllevel_health];
SetEntData(client, FindDataMapOffs(client, "m_iMaxHealth"), medhealth, 4, true);
SetEntData(client, FindDataMapOffs(client, "m_iHealth"), medhealth, 4, true);
}
if (class == TFClass_Soldier)
{
new medhealth=DragonbornHealthSoldier[skilllevel_health];
SetEntData(client, FindDataMapOffs(client, "m_iMaxHealth"), medhealth, 4, true);
SetEntData(client, FindDataMapOffs(client, "m_iHealth"), medhealth, 4, true);
}
if (class == TFClass_Pyro)
{
new medhealth=DragonbornHealthPyro[skilllevel_health];
SetEntData(client, FindDataMapOffs(client, "m_iMaxHealth"), medhealth, 4, true);
SetEntData(client, FindDataMapOffs(client, "m_iHealth"), medhealth, 4, true);
}
if (class == TFClass_Engineer)
{
new medhealth=DragonbornHealthEngineer[skilllevel_health];
SetEntData(client, FindDataMapOffs(client, "m_iMaxHealth"), medhealth, 4, true);
SetEntData(client, FindDataMapOffs(client, "m_iHealth"), medhealth, 4, true);
}
}







Logged


DarkEnergy