Update compiles - 2 more files to do

fn_selfActions.sqf
player_updateGui.sqf
This commit is contained in:
icomrade
2016-02-29 00:26:12 -05:00
parent a83909b918
commit b96cd2d971
67 changed files with 3886 additions and 1212 deletions

View File

@@ -0,0 +1,30 @@
private ["_item","_pos","_nearByPile","_holder"];
//Radius to search for holder
#define PILE_SEARCH_RADIUS 2
//Location to offset the holder
#define PILE_PLAYER_OFFSET [0,0,0]
_item = _this;
_holder = objNull;
//Lets get the location of the player in the world
_pos = player modeltoWorld PILE_PLAYER_OFFSET;
//Check if a holder is close by the player.
_nearByPile= nearestObjects [_pos, ["WeaponHolder","WeaponHolderBase"],PILE_SEARCH_RADIUS];
if (count _nearByPile == 0) then {
_holder = createVehicle ["WeaponHolder", _pos, [], 0, "CAN_COLLIDE"];
} else {
_holder = _nearByPile select 0;
};
//Add the item to the newly created holder or to the new holder.
_holder addMagazineCargoGlobal [_item,1];
//Make sure the holder spawns behind the physical location of the player
_holder setPosATL (player modeltoWorld PILE_PLAYER_OFFSET);
//Revel the item
player reveal _holder;