Jump to content

Recommended Posts

im tryna make an addaction to work from 2meters  and i found a script online and i connected it to my script didnt really work what have i done wrong?

 

drugdealer addAction ["Weed bale 3.5K","drugs\weedbale.sqf",[],3500];

Share this post


Link to post
Share on other sites

test must be an object.

3500] has no sense and source of error.

 

NB: The condition field (where you wrote "_this distance _target <2" can't override some engine condition for addAction.

If you apply the addaction on player (player addAction....) , then you can check any distance you want between player and... something else;

if you apply the addAction on an object, say laptop, so the caller (player who acts the addAction) must be at max 15 m (hard coded) and facing the object. So, you can't addAction on a farer object.

any distance is measured from center to center of objects.

Share this post


Link to post
Share on other sites

Well, one error I see is: I see 2x [ and 3x ]...

Share this post


Link to post
Share on other sites
31 minutes ago, Moon_chilD said:

Well, one error I see is: I see 2x [ and 3x ]...

yea i gave up

 

Share this post


Link to post
Share on other sites

Well I see you changed your script. I think the one part you need to understand is the order in the Array. 

https://community.bistudio.com/wiki/addAction

Each spot has its meaning. In the case of AddAction: [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, selection]
So what ever the "3500" is, its most likely in the wrong spot (its in the 4th for you and you want it in the 3rd I think)

To get the distance thing working you need to put it where it says condition. So in your case you might want to have something like this:
drugdealer addAction ["Weed bale 3.5K","drugs\weedbale.sqf",[3500],1.5,true,true,"","_this distance _target <2"];

Another problem might be: What is "_this" and "_target". Is it defined somewhere? If so, this should work. If not you need to define these.

Edit: Yeah, me dumb. 
drugdealer addAction ["Weed bale 3.5K","drugs\weedbale. sqf ",[3500],1.5,true,true,"","",2];

I knew there already was a distance thing in the AddAction command.

  • Confused 1

Share this post


Link to post
Share on other sites
31 minutes ago, Moon_chilD said:



Another problem might be: What is "_this" and "_target". Is it defined somewhere? If so, this should work. If not you need to define these.

Edit: Yeah, me dumb. 
drugdealer addAction ["Weed bale 3.5K","drugs\weedbale. sqf ",[3500],1.5,true,true,"","",2];

I knew there already was a distance thing in the AddAction command.

 

 

[3500] as argument... lost...   why don't you pass directly in the code?

drugdealer addAction ["Weed bale 3.5K",{ [3500] execVm "drugs\weedbale. sqf "},nil,1.5,true,true,"","",2];

Share this post


Link to post
Share on other sites

Yeah wasn't really my day, especially since I didn't realize that the execVM was missing too xD

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

×