Search the Community
Showing results for tags 'passing variables'.
Found 1 result
-
passing parameters getting returns problem
stuguy posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I am very familiar with programming and I have been experimenting how ARMA passes variables to functions. I think I understand how params and param work, but I am having difficulty calling a function to return a desired result. This below code is simply trying to call on a function that requires the input of a group, in this instance, I am sending it "group player" with the call function. From what I understand, the function returns the last line, so the count should return the number of men in the group. However, it sends an error stating that it is expecting a number, but is getting type string. This is confusing because I am sending it Group Player, an array of men to be counted. Just writing a count out with "_num = count units group player" works without a hitch. So why is it I am unable to pass it the _grp parameter? getGrpCount = { param ["_grp"]; count units _grp; }; _num = [group player] call getGrpCount; hint format ["%1",_num]; no workie _num = count units group player; hint format ["%1",_num]; works Existing user? Sign In