PDA

View Full Version : using an entire array as a single parameter



Mongoose_84
Dec 22 2006, 11:17
i tried this without any success.

executing a script:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
&#91;x, y , &#91;z1 ,z2, ...&#93;&#93; execVM &#39;script.sqf&#39;;
[/QUOTE]
(i want the number of elements in z to be variable)

in the script:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
_x = _this select 0;
_y = _this select 1;
_z = _this select 2;
[/QUOTE]
but passing on an array like this doesn&#39;t work the way i expected. what do i have to do instead? http://forums.bistudio.com/oldsmileys/help.gif

edit: allright, allright... dunno whether it was the fact that i didn&#39;t create a new array before using it as a parameter (instead of creating it right in the parameters-array) or just the missing "then" again, that caused the problem, but it works now - so nevermind...