Jump to content

Search the Community

Showing results for tags 'eventhandler'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


    • Vigor
    • DAYZ
    • ARMA 3
    • ARMA 2
    • YLANDS
    • ARGO
  • Die Hard OFP Lovers' Club's Topics
  • ArmA Toolmakers's Releases
  • ArmA Toolmakers's General
  • Japan in Arma's Topics
  • Arma 3 Photography Club's Discussions
  • The Order Of the Wolfs- Unit's Topics
  • 4th Infantry Brigade's Recruitment
  • 11th Marine Expeditionary Unit OFFICIAL | 11th MEU(SOC)'s 11th MEU(SOC) Recruitment Status - OPEN
  • Legion latina semper fi's New Server Legion latina next wick
  • Legion latina semper fi's https://www.facebook.com/groups/legionlatinasemperfidelis/
  • Legion latina semper fi's Server VPN LEGION LATINA SEMPER FI
  • Team Nederland's Welkom bij ons club
  • Team Nederland's Facebook
  • [H.S.O.] Hellenic Special Operations's Infos
  • BI Forum Ravage Club's Forum Topics
  • Exilemod (Unofficial)'s General Discussion
  • Exilemod (Unofficial)'s Scripts
  • Exilemod (Unofficial)'s Addons
  • Exilemod (Unofficial)'s Problems & Bugs
  • Exilemod (Unofficial)'s Exilemod Tweaks
  • Exilemod (Unofficial)'s Promotion
  • Exilemod (Unofficial)'s Maps - Mission Files
  • TKO's Weferlingen
  • TKO's Virolahti
  • TKO's Livonia
  • TKO's Rules
  • TKO's Changelog
  • TKO's Help
  • TKO's What we Need
  • MSOF A3 Wasteland's Server Game Play Features
  • MSOF A3 Wasteland's Problems & Bugs
  • MSOF A3 Wasteland's Maps in Rotation
  • SOS GAMING's Server
  • SOS GAMING's News on Server
  • SOS GAMING's Regeln / Rules
  • SOS GAMING's Ghost-Town-Team
  • SOS GAMING's Steuerung / Keys
  • SOS GAMING's Div. Infos
  • SOS GAMING's Small Talk
  • NAMC's Topics
  • NTC's New Members
  • NTC's Enlisted Members
  • The STATE's Topics

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL


Jabber (xmpp)








Steam url id







PlayStation PSN














Found 39 results

  1. Last content update: 6/13/2018 showing how to use the radius for addAction, using params instead of select, adding to arrays with various commands, altering arrays with various commands, get/setUnitLoadout Last content update: 6/10/2018 going through config files and getting details to sort what you want, using radius with addAction, params, and altering arrays with resize, pushBack, pushBackUnique, set, and append and going over to assist with resize count. Last content update: 5/27/2018 added GUI tutorial for how to make a weapon selector using cfgWeapon Last content update: 5/24/2018 added sector control tutorial Last content update: 5/21/2018 This is my arma 3 scripting tutorial series which is aimed to help both people getting into making their own scripts with fairly detailed simple tutorials as well as for the intermediate person looking to create their own features for their missions. The plans for this series is to almost fully cover everything behind the arma 3 missions that people play on a daily basis and have enough content provided in the videos where people can go off and make their own vision for their mission with the knowledge gained. Most of these videos are made on the fly at 1AM-4AM without any pretesting which should give someone the idea of what goes into finding syntax errors and narrowing down a bug that's causing your feature to not function properly. It is also an excuse for you to cut me some slack if you see mistakes :) . A lot of these tutorials are made with multiplayer in mind since I think most people want to play their missions online with their friends(which is why publicVariable has been utilized so much so new people can get a good grasp on the power those commands have). New videos are added to the playlist almost every day so if your stuck with something, maybe it has been covered in a video. If you have any requests on what you would like to see made then please suggest it here. topics covered so far Scripting tutorial playlist Database tutorials with INIDBI2 playlist GUI/Dialog tutorials playlist
  2. I'm making an awful inhouse mod for me and my buddies. It's my first time trying to mod anything really and I've gotten a lot farther then I thought I would. I've got everything working except Randomized headgear. I would like the units spawned to use the randomized headgear made for the FIA in the bootcamp DLC but for the life of me I can't get it working. There doesn't seem to be much documentation on config modding in general and the stuff I do find requires trial and error to get working because it's incredibly vague. Anyway I just want another set of eyes to look this over and tell me what I'm doing wrong. class EventHandlers; class CfgVehicles { class B_Soldier_F; class B_Kitbag_rgr; class MO_inf_soldierOB : B_Soldier_F { side = 0; scope = 0; displayName = "Base"; editorCatergory = "MO_csr_fact"; author = "Kaas298"; nakedUniform = "U_BasicBody"; uniformClass = "CUP_U_O_CHDKZ_Kam_03"; backpack = "rhssaf_kitbag_md2camo"; weapons[] = {"hlc_wp_m16a1","rhs_weap_m72a7","Throw","Put"}; respawnWeapons[] = {"hlc_wp_m16a1","Throw","Put"}; magazines[] = {"hlc_30rnd_556x45_EPR_EMAG","hlc_30rnd_556x45_EPR_EMAG","hlc_30rnd_556x45_EPR_EMAG","hlc_30rnd_556x45_EPR_EMAG","hlc_30rnd_556x45_EPR_EMAG","hlc_30rnd_556x45_EPR_EMAG","HandGrenade","HandGrenade"}; respawnMagazines[] = {"hlc_30rnd_556x45_EPR_EMAG","hlc_30rnd_556x45_EPR_EMAG","hlc_30rnd_556x45_EPR_EMAG","hlc_30rnd_556x45_EPR_EMAG","hlc_30rnd_556x45_EPR_EMAG","hlc_30rnd_556x45_EPR_EMAG","HandGrenade","HandGrenade"}; linkedItems[] = {"rhssaf_vest_otv_md2camo","ItemMap","ItemCompass","ItemWatch","ItemRadio","ACRE_PRC343","ACE_fieldDressing","ACE_fieldDressing","ACE_morphine"}; respawnLinkedItems[] = {"rhssaf_vest_otv_md2camo","ItemMap","ItemCompass","ItemWatch","ItemRadio","ACRE_PRC343","ACE_fieldDressing","ACE_fieldDressing","ACE_morphine"}; headgearList[] = { //"", 0.3, "rhssaf_beret_green", 0.5, "CUP_H_Ger_M92", 0.3, "rhsgref_helmet_pasgt_woodland", 0.1, //"H_FakeHeadgear", 0.7, "H_Watchcap_blk", 0.4, "H_Watchcap_khk", 0.5, "rhs_beanie_green", 0.9, }; allowedFacewear[] = { //"", 0.5, "rhsusf_shemagh_grn", 0.5, "rhsusf_shemagh2_grn", 0.5, "rhsusf_shemagh_od", 0.5, "rhsusf_shemagh2_od", 0.5, "rhs_scarf", 0.5, "G_Balaclava_blk", 0.5, "G_Balaclava_oli", 0.5, "G_Bandanna_oli", 0.5, "G_Balaclava_combat", 0.5, "CUP_G_Scarf_Face_White", 0.5, }; class EventHandlers: EventHandlers { init = "if (local (_this select 0)) then {[(_this select 0), [], []] call BIS_fnc_unitHeadgear;}"; }; }; };
  3. I want a unit to move in a vehicle after respawn but it shows that error code: 17:52:36 Error in expression <_wp = _unit addWaypoint [_pos1, 0];> 17:52:36 Error position: <_unit addWaypoint [_pos1, 0];> 17:52:36 Error Undefined variable in expression: _unit 17:52:36 Error in expression <_unit setWaypointType "MOVE";> 17:52:36 Error position: <_unit setWaypointType "MOVE";> 17:52:36 Error Undefined variable in expression: _unit 17:52:36 Error in expression <_unit setWaypointSpeed "Full";> 17:52:36 Error position: <_unit setWaypointSpeed "Full";> 17:52:36 Error Undefined variable in expression: _unit 17:52:36 Error in expression <_unit setWaypointBehaviour "Combat";> 17:52:36 Error position: <_unit setWaypointBehaviour "Combat";> 17:52:36 Error Undefined variable in expression: _unit 17:52:36 Error in expression <_unit setWaypointType "GETIN NEAREST";> 17:52:36 Error position: <_unit setWaypointType "GETIN NEAREST";> 17:52:36 Error Undefined variable in expression: _unit the script is activated with this in the unit's init:this addMPEventHandler ["MPRespawn", {[_unit] exec "respawnvehiclescript.sqf"}]; the script: _unit = _this select 0; _pos1 = getMarkerPos "Marker1"; _wp = _unit addWaypoint _pos1 _unit setWaypointType "MOVE"; _unit setWaypointSpeed "Full"; _unit setWaypointBehaviour "Combat"; _unit setWaypointType "GETIN NEAREST"; hint "%1 respawned!!!"
  4. According to BIKI, the IncomingMissile EventHandler is global. (When talking about local/global of EH, we're talking about whether the EH will be triggered on remote vehicles that the EH is assigned to.) However, the author found that this is incomplete. Few days ago in latest CTI MPMissions (ver TZK_2.12 v00) the author add IncomingMissile EH (used for alert) to tanks on all clients but not on dedicated server. The result is surprising that this EH won't be triggered by server-local rockets/missiles. This follows that IncomingMissile EH must be related to client-local rocket/missiles as well. Further tests show that the "command" parameter of addEventHandler about IncomingMissile EH on dedicated server can be empty string, like <a server-remote vehicle> addEventHandler ["IncomingMissile", ""] and the IncomingMissile EH on player clients' can be triggered by server-local rockets/missiles. Thus the conclusion is that although IncomingMissile EH is global, it requires at least an empty EH on remote clients that you wish their rocket/missile trigger this EH. The command of EH can be nothing, but the EH can't be omitted. It would be more clearly if compare with Fired EH. Assume there are 2 clients: call player's client "A", and call a remote client, e.g. dedicated server, "B". On A client Fired EH can be added to all tanks created on "B" to display tracer effect of tanks created by "B". The Fired EH will work for A once any tank of B shoot any bullet. But if A add IncomingMissile EH to B vehicles, the EH won't work if vehicle is attacking by missiles shot from clients except A, unless on the client where missiles are shot from added IncomingMissile EH to that B vehicle as well.
  5. I am attempting to create a rewards script for transport pilots fulfilling their duties. I have it set up to count the passengers, create a starting marker and ending marker, and calculate it, but my waitUntils do not seem to be functioning properly, causing the script to finalize as soon as the Event handler fires. Are Event handlers able to be suspended? Examples: waitUntil {count fullCrew [_vehicle,"",false] >= 2}; waitUntil { ((getPos (_vehicle) select 2) > 25) && (speed (_vehicle) > 30) }; If it is not suspendable, I guess I will have to make addActions for Transport begin, and Transport ended; but if it gets crazy at the LZ, remembering to do that may be a issue.
  6. I've been hitting my head against a wall for a few days trying to sort this issue. I have a script (see below) that I wrote for a firing range. It works perfectly in SP and on locally hosted servers. I am having issues with it on the dedicated server. I dug through the (recent) topic below and have attempted tweaks off of that to no avail. https://forums.bohemia.net/forums/topic/221167-addmpeventhandler-not-working-on-dedicated-server/?_fromLogin=1 I feel like my issue is lying somewhere in the eventHandler not updating the score variables for some reason. I am not sure why it would be working on a local host and not dedicated. Below is the first snippet of the script down to where I added the first check to see if the EHs were working. Any help offered would be greatly appreciated. My head hurts and I'm afraid I'll dent my wall if I keep hitting it. PS. I am using the targetHumanSimple because it does not fall when it gets shot. I did this so the shooter has to observe the bullet strike and does not have a visual aide. I don't think this would make any difference but full disclosure is full disclosure.
  7. Hi, I'm still looking for the best way to manage some revive heal in SP and MP session. SP works fine but I can't find a reliable solution for MP, with the EH handleDamage. Restarting from the basement, I'd like to share this test I can't explain the result: I placed 2 playable groups in editor. and 1 trigger (true) to run this code: {_x addEventHandler ["handleDamage", { params ["_unit","","_dam"]; hint str (getAllHitPointsDamage _unit); _dam min 0.86 }]; } forEach allunits; This code is running on each hosted/clients. The EH is supposed to limit all the hits at 0.86 max. This way the unit is wounded but never die (OK in SP or units on hosted server). PS: I know, I can write the hint inside of a loop rather than inside of the EH, but that doesn't change anything for the following issue: If I JIP on the 2nd group leader, so the group will be remote to the client's PC. The group owner changes. Normal. Then if I continue to fire against these remote units, the EH still fires (I can see the new value for getAllHitPointsDamage), so the hint is "ok" then the EH code runs but the remote units die! - I can shoot the units of my group: they never die, - all remote units are dying... Everything goes as the EH fires locally (normal: E.L.) but this localization is not updated to the new localization of the unit! This EH is hard to manage, even for so small behavior as modifying a value for hit damage. I miss something, probably. Any help appreciated. Thanks.
  8. Hey guys, I would like to add for my players the ability to use an action which would only appear to them if they met a specific criteria. The criteria is to have a specific backpack and inside it, a specific item. I got the script responsible for the condition working, but only once I put it in the init.sqf. If I did it that way, the action would appear and remain available even after the condition was no longer fulfilled (the object being dropped for example). Naturally, I'd like to remove the action if the condition was no longer met. I basically do not know how to check for the condition so that it always pops up for the player once he meets that criteria. This is the script that I don't know how to call: if ((unitBackpack Player isKindof "tfw_ilbe_a_gr") && ("tfw_rf3080Item" in (items player + assignedItems player))) then {Player addAction ["Test Action", "test_action.sqf"];} Thanks!
  9. Hey! If I want to add eventHandlers to: EDIT: class CfgVehicles { class Man; class CAManBase: Man { class EventHandlers { addEventHandler ["GetInMan", {[player] call Salmon_fnc_function}]; addEventHandler ["GetOutMan", {[player] call Salmon_fnc_function}] }; }; }; How would I go about doing that? I want to call a function every time a player with the mod loaded gets in or out of a vehicle.
  10. Hi, I need help to get this running. I want to call some code on opening the parachute. I didn't found anything matching in the list: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers. I even tried the GetIn-Handlers because the parachute seems to be handled as a vehicle. Any ideas? Thx in advance ;)
  11. Hello Armaholics! I must admit I'm very bad when it comes to scripting. Is there a easy way to have a trigger activate when you have closed a leaflet after you've read it. Couldn't find anything on leaflets on the wiki regarding event handlers. I'm using this for the leaflets: ["init", [this, "image.jpg", "Text message"]] call BIS_fnc_initLeaflet It will be used in a upcoming horror mission this halloween. Thanks in advance! :) Some of my missions: [CO-04] Last Stand - Bunker [CO-04] Last Stand - Compound [CO-04] Last Stand - Town [CO-04] Terrorist Hunt - Village [CO-04] Terrorist Hunt - Factory
  12. What is the best way to create and eventhandler for currentThrowable items? I want an event handler to track every time I throw a throwable, so when my player's inventory of "HandGrenade"or "SmokeShellGreen" is depleted I can refill it. I have tried to use an "explosion" EH with the following but does not work as _throwableArray is an array of strings, and I can't figure out how to create an array of throwables on the player...Also I don't think this would work for a "SmokeShell" _throwableArray = []; { if (_x == _throwable) then {_throwableArray pushBack _x} } forEach (magazines player); { _x addEventHandler ["Explosion", { params ["_vehicle", "_damage"]; if (damage _vehicle > 0.1) then { if !( _throwable in (magazines player) ) then {for "_i" from 1 to 3 do {player addItemToVest _throwable};}; }; }]; } forEach _throwableArray; I have tried to use "AnimDone" EH, but could not even find the common animation for throwing... player addEventHandler ["AnimDone", { params ["_unit", "_anim"]; if (_anim == "AmovPercMrunSlowWpstDf_AmovPercMstpSrasWpstDnon_gthThrow") then { if !( _throwable in (magazines player) ) then {for "_i" from 1 to 3 do {player addItemToVest _throwable};}; }; }];
  13. What is the best way to create and eventhandler for currentThrowable items? I want an event handler to track every time I throw a throwable, so when my player's inventory of "HandGrenade"or "SmokeShellGreen" is depleted I can refill it. I have tried to use an "explosion" EH with the following but does not work as _throwableArray is an array of strings, and I can't figure out how to create an array of throwables on the player...Also I don't think this would work for a "SmokeShell" _throwableArray = []; { if (_x == _throwable) then {_throwableArray pushBack _x} } forEach (magazines player); { _x addEventHandler ["Explosion", { params ["_vehicle", "_damage"]; if (damage _vehicle > 0.1) then { if !( _throwable in (magazines player) ) then {for "_i" from 1 to 3 do {player addItemToVest _throwable};}; }; }]; } forEach _throwableArray; I have tried to use "AnimDone" EH, but could not even find the common animation for throwing... player addEventHandler ["AnimDone", { params ["_unit", "_anim"]; if (_anim == "AmovPercMrunSlowWpstDf_AmovPercMstpSrasWpstDnon_gthThrow") then { if !( _throwable in (magazines player) ) then {for "_i" from 1 to 3 do {player addItemToVest _throwable};}; }; }];
  14. Hello, I've been playing with Put and Take event handlers to try and achieve functionality that's stated in the topic. For starters Put EH seems to only fire when you drop your weapon on the ground (groundWeaponHolder) or put the weapon into a container (box, vehicle) directly from your inventory. It doesn't fire when switching to a weapon that is on the ground even though (at least how I see it) you are still dropping your current weapon into a "groundWeaponHolder". Does anyone have an idea why this EH doesn't fire in that case? I used this shortie to test Put EH: player addEventHandler ["Put", {_unit = _this select 0; _content = _this select 1; _weapon = _this select 2; hint "This EH seems to be working";}]; Take EH on the other hand seems to work just fine for detecting the weapon pick up operation. But other than testing with simple hint that the EH fires when needed I haven't been able to come up with anything I'm looking to achieve. Now the ultimate question is: by using either of the aforementioned EHs how to delete the weapon that gets put on the ground during weapon switching operation?
  15. Hi folks, the following three lines in the middle are part of a function and the function is set to {preInit = 1}. //begin true spawn { waitUntil{!isNull player}; .... systemChat "I am here"; // is shown on the map at briefing screen. player addEventHandler [ "Respawn", {systemChat "respawn"}]; // this code is completly ignored, no EH is added, no text shown on respawn??? player addEventHandler [ "Killed", {systemChat "killed"}]; // is shown when player dies. ... }; //end if i put the second line in debug console and press local, it works fine after respawn!! My first question is, where is the difference between "respawn" and "killed" EH? (except the known funktionality from the wiki) My second question is, is there a proper way to find out, if an EH was added and is not firing, or if it just was not added? thanks a lot
  16. Hi all! I know that kind of event handler does not exist, but since the "AUTOCOMBAT" AI feature exists, it is definetly something BIS should implement to avoid disabling it and looping around unit current behaviour and switch it "manually". I want to take advantage of some UPSMon feature which orders AI to set in STEALTH, and, in that case, add them a supressor and make them use it. Is there any Smart way to do this avoiding loops? Thanks in advance!
  17. addMissionEventHandler ["EntityKilled", { params ["_dead"]; if (_dead in switchableUnits) then { addSwitchableUnit (units _dead param [1, objNull]); }; }]; This makes it so that when a playable entity is killed, their second in command becomes playable. Well if you test it, if you kill the first 2 guys really quickly, it doesn't work... or well the code works, but i don't know how to articulate what i want it to do. I know its because its selecting the 2nd item in an array, and it takes time for the array to readjust, but i don't know a compact and effective way for it to fix it self in case the first 2 units in the array are killed.
  18. Hello. When I try to add an event handler to a newly spawned vehicle, the event handler is NOT working. [_helicopter] remoteExec ["jey_helicopter_restriction",0,true]; jey_helicopter_restriction = { _vehicle = _this select 0; _vehicle addEventHandler ["GetIn",{_this call checkpilot}]; _vehicle addEventHandler ["Engine",{_this call checkengine}]; }; But if I add an event handler to an already spawned vehicle (that has been there from the mission start) it works : chopp3 addEventHandler ["GetIn",{_this call checkpilot}]; chopp3 addEventHandler ["Engine",{_this call checkengine}]; Any ideas?
  19. Hello, I'm having an issue getting this event handler to fire on dedicated server. Everything works perfect in player hosted server. I've tried to use the event handler with "remoteexec" but cannot seem to get that to work on player hosted or dedicated servers. I do believe "remoteexec" is the answer but I somehow have it setup wrong. Here are the codes ran from initserver.sqf This one works exactly as I want it to on player hosted server but does nothing on a dedicated server. while {true} do {sleep 5; {_x removeallEventHandlers "Handleheal"} forEach allUnits;{_x addEventHandler ["Handleheal", {_this select 1 addScore 1; _this select 0 disableai "move"; fire_enableaimoveforheal_trigger_1 = true}]} forEach allUnits }; This one above works exactly as I want it to on player hosted server but does nothing on a dedicated server. while {true} do {[{_x ["Handleheal", {_this select 1 addScore 1; _this select 0 disableai "move"; fire_enableaimoveforheal_trigger_1 = true}foreach allunits]] remoteExec ["addEventHandler", 0, true] }; This one above was my progress to get the Event Handler to work on dedicated server using "remoteexec". I cannot get this one to even do anything on player hosted server so I'm pretty sure I have some type of error in there but I'm getting no error code. Anyone that attempts to help is very much appreciated :-)
  20. I have a music loop eventhandler set up in a trigger. It works fine the code is: 1 fademusic 1; ehID = addMusicEventHandler ["MusicStop", {playMusic ["Track2", 2];}];playMusic ["Track2", 2]; And upon Deactivation it fades the music to 0. Works good. However. I have various other triggers on objective zones which fade back in the music using different tracks. Those work fine too but after they finish playing the music is still at fade 1 and it resumes the eventhandler for the loop. So basically I want this loop to only function inside of this trigger. How do I terminate this loop upon deactivation and will it reactivate on a repeatable trigger as it should after deactivation? Any help is greatly appreciated. For anyone wondering its for a type of safe house like Resident Evil style where you enter it and your cozy warm piano loop plays and reassures you that everything is going to be alright. ;) So it needs to be repeatable in and out type of deal. Thanks.
  21. Hi. How can I find the handler ID to use with ctrlRemoveEventHandler ? https://community.bistudio.com/wiki/ctrlRemoveEventHandler
  22. Hi I need some help with the precise syntax of an Eventhandler but I don't know programming and need help with the precise syntax. I want to insert in the init of a helicopter than when it switches its engine off, it kicks out of the vehicle all players in cargo. According to Arma wiki https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Engine the init shoul be something like this. This addeventhandler "engine" [this, false] { moveOut this } forEach crew this; But I can't make it work. Any idea of what I am doing wrong?
  23. Hi, For those who don't know, Arma has a framework to check for an event on each frame of the game (similar to the sleep/sleepUI commands but unscheduled, so higher priority). Currently, there's no easy way to make it consider objects (or indeed any other data) that does not have a global name. This basic framework can let you add events easily based on time (it uses diag_tickTime fyi). Also, you can pass custom functions to it not based on time and write out the outcomes yourself (bit more advanced). If you specify a timeout parameter (in seconds), it will only execute your code once the timeout is up. Without a timeout specified, it will execute your code on each frame. FORMAT This is the format for using it: _thisEventHandler = [arguments,code,timeout (optional)] call horde_fnc_addMissionEventHandler; The rules are that the arguments you pass to it must be in an array. So these are ok: [[player],myFunction,10] call horde_fnc_addMissionEventHandler; [["string"],myFunction,10] call horde_fnc_addMissionEventHandler; [[player,"string"],myFunction,10] call horde_fnc_addMissionEventHandler; Using a single argument is NOT ok: [player,myFunction,10] call horde_fnc_addMissionEventHandler; // bad ["string",myFunction,10] call horde_fnc_addMissionEventHandler; // bad There's no error checking currently* so as long as you stick to the format, then you're ok. EXAMPLES ein) _fnc = { player sideChat format ["%1",_this select 0] }; [["hello"],_fnc,2] call horde_fnc_addMissionEventHandler; [["poopy"],_fnc,3] call horde_fnc_addMissionEventHandler; [["fluffy paws"],_fnc,4] call horde_fnc_addMissionEventHandler; Prints "hello" on screen after 2 seconds, then "poopy" a second later, then "fluffy paws" a second after that. drei) _fnc = { missionNamespace getVariable ("horde_gv_eachFrameArgs_" + (_thisEventHandler toFixed 0)) params ["_unit","_moving","_notMoving"]; if (vectorMagnitude velocity vehicle _unit > 1) then { systemChat format ["%1 is %2",_unit,_moving] } else { systemChat format ["%1 %2",_unit,_notMoving] } }; TAG_movingIndicatorID = [[player,"moving","not moving"],_fnc] call horde_fnc_addMissionEventHandler; Infinite loop informing player if he/she is moving or not by systemChat. Note that we no not define the timeout (3rd parameter in the arguments). You can stop it in this example by using the return (TAG_movingIndicatorID) TAG_movingIndicatorID call horde_fnc_removeMissionEventHandler; // stops the sideChat zwei) _fnc = { missionNamespace getVariable ("horde_gv_eachFrameArgs_" + (_thisEventHandler toFixed 0)) params ["_unit","_moving"]; if (vectorMagnitude velocity vehicle _unit > 1) then { systemChat format ["%1 is %2 - deleting EventHandler",_unit,_moving]; _thisEventHandler call horde_fnc_removeMissionEventHandler } }; [[player,"moving"],_fnc] call horde_fnc_addMissionEventHandler; This is a function that is not dependent on time so the 3rd parameter of the arguments does not need to be defined. If the unit passed to it moves, then it prints a message and then quits. Note that the deletion is specified in the function. CBA I just wanted to mention cba as they have a great system for this sort of thing, but if you want to use it, then you have to be comfortable with mod dependencies. This is a poor man's system that lets you manage an unscheduled event system without mods. ALWAYS DO BETTER If you can write something faster/better than this then please comment and post your code in here so we can all benefit. My code's not great but works ok I think. I'm sure there's better ways of doing it but I can't think of them right now. FUNCTIONS horde_fnc_addMissionEventHandler = { params ["_args","_code","_timeout"]; private _thisEventHandler = -1; if (isNil "_timeout") then { _thisEventHandler = addMissionEventHandler [ 'EachFrame', _code ]; } else { _thisEventHandler = addMissionEventHandler [ 'EachFrame', horde_fnc_missionEventHandlerTimeout ]; _args pushBack [_code,diag_tickTime + _timeout] }; missionNamespace setVariable ["horde_gv_eachFrameArgs_" + (_thisEventHandler toFixed 0),_args]; _thisEventHandler }; horde_fnc_missionEventHandlerTimeout = { private _args = missionNamespace getVariable ("horde_gv_eachFrameArgs_" + (_thisEventHandler toFixed 0)); _args select (count _args - 1) params ["_code","_timeout"]; if (diag_tickTime > _timeout) then { _args deleteAt (count _args - 1); _args call _code; removeMissionEventHandler ["EachFrame",_thisEventHandler]; missionNamespace setVariable ["horde_gv_eachFrameArgs_" + (_thisEventHandler toFixed 0),nil]; }; true }; horde_fnc_removeMissionEventHandler = { removeMissionEventHandler ["EachFrame",_this]; missionNamespace setVariable ["horde_gv_eachFrameArgs_" + (_this toFixed 0),nil]; true }; Ta * = I could put this in if required but it will slow the execution down a bit
  24. Hi guys, im trying to simulate a miles (Multiple Integrated Laser Engagement System) exercise but im having some troubles, i'm using a eventhandler "HIT" to execute the effects, like this: { if ((side _x) == Independent) then { _x addEventHandler ["HIT",{ _this select 0 setCaptive true; _this select 0 setdamage 0; _this select 0 disableai "Anim"; _this select 0 disableAI "Move"; _this select 0 disableAI "AutoTarget"; _this select 0 switchMove "AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon"; }]; }; } forEach allUnits; well, if i shoot a independent unit to a leg, to a arm or even in the kevlar vest at distance, work well, the unit will stop, put his hands behind the head and the blufor IA´s stop shooting them, but, if i shoot to the units at the head, well, they simply dies, the same if i shoot to the chest in close combat... if i put the units in allowdamage false, the eventhandler "HIT" dont work... somebody knows how can i solve this? thank for all and sorry about my poor english :(