{"name":"alive","title":"alive","type":"command","url":"https://community.bistudio.com/wiki/alive","revid":337581,"updated":"2023-02-12T15:50:13Z","groups":["Object Manipulation"],"status":"ok","games":{"ofp":"1.00","ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp 1.00","arma3_since":"0.50","locality":{"argument":"global"},"description":"Check if given vehicle/person/building is alive (i.e. not dead or destroyed).","syntaxes":[{"syntax":"alive object","params":[{"name":"object","type":"Object","type_expr":"Object"}],"returns":{"type":"Boolean","type_expr":"Boolean","description":"true if alive, false if dead/destroyed"},"form":"unary","right":{"text":"object"}}],"examples":[{"text":"SQS:\n\n```sqs\n? not alive player : exit\n```","code":["? not alive player : exit"]},{"text":"SQF:\n\n```sqf\nif (!alive player) exitWith {};\n```","code":["if (!alive player) exitWith {};"]},{"code":["alive objNull; // returns false"]}],"see_also":["setDamage","damage","waterDamaged"],"notes":[{"user":"Pierre MGI","date":"2015-10-19T23:48:00Z","text":"Alive or not could be the question! in multi-player, missions come with respawn module(s). When a player is dead shot, `alive player` will return false, then almost immediately true if the \"revive\" respawn template is enabled, then could turn to false again if time for assistance is elapsed or if the player activates the respawn menu before; and finally true after player respawns.\nJust be aware that in that case (respawn + revive enabled), the status of the player is toggling: true → false → true → false → true. Then, alive status while player is waiting for being rescued could lead to some script errors as player is supposed to be alive but is in limbo and the dead entity \"player\" gets passed to server."}]}