Jump to content
M1ke_SK

[solved] check if param is piece of code

Recommended Posts

I have params defined like this:

params ["_object", ["_code", {}]];

Question: how to check if there is some code?

if !(_code isEqualTo "") then
{
    _object spawn _code;
};

 

Share this post


Link to post
Share on other sites
if (!isNil "_code") then {
	// code
};

With this you check if the variable "_code" is defined.

Share this post


Link to post
Share on other sites
if (_code isEqualType {}) then
{
    _object spawn _code;
};

or you can force it

params ["_object", ["_code", {}, [{}]]];

 

  • Like 1

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

×