GMS_RC/@GMS/addons/GMS/Compiles/Units/fn_deleteAI.sqf
2023-09-23 10:05:31 -04:00

30 lines
614 B
Plaintext

/*
Delete a unit.
by Ghostrider
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\GMS\Compiles\Init\GMS_defines.hpp"
private["_ai","_group"];
params["_unit"];
{
_unit removeAllEventHandlers _x;
}forEach ["reloaded"];
{
_unit removeAllMPEventHandlers _x;
} forEach ["MPKilled","MPHit"];
_group = (group _unit);
deleteVehicle _unit;
if (count units _group isEqualTo 0) then
{
deletegroup _group;
};