Wiki 1558 Posted December 7, 2017 Hello there. I'm trying to create a firing range for my new mission. I want the AI to have infinite magazines but reload when the mag is empty. Is it possible? If yes, how can I do that? Thanks Share this post Link to post Share on other sites
R3vo 2654 Posted December 7, 2017 [] spawn { while {alive unit} do { if ((count magazines unit) < 5) then { unit addMagzine "xxxx"; }; sleep 5; }; }; Maybe like so? Share this post Link to post Share on other sites
nimrod_z 8 Posted December 7, 2017 Easiest way is to use the "reloaded" eventhandler and simple add magazine of current weapon.. so every time they reload and discard empty mag they are give a new one. Share this post Link to post Share on other sites
Wiki 1558 Posted December 7, 2017 17 minutes ago, R3vo said: [] spawn { while {alive unit} do { if ((count magazines unit) < 5) then { unit addMagzine "xxxx"; }; sleep 5; }; }; Maybe like so? Thanks, gonna try this :-) 2 minutes ago, nimrod_z said: Easiest way is to use the "reloaded" eventhandler and simple add magazine of current weapon.. so every time they reload and discard empty mag they are give a new one. Good to know. Do you have the command? Share this post Link to post Share on other sites
R3vo 2654 Posted December 7, 2017 8 minutes ago, nimrod_z said: Easiest way is to use the "reloaded" eventhandler and simple add magazine of current weapon.. so every time they reload and discard empty mag they are give a new one. I didn't even think about the reloaded EH. Good idea! Share this post Link to post Share on other sites
POLPOX 778 Posted December 7, 2017 Probably like this: this addEventHandler ["Reloaded",{ _unit = _this select 0 ; _mag = _this select 4 select 0 ; _unit addMagazine _mag ; }] ; Not tested yet. 1 1 Share this post Link to post Share on other sites
Wiki 1558 Posted December 7, 2017 Works great! Thanks a lot! Share this post Link to post Share on other sites
kaique_ks 0 Posted March 5, 2022 Help me Please AddEventHandler Could you give me some help? I want to know how this works, and if this works in ARMA 2 It's about the infinite refills script where should i put this What should I do? Create which files or where to put them in the game this addEventHandler ["Reloaded", { _unit = _this select 0; _mag = _this select 4 select 0; _unit addMagazine _mag ; }]; or this null = this spawn { _this dotarget t1; sleep 0.5; _this addEventHandler ["Reloaded",{ _unit = _this select 0 ; _mag = _this select 4 select 0 ; _unit addMagazine _mag ; }] ; while {alive t1 and alive _this} do { sleep 0.3; [_this,currentWeapon _this] call BIS_fnc_fire; } ; } ; Share this post Link to post Share on other sites
Joe98 92 Posted March 5, 2022 To give a unit unlimited ammo = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = this addeventhandler ["fired", {(_this select 0) setvehicleammo 1}] 1 Share this post Link to post Share on other sites
kaique_ks 0 Posted March 7, 2022 On 05/03/2022 at 19:22, Joe98 said: Para dar munição ilimitada a uma unidade = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = this addeventhandler ["disparado", {(_this select 0) setvehicleammo 1}] Make unit have unlimited ammo but do still have to make a Magasin change Share this post Link to post Share on other sites