ACE3/addons/common/functions/fnc_codeToString.sqf
2015-01-12 19:22:58 +01:00

25 lines
544 B
Plaintext

/*
* Author: commy2
*
* Removes the brackets around a code and returns the code as a string. It does nothing if the code is already a string.
*
* Argument:
* 0: Code (Code or String)
*
* Return value:
* Code (String)
*/
#include "\z\ace\addons\common\script_component.hpp"
private "_function";
_function = _this select 0;
if (typeName _function == "STRING") exitWith {_function};
_function = toArray str _function;
_function set [0, -1];
_function set [count _function - 1, -1];
_function = toString (_function - [-1]);
_function