I need the function for when a player takes damage. Specifically IF the player is mounted to %newcar. Here's the code I want to add it to:
function Player::startSkiJumping(%obj)
{
//make a new ski vehicle and mount the player on it
%client = %obj.client;
%position = %obj.getTransform();
%posX = getword(%position, 0);
%posY = getword(%position, 1);
%posZ = getword(%position, 2);
%rot = getWords(%position, 3, 8);
%posZ += 0.3;
%vel = %obj.getVelocity();
%newcar = new WheeledVehicle()
{
dataBlock = skijumpvehicle;
client = %client;
initialPosition = %posX @ " " @ %posY @ " " @ %posZ;
};
%newcar.addVelocity(%vel);
%newcar.setTransform(%posX @ " " @ %posY @ " " @ %posZ @ " " @ %rot);
%newcar.addVelocity("0 0 0");
// %newcar.addVelocity(%obj.getRelativeVector("0 25 0"));
%newcar.schedule(250, mountObject, %obj, 0);
}
I'd like to make it so when a player is damaged, IF they are mounted to this vehicle, they tumble 0500.