Jump to content
Rook Mk1

Call arguments not working past third parameter

Recommended Posts

[_unit, 10, pistol] call gunScript;

 

in code

params ["_unit", "_stubbornness", "_weapon"];

 

but it fails to recognise _weapon whenever I try to use it, any idea why?

Share this post


Link to post
Share on other sites
7 minutes ago, Rook Mk1 said:

but it fails to recognise _weapon whenever I try to use it, any idea why?

 

shouldn't pistol be wrapped in quotes to make it a string?

Share this post


Link to post
Share on other sites

pistol what? You must define pistol, or you might meant a string "pistol"? No idea how do you wanted to use the variable so no idea.

Share this post


Link to post
Share on other sites

I changed it to a number and it worked

 

from

if (_weapon == pistol) then

{
_unit addWeapon "hgun_P07_F";

_unit addHandgunItem  "16Rnd_9x21_Mag";
for "_i" from 1 to 2 do {_unit addItemToUniform "16Rnd_9x21_Mag"};
};

 

if (_weapon == 1) then

{
_unit addWeapon "hgun_P07_F";

_unit addHandgunItem  "16Rnd_9x21_Mag";
for "_i" from 1 to 2 do {_unit addItemToUniform "16Rnd_9x21_Mag"};
};

Share this post


Link to post
Share on other sites

You should have used quote marks because it is a string value.

Share this post


Link to post
Share on other sites

Ok, wasn't aware of that, but I know now, thanks all

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

×