Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ******************************************************************************************
- // * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
- // ******************************************************************************************
- // @file Name: createRandomSoldier.sqf
- /*
- * Creates a random civilian soldier.
- *
- * Arguments: [ position, group, init, skill, rank]: Array
- * position: Position - Location unit is created at.
- * group: Group - Existing group new unit will join.
- * init: String - (optional, default "") Command to be executed upon creation of unit. Parameter this is set to the created unit and passed to the code.
- * skill: Number - (optional, default 0.5)
- * rank: String - (optional, default "PRIVATE")
- */
- if (!isServer) exitWith {};
- private ["_group", "_position", "_rank", "_soldier"];
- _group = _this select 0;
- _position = _this select 1;
- _rank = param [2, "", [""]];
- _soldier = _group createUnit [_soldier call randomSoldierLoadOut, _position, [], 0, "NONE"];
- if (_rank != "") then
- {
- _soldier setRank _rank;
- };
- _soldier spawn refillPrimaryAmmo;
- _soldier spawn addMilCap;
- _soldier call setMissionSkill;
- _soldier addEventHandler ["Killed", server_playerDied];
- _soldier
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement