Derty 10 Posted May 18, 2012 So I found this script somewhere here on these forums. It basically runs a script that changes all the players setcaptive status to false if any of them fire their weapons. I have it in each players init. FiredH = this addEventHandler ["fired", {EHScrtp = _this exec "SetCaptive.sqf"}]; That works fine. The problem is that if a player drops a satchel charge on the ground that also causes the script to run. Is it possible to make it only run if the player fires his primary weapon or sidearm? Thanks in advance Share this post Link to post Share on other sites
mikie boy 18 Posted May 18, 2012 FiredH = this addEventHandler ["FIRED", { if ((_this select 5) == "pipebomb") exitWith {};EHScrtp = _this exec "SetCaptive.sqf"; }]; try this - not tested :) Share this post Link to post Share on other sites
xeno 234 Posted May 18, 2012 FiredH = this addEventHandler ["FIRED", { if ((_this select 5) == "pipebomb") exitWith {};EHScrtp = _this exec "SetCaptive.sqf"; }]; That's an occasion where exitWith does not work (beeing used in the code part of an eventhandler, fine in called functions from the EH code though). if (_this select 5 != "pipebomb") then {... Xeno Share this post Link to post Share on other sites
Derty 10 Posted May 19, 2012 ok so I changed it but it still doesn't seem to work. As soon as you drop a satchel charge OPFOR goes hostile FiredH = this addEventHandler ["FIRED", { if (_this select 5 != "pipebomb") then {};EHScrtp = _this exec "SetCaptive.sqf"; }]; Share this post Link to post Share on other sites
Rydygier 1317 Posted May 19, 2012 Looks, like there are corrections needed, maybe this will be fine: FiredH = this addEventHandler ["FIRED", { if (_this select 5 != "pipebomb") then {EHScrtp = _this [color="#FF0000"]execVM [/color]"SetCaptive.sqf"}[color="#FF0000"]}[/color]]; Share this post Link to post Share on other sites
Derty 10 Posted May 21, 2012 Still no go. As soon as I place a charge OPFOR goes hostile. Share this post Link to post Share on other sites
zodd 14 Posted May 21, 2012 Try unit init line: this addEventHandler ["Fired", {_this execVM "checkfired.sqf";}]; checkfired.sqf _unitfired = _this select 0; _ammo = _this select 4; _projectile = _this select 6; _nonvalid = ["pipebomb"]; if (!(_ammo in _nonvalid)) then { nul = _unitfired execVM "SetCaptive.sqf"; }; } Or something like that... just doing this quickly so may have made minor mistakes but that should work. You may have to check the pipebomb classname (for ammo) http://community.bistudio.com/wiki/ArmA:_Event_Handlers#Fired Share this post Link to post Share on other sites
Stukes 1 Posted October 30, 2012 I followed the instructions in the last post and it would not work. Turns out, the class needs to be case-sensitive (pipebomb needs to be PipeBomb) That script is excellent and with a few tweaks could be used to not detect SD weapons and the like Share this post Link to post Share on other sites
cychou 11 Posted September 6, 2015 II would need a solution to trigger kill report and scoring when using satchels charges in ACE 2 mod. Share this post Link to post Share on other sites
froggyluv 2136 Posted September 6, 2015 Im asking same for Arma3 -basically Satchel is considered Ammo not Weapon so there is no parameter for it in the Killed eventHandler. Thats what we need.... Share this post Link to post Share on other sites