mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-18 09:32:02 +03:00
Init more or less done
This commit is contained in:
@@ -7,6 +7,7 @@ _name = getText (configFile >> _type >> _classname >> "displayName");
|
||||
|
||||
// Exit if player zombie
|
||||
if(player isKindOf "PZombie_VB") exitWith {};
|
||||
pickupInit = true;
|
||||
|
||||
actionMonitor = {
|
||||
private ["_holder","_type","_classname","_name","_action","_distance","_run","_timeout","_null"];
|
||||
@@ -25,19 +26,20 @@ actionMonitor = {
|
||||
_distance = player distance _holder;
|
||||
// Add action to player
|
||||
if ((_distance < 1.75) && (_action == -1)) then {
|
||||
_action = player addAction [format[(localize "STR_DAYZ_CODE_1"),_name], "\z\addons\dayz_code\actions\object_pickup.sqf",[_type,_classname,_holder], 20, true, true];
|
||||
_action = player addAction [format[(localize "str_init_take"),_name], "\z\addons\dayz_code\actions\object_pickup.sqf",[_type,_classname,_holder], 20, true, true];
|
||||
player reveal _holder;
|
||||
_timeout = 0.3;
|
||||
};
|
||||
// Remove action from player
|
||||
if ((_distance >= 1.75) && (_action != -1)) then {
|
||||
player removeAction _action;
|
||||
pickupInit = true;
|
||||
_action = -1;
|
||||
_timeout = 2;
|
||||
};
|
||||
// Stop the loop && fall back to old code
|
||||
if (_distance > 100) then {
|
||||
_null = _holder addAction [format[(localize "STR_DAYZ_CODE_1"),_name], "\z\addons\dayz_code\actions\object_pickup.sqf",[_type,_classname,_holder], 20, true, true];
|
||||
null = _holder addAction [format[(localize "str_init_take"),_name], "\z\addons\dayz_code\actions\object_pickup.sqf",[_type,_classname,_holder], 20, true, true];
|
||||
player reveal _holder;
|
||||
_run = false;
|
||||
_timeout = 0;
|
||||
@@ -46,6 +48,7 @@ actionMonitor = {
|
||||
if (_action != -1) then {
|
||||
player removeAction _action;
|
||||
_action = -1;
|
||||
pickupInit = true;
|
||||
};
|
||||
_timeout = 0;
|
||||
_run = false;
|
||||
@@ -57,6 +60,7 @@ actionMonitor = {
|
||||
if (_classname == "WoodenArrow") then {
|
||||
[_holder,_type,_classname,_name] spawn actionMonitor;
|
||||
} else {
|
||||
_holder addAction [format[(localize "STR_DAYZ_CODE_1"),_name], "\z\addons\dayz_code\actions\object_pickup.sqf",[_type,_classname,_holder], 20, true, true, "", "DZE_CanPickup"];
|
||||
s_player_holderPickup = _holder addAction [format[(localize "str_init_take"),_name], "\z\addons\dayz_code\actions\object_pickup.sqf",[_type,_classname,_holder], 20, true, true];
|
||||
player reveal _holder;
|
||||
pickupInit = true;
|
||||
};
|
||||
Reference in New Issue
Block a user