package overwritecrap2
{
function HorseArmor::onAdd(%this,%obj)
{
// Vehicle timeout
%obj.mountVehicle = true;
// Default dynamic armor stats
%obj.setRepairRate(0);
}
//called when the driver of a player-vehicle is unmounted
function HorseArmor::onDriverLeave(%obj, %player)
{
%obj.Mounted = 0;
}
function armor::onMount(%this,%obj,%col,%slot)
{
Parent::onMount(%this,%obj,%col,%slot);
if(%col.getDataBlock() == HorseArmor.getId())
{
%col.Mounted = 1;
}
}
function armor::onCollision(%this, %obj, %col, %fade, %pos, %normal)
{
parent::onCollision(%this, %obj, %col, %fade, %pos, %normal);
if(%obj.dataBlock.getName() $= "HorseArmor" && %obj.getState() !$= "Dead")
{
if(%this.Mounted = 1)
{
if(%col.getType() & $Typemasks::PlayerObjectType)
{
if(%col.getState() $= "Dead")
{
return;
}
else
{
tumble(%col, 7000);
}
}
}
}
}
};
activatePackage(overwritecrap2);
It isn't checking if the player is mounted. I want it so if the horse has no driver, it won't tumble people. Once the horse has a driver, it can tumble people it rams in to.