Okay... So like this?
function Armor::onTrigger(%this,%obj,%slot,%val)
{
Parent::onTrigger(%this,%obj,%slot,%val);
if(%slot == 4)
{
if(%val == 1)
{
%obj.mountImage(JetpackFire,1);
}
if(%val == 0)
{
%obj.unMountImage(%slot);
}
}
}
Put together from a snippet of code Port posted in Steam chat:
function yourPlayerTypeName::onTrigger( %this, %obj, %slot, %val )
{
parent::onTrigger( %this, %obj, %slot, %val );
if ( %slot == 2 )
{
%col.setImageAmmo( yourImageName.mountPoint, %val );
}
}
And the Stuntplane contrail script:
function contrailCheck(%obj)
{
if(!isObject(%obj))
return;
...
if(%obj.getMountedImage(3) $= 0)
{
%obj.mountImage(contrailImage1,2);
%obj.mountImage(contrailImage2,3);
}
...
schedule(2000,0,"contrailCheck",%obj);
}
How did I do? Does this function run every time a client presses the jet key using any playertype? How do I check if some image is mounted to $BackSlot?