{"name":"triggerActivated","operator":null,"title":"triggerActivated","type":"command","url":"https://community.bistudio.com/wiki/triggerActivated","revid":352701,"updated":"2024-02-18T16:52:51Z","groups":["Triggers"],"status":"ok","replaced_by":[],"games":[{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma2","name":"Arma 2","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"global","effect":null,"server_exec":false},"exec":null,"description":"Returns true if the trigger has been activated.","syntaxes":[{"syntax":"triggerActivated trigger","since":null,"effect":null,"exec":null,"params":[{"name":"trigger","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"trigger: Object"}],"returns":{"type":"Boolean","types":["Boolean"],"description":null,"text":"Boolean"},"form":"unary","operator":null,"left":null,"right":{"text":"trigger","types":["Object"]}}],"examples":[{"text":"```sqf\nif (triggerActivated trg1) then { hint \"trigger trg1 activated!\" };\n```","code":["if (triggerActivated trg1) then { hint \"trigger trg1 activated!\" };"]}],"multiplayer":"> [!IMPORTANT]\n> The trigger could be local or remote but the result returned by this command will be for the trigger activated status on the client that executed the command.\n> See createTrigger for more information.","problems":null,"aliases":[],"see_also":["setTriggerActivation","triggerActivation","triggerInterval","setTriggerInterval","enableSimulation","simulationEnabled","createTrigger"],"notes":[{"user":"MisterGoodson","date":"2015-06-09T14:50:00Z","text":"If the trigger already activated at least once, triggerActivated will only return false if trigger is set to activate Repeatedly.\n\nIn other words, a trigger set to activate Once will always return true once activated at least once (even if trigger is no longer activated)."},{"user":"Killzone_Kid","date":"2020-08-13T10:50:00Z","text":"The engine does not provide a precise way of detecting which player activated the trigger.\nThe trigger has a default triggerInterval of ~0.5 seconds, so every half a second it checks if there is anyone in the zone.\nThere could be 100 people in the zone on the next scan, which one was the first? There is simply no data for this.\nYou can make an imprecise guess by taking 1st person from thisList or list. Also you should do it on server only trigger.\nThis will still not guarantee that person first on the list is the one who was first to activate trigger, but on balance will probably be the one."}],"categories":["Arma 2: New Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Triggers","Introduced with Arma 2 version 1.00","Scripting Commands","Take On Helicopters: Scripting Commands"]}