Jump to content
Sign in to follow this  
DanAK47

Takeweapon

Recommended Posts

I have been trying to make a soldier take a weapon from a crate. I added the weapon to the crate (a carl gustav) and put "this action ["TAKEWEAPON",CarlGustavLauncher] into the soldier's init field. He just sits there being artifically imcompetent.

Is there any way to make this function work?

Dan

Share this post


Link to post
Share on other sites

I think you got the right line but in the wrong place. Try to put it in a trigger or waypoint and see what hapens.

mysoldier action ["TAKEWEAPON",CarlGustavLauncher];

In a trigger activation

Share this post


Link to post
Share on other sites

I have never made a soldier take a weapon using a script, but don't you have to tell the guy where to get the weapon??

Share this post


Link to post
Share on other sites

As I recall the syntax goes something like this:

unit action ["Takeweapon",source,0,0,weapontype ]

Where source is where the weapon is (ie. the name of an ammo crate or dead soldier) and weapontype is of course the name of the weapon (ie. "m16").

Not exactly sure what the two 0's are in there for, but I do know they're necessary as part of the arguement to be passed...

Share this post


Link to post
Share on other sites

Doesn't seem to work, but thanks for making this your first post Sui. I appreciate the effort. I'll just have to work around it.

On that subject.. I have 32 posts and registered a year ago. Do I get an award..?

Share this post


Link to post
Share on other sites

Ahh sorry... there's a space in there somewhere. The correct syntax is:

unit action ["Take Weapon", source , 0, 0, weapontype ]

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  

×