Author Topic: AiPlayer::OnDamage  (Read 1422 times)

There isn't and AiPlayer::OnDamage so is there a way to get the client attacking the bot some way else?

Code: [Select]
package NoBotDamage
{
function ProjectileData::damage(%this,%obj,%col,%fade,%pos,%normal)
{
  if(%obj.client.player.getClassName() $= "Player") && %col.getclassname() $= "AIPlayer"){return;}
  Parent::damage(%this,%obj,%col,%fade,%pos,%normal);
}
};

^^ Players firing weapons cannot hurt AIPlayers. Two things:

This would mess up the Bot War mod.

%obj.client.player is needed - %obj is the bullet, not the firer.

Thank you, I can do what I want with that.

Does damage only get called when the bot is actually damaged?
« Last Edit: October 25, 2007, 07:04:41 AM by MrPickle »



Code: [Select]
package NoBotDamage
{
function ProjectileData::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
  if(%obj.client.player.getClassName() $= "Player") && %col.getclassname() $= "AIPlayer"){return;}
  Parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);
}
};

Now it's whenever a projectile hits the bot.