Jump to content
Sign in to follow this  
Joe Miller

Need help with addaction

Recommended Posts

Hello i've a problem with addaction.

Example: This Addaction ["Sell him Drugs", "isdrugged.sqs"]

This is what i tiped, but i need to call some variables of isdrugged.sqs

So i need theese variables:

_Unit = _this select 0

_drug = _this select 1

_DA= this select 2

So when i call "isdrugged.sqs" i need for example: [this,weed,da1] exec "isdrugged.sqs" but i need to call it with an action. So how can i do?

Share this post


Link to post
Share on other sites

Try:

This Addaction ["Sell him Drugs", "[this,weed,da1] exec isdrugged.sqs"]

I've tested it and I received a missing script message, so I think the sintax is right.

Klavan

EDIT

Never mind it it's wrong. Sorry. whistle.gif

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">This Addaction ["Sell him Drugs", "isdrugged.sqs"]

is correct

You cannot send any other parameters to an action script (AFAIK).

The only ones available are:

_this select 0: object action is attached to

_this select 1: object that executed the action

_this select 2: index of action

Share this post


Link to post
Share on other sites

Well do this :

This Addaction ["Sell him Drugs", "drugact.sqs"]

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

;drugact.sqs

(_this select 0) removeaction (_this select 2)

[_this select 1,weed,da1] exec "isdrugged.sqs"

exit

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
Sign in to follow this  

×