Quote:
Originally Posted by johan123jo
This should work:
PHP Code:
#include <sourcemod> #include <sdktools> #include <sdkhooks>
new old_health[MAXPLAYERS+1];
public OnClientPutInServer(client) { SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage); }
public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype) { if (!attacker || attacker > MaxClients) return Plugin_Continue;
if(attacker == victim) { old_health[attacker] = GetClientHealth(attacker); CreateTimer(0.00001, health, attacker) } return Plugin_Continue; }
public Action:health(Handle:timer, any:attacker) { SetEntProp(attacker, Prop_Send, "m_iHealth", old_health[attacker]); return Plugin_Stop; }
Tried other things, but something happens when you jump and then shoot down? Don't know, but this should work ;)
|
That will give you the health you had prior to damaging yourself, but you can still die, correct?
any way to make it work that you don't take damage at all but can still rocketjump?
i tried playing around with:
sm_cvar tf_damageforcescale_self_soldier_rj
sm_cvar tf_damagescale_self_soldier
which does the job for actual rocketjumping, but you can still damage yourself when you're not airborne.
Is there really no way to achive the complete removal of selfdamage?