ItsMods

Full Version: Disable fall damage
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys i need a little help,
how i can give to a player dead silence pro?
Someone suggest me give specialty_falldamage but this doesnt work!
specialty_falldamage is a script perk.

I suggest you check in OnPlayerDamaged for MOD MOD_FALLING and ClientNum/XUID and then set damage to 0.
Thanks, i will try later Smile
public override void OnPlayerDamage(Entity player, Entity inflictor, Entity attacker, int damage, int dFlags, string mod, string weapon, Vector3 point, Vector3 dir, string hitLoc)
{
if (mod == "MOD_FALLING")
{
player.Call("iprintlnbold", "^2DAMAGE " + damage);
damage = 0;
}
}

What`s wrong?
InfinityScript does not have any return value, so you can not just set damage to 0 there.

Try this:
CSHARP Code
  1. public override void OnPlayerDamage(Entity player, Entity inflictor, Entity attacker, int damage, int dFlags, string mod, string weapon, Vector3 point, Vector3 dir, string hitLoc)
  2. {
  3. if (mod == "MOD_FALLING")
  4. {
  5. player.Call("iprintlnbold", "^2DAMAGE " + damage);
  6. player.Health += damage;
  7. }
  8. }
Oh you`re right it void, thank you for your help!