GMS_RC/GMS/Compiles/Units/GMS_fnc_spawnCharacter.sqf
2022-07-31 14:58:38 -04:00

44 lines
1.3 KiB
Plaintext

/*
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"
params["_coords","_charConfigs"];
private["_char","_charGroup"];
_charConfigs params["_classname","_posn","_dir","_simDamg","_animations","_headgear","_uniforms"];
_charGroup = createGroup [GMSCore_side, true];
_char = _charGroup createUnit [_classname,[0,0,0], [], 0, "NONE"];
_char setCaptive true;
if (count _headgear > 0) then
{
_char addHeadgear (selectRandom(_headgear));
};
if (count _uniforms > 0) then
{
_char forceAddUniform selectRandom(_uniforms);
};
_posn = (_coords vectorAdd _posn);
_char setPos [_posn select 0, _posn select 1, 0];
if (GMSCore_modtype isEqualTo "Epoch") then {_char setVariable ["LAST_CHECK",28800,true]};
_char setPos (_posn);
_char setDir (_dir);
removeAllWeapons _char;
_char setVariable ["BIS_enableRandomization", false];
_char setVariable ["BIS_fnc_animalBehaviour_disable", true];
_char disableAI "ALL";
_char enableAI "ANIM";
_char enableAI "MOVE";
_char allowDamage true;
_char enableSimulationGlobal true;
_char setVariable["GMSAnimations",_animations,true];
_char setUnitPos "UP";
_char