ACE3/addons/vehicledamage/functions/fnc_parseResult.sqf
jaynus fdf0ff2d24 Added: Result parsing, ext->sqf dispatch to localEvents
Fixed: Bullet build
Fixed: results are all 0=true, -1=failure, otherwise its a dispatch message.
2015-05-10 09:51:16 -07:00

24 lines
658 B
Plaintext

//#define DEBUG_MODE_FULL
#include "script_component.hpp"
PARAMS_1(_resultString);
private["_values", "_result", "_strings", "_command", "_arguments"];
TRACE_1("", _resultString);
if(!(_resultString find ":") ) exitWith { nil };
_strings = [_resultString, ":"] call CBA_fnc_split;
TRACE_1("", _strings);
// Invalid comman
// Command with no parameters
_command = _strings select 0;
if((count _strings) < 2) exitWith { [_command, []] };
if(_command == "exec") exitWith {
_code = compile (_strings select 1);
[_command, _code]
};
_arguments = [(_strings select 1), ","] call CBA_fnc_split;
[(_strings select 0), _arguments]