Author Topic: OnApply?  (Read 1465 times)

Is there a function, that would do something when you apply it, like 'blah::OnApply'
it should do something?


For simpler functions it might just be blah() instead of blah::onApply().

I'm gonna take a wild guess... If you mean you want a function to happen when another one is applied, you just need to put functionname(); in the original function. Example:

Code: [Select]
function originalfunction(blaharguments)
{
       functionname();
}

Another thing, If you wanted to apply a function on damage, you could use this:

Code: [Select]
function armor::onDamage(%this, %obj)
{
        %obj.functionname();
}

Ha, I mean when you a weapon is in your hand.


How do you apply a weapon?


Equipment (Images) would be ImageName::onMount(%this,%obj,%slot)
Items (Stuff you pick up) would be ItemName::onUse(%this,%obj,%invPosition)
Going in a vehicle (Vroom vroom) would be Armor::onMount(%this,%obj,%vehicle,%node)
Switching paints or equipping the spray can (lol pink) would be servercmdUseSprayCan(%client,%num)

Remember how to properly package when needed. (example, going in vehicles and paints)

Equipment (Images) would be ImageName::onMount(%this,%obj,%slot)
Items (Stuff you pick up) would be ItemName::onUse(%this,%obj,%invPosition)
Going in a vehicle (Vroom vroom) would be Armor::onMount(%this,%obj,%vehicle,%node)
Switching paints or equipping the spray can (lol pink) would be servercmdUseSprayCan(%client,%num)

Remember how to properly package when needed. (example, going in vehicles and paints)

Its actually common practice to deduce the exact problem before crapping out random solutions on someone.

I wonder if he means that he wants to do something once you equip a weapon?

Or if he means when you wrench a brick and hit apply?

Surely he would have said "onUse" or "onEquip" or "onSelect" or something. Maybe he means the apply button in the world editor.

See, vagueness gets you nowhere.

Ha, I mean when you a weapon is in your hand.

This quote leads me to believe it has something to do with weapons.

OnEpuip is my guess of what he wants.

Thats way too obvious though. The only other time you apply a weapon is when you spawn it on a brick so I'm going for that one.