Jump to content
anfo

[SOLVED] Addaction run once

Recommended Posts

Hi

 

Just wondering if anything can be configured in an Addaction statement to prevent it from being used more then once?

 

Thanks!

Share this post


Link to post
Share on other sites
1 minute ago, anfo said:

Hi

 

Just wondering if anything can be configured in an Addaction statement to prevent it from being used more then once?

 

Thanks!

Inside the addAction:

_this#0 removeAction _this#2

Cheers

  • Like 3

Share this post


Link to post
Share on other sites

Within a SQF itself I found this to work.

Objectvariablename  removeAction 0;

Share this post


Link to post
Share on other sites
2 minutes ago, major-stiffy said:

Within a SQF itself I found this to work.

Objectvariablename  removeAction 0;

With multiple actions on the same object this could lead to unwanted removal of actions added by other scripts/addOns.

 

Cheers

  • Like 2

Share this post


Link to post
Share on other sites

Thanks Grumpy

Just having issues knowing where in the Addaction syntax your suggestion would reside:

 

object addAction [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, selection, memoryPoint]

maybe an argument?

Share this post


Link to post
Share on other sites
3 minutes ago, anfo said:

Thanks Grumpy

Just having issues knowing where in the Addaction syntax your suggestion would reside:

 


object addAction [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, selection, memoryPoint]

maybe an argument?

In the script parameter.

 

Cheers

  • Like 1

Share this post


Link to post
Share on other sites
32 minutes ago, anfo said:

Thanks Grumpy

Just having issues knowing where in the Addaction syntax your suggestion would reside:

 


object addAction [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, selection, memoryPoint]

maybe an argument?

 

 param "arguments" will be "_this select 3" in executed script. Action id will be "_this select 2"
 

params ["_target", "_caller", "_actionId", "_arguments"];

 

  • Like 1

Share this post


Link to post
Share on other sites

Thanks guys, thread closed. @Grumpy Old Man pointed me in the right direction, but thanks @davidoss for following through

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×