Jump to content
Sign in to follow this  
kocrachon

cant launch ammo script

Recommended Posts

So right now I am trying to launch the following script with this init in my soldiers.

_soldier = this execVM "silenced.sqf" 

Here is the following script

_soldier = _this select 0;

removeallweapons _soldier;
removeBackpack _soldier;
_soldier addbackpack "US_Patrol_Pack_Specops_EP1";
clearMagazineCargo (unitBackpack _soldier);

_soldier addweapon "NVGoggles";
_soldier addweapon "Binocular_Vector";

_soldier addmagazine "20Rnd_762x51_SB_SCAR";
_soldier addweapon "SCAR_H_STD_TWS_SD";
_soldier addmagazine "20Rnd_762x51_SB_SCAR";
_soldier addmagazine "20Rnd_762x51_SB_SCAR";
_soldier addmagazine "20Rnd_762x51_SB_SCAR";
_soldier addmagazine "20Rnd_762x51_SB_SCAR";
_soldier addmagazine "20Rnd_762x51_SB_SCAR";
_soldier addmagazine "20Rnd_762x51_SB_SCAR";
_soldier addmagazine "20Rnd_762x51_SB_SCAR";
_soldier addmagazine "20Rnd_762x51_SB_SCAR";
_soldier addmagazine "20Rnd_762x51_SB_SCAR";
_soldier addmagazine "PipeBomb";

_soldier addmagazine "15Rnd_9x19_M9SD";
_soldier addweapon "M9SD";
_soldier addmagazine "15Rnd_9x19_M9SD";
_soldier addmagazine "15Rnd_9x19_M9SD";
_soldier addmagazine "15Rnd_9x19_M9SD";
_soldier addmagazine "15Rnd_9x19_M9SD";
_soldier addmagazine "15Rnd_9x19_M9SD";
_soldier addmagazine "15Rnd_9x19_M9SD";
_soldier addmagazine "15Rnd_9x19_M9SD";

(unitBackpack _soldier) addMagazineCargo ["20Rnd_762x51_SB_SCAR",4];
(unitBackpack _soldier) addMagazineCargo ["15Rnd_9x19_M9SD",4];	

Anyone know why its not working? I use to get it to work but I formatted my PC and I don't have the missions I used to use it with so I don't remember what I did differently.

Share this post


Link to post
Share on other sites

have a look at my preset weapons loadout script, it does what you want and you can customize it, also you can see how its done if you want to make your own.

Share this post


Link to post
Share on other sites

its because your missing the arguments brackets into your script:

_soldier = this execVM "silenced.sqf" only defines _soldier as the script handle

what you need to do is:

_loadout = [soldier] execVM "silenced.sqf"

i believe thats the only way execvm accepts arguments, they need to be in brackets

Share this post


Link to post
Share on other sites
its because your missing the arguments brackets into your script:

_soldier = this execVM "silenced.sqf" only defines _soldier as the script handle

what you need to do is:

_loadout = [soldier] execVM "silenced.sqf"

i believe thats the only way execvm accepts arguments, they need to be in brackets

Thanks, that helped alot, that ended up fixing my issue.

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
Sign in to follow this  

×