mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-19 18:06:32 +03:00
0.1
This commit is contained in:
28
dayz_code/actions/player_setTrap.sqf
Normal file
28
dayz_code/actions/player_setTrap.sqf
Normal file
@@ -0,0 +1,28 @@
|
||||
private["_item"];
|
||||
_item = _this;
|
||||
_config = configFile >> "CfgWeapons" >> _item;
|
||||
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
|
||||
|
||||
call gear_ui_init;
|
||||
|
||||
_classname = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "create");
|
||||
_text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
|
||||
_consume = ([] + getArray (_config >> "magazines")) select 0;
|
||||
|
||||
_hastrapitem = _this in magazines player;
|
||||
|
||||
if (!_hastrapitem) exitWith {cutText [format[(localize "str_player_31"),_text,"place"] , "PLAIN DOWN"]};
|
||||
|
||||
player removeMagazine _item;
|
||||
_location = getPosATL player;
|
||||
|
||||
player playActionNow "PutDown";
|
||||
sleep 1;
|
||||
|
||||
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
|
||||
_object setDir _dir;
|
||||
player reveal _object;
|
||||
|
||||
cutText [format[localize "str_build_01",_text], "PLAIN DOWN"];
|
||||
Reference in New Issue
Block a user