Jump to content
Sign in to follow this  
SenseleSS Violence

currentCommand

Recommended Posts

Anyone got a working example of currentCommand

this code on a soldier returns nothing....

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

{

_command = currentCommand _unit;

hintc format["%1",_command];

switch (_command)do

{

case "FIRE":{[_unit,_loop]execVM "shoot.sqf"};

};

sleep 5;

};

I send the _unit in this loop a radio command but hintc returns nothing and the switch/case control never exec's.

and I'm sober today whistle.gif ...just

EDIT: looks like the sleep 5; was to long, i dropped this down to .1 and when I selected a unit then clicked a enemy

"ATTACK AND FIRE" was displayed......which isn't in the wiki

Share this post


Link to post
Share on other sites

Hmm, the Wiki also states that an empty string is returned, if the unit has no command.

From the Wiki:

<<Return the current command type (empty string when no command)>>

So the radio command that you send to the unit must be the cause of the problem. All units in initial state without being issued a waypoint will return empty string on currentcommand.

However the Wiki lacks a lot of information, that is true.

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  

×