Author Topic: Different Slots for ShootOnClick  (Read 684 times)

ShootOnClick uses slot 0 (Activate/Use/Fire) as it's firing trigger.

Well, what if I wanted to use the jump button instead? I know it's Slot 2.

So you'd think to change this:
Code: [Select]
package shootonClick_Pack
{
function armor::onTrigger(%db,%obj,%slot,%val)
{
if(%obj.getClassName()$="Player")
{
if(%slot==0)
{
if(%val)
{
if($Sim::Time<%obj.client.SOC_LastFireTime)
{
return;
}
}
%obj.SOC_Shoot(%slot,%val);
}
}
return Parent::onTrigger(%db,%obj,%slot,%val);
}
};
ActivatePackage(shootonClick_Pack);

To this:

Code: [Select]
package shootonClick_Pack
{
function armor::onTrigger(%db,%obj,%slot,%val)
{
if(%obj.getClassName()$="Player")
{
if(%slot==2)
{
if(%val)
{
if($Sim::Time<%obj.client.SOC_LastFireTime)
{
return;
}
}
%obj.SOC_Shoot(%slot,%val);
}
}
return Parent::onTrigger(%db,%obj,%slot,%val);
}
};
ActivatePackage(shootonClick_Pack);

Right?

Well I did exactly that, and it doesn't work.

If I change it back, it works fine, but with the old trigger.

Am I missing another variable or something?

Figured it out.

Apparently slots 2 and 3 don't work if you're mounted.

Is there a way around this? vehicle::onTrigger will only substitute slot 2.

Wouldn't you have to use vehicle::onTrigger?

vehicle::        in vehicle
observer::     dead, not respawned
armor::          has player

Wouldn't you have to use vehicle::onTrigger?

vehicle::onTrigger will only substitute slot 2.

I need a third trigger.