Author Topic: OnDriverMount function?  (Read 800 times)

Is there a onDriverMount function for vehicles?

Because I need to have some of my upcoming vehicles play an animation or sound when the driver mounts.

Code: [Select]
package GSFnoMount
{
    function WheeledVehicleData::onCollision(%this, %obj, %col, %vec, %vecLen)
    {
if(%col.client.GSFmount == 1 || %obj.dataBlock !$= "carriervehicle")
    Parent::onCollision(%this, %obj, %col, %vec, %vecLen);
   
    }
};

function servercmdnomount(%client)
{

    if(%client.GSFmount)
    {
%client.GSFmount = 0;
%status = "un";
    }

    else
%client.GSFmount = 1;

    messageClient(%client, '', "You are now "@ %status @"able to mount to aircraft carriers");
}

activatePackage(GSFnoMount);
The way I did was blocking the collision function. This may not be reliable beacuse it doesn't care for trust tests.

Try Armor::onMount


Well, it didn't seem to work.
But it could be something else.
Here's the code:

Code: [Select]
//called when the driver of a player-vehicle is mounted
function RideArmor::onMount(%obj, %player)
{
%obj.playthread(2, armReadyRight);
}

//called when the driver of a player-vehicle is unmounted
function RideArmor::onDriverLeave(%obj, %player)
{
%obj.playthread(2, root);
}



Isn't Obj the ride armour

and player the, well of crouse, player.

However, if you are wanted the ride armour to put up his arm, did you load the .dsq in the shape area?

Isn't Obj the ride armour

and player the, well of crouse, player.

However, if you are wanted the ride armour to put up his arm, did you load the .dsq in the shape area?

yes, it's loaded, although I haven't checked if it plays if the player is the player.. :P never mind.



But I have to be the ride armor.
It still won't play if I just hop in one. D:

Also, what's the 2 that comes before the animation for?
Code: [Select]
{
%obj.playthread(2, armReadyRight);
}


Edit2: Is there a onArmorDeath function?
« Last Edit: February 09, 2010, 09:41:41 PM by ArmyUnit »


I still need help with this.

Also, what's the 2 that comes before the animation for?
Code: [Select]
{
%obj.playthread(2, armReadyRight);
}


Edit2: Is there a onArmorDeath function?
The number is the slot. That argument is backwards, it's animaton name and then slot. There are 4 slots (0,1,2,3) that allow you to layer multiple animations.

armor::onDisabled(%data, %obj)

Thank you, I'll try that.

Isn't it possible to just specify a thread to play in the player type?