scriptName "Functions\misc\fn_selfActions.sqf";[/COLOR]
[COLOR=#808080]/***********************************************************[/COLOR]
[COLOR=#808080] ADD ACTIONS FOR SELF[/COLOR]
[COLOR=#808080] - Function[/COLOR]
[COLOR=#808080] - [] call fnc_usec_selfActions;[/COLOR]
[COLOR=#808080]************************************************************/[/COLOR]
[COLOR=#808080]private["_isStash","_vehicle","_inVehicle","_bag","_classbag","_isWater","_hasAntiB","_hasFuelE","_hasFuel5","_hasbottleitem","_hastinitem","_hasKnife","_hasToolbox","_hasTent","_onLadder","_nearLight","_canPickLight","_canDo","_text","_isHarvested","_isVehicle","_isVehicletype","_isMan","_ownerID","_isAnimal","_isDog","_isZombie","_isDestructable","_isTent","_isFuel","_isAlive","_canmove","_rawmeat","_hasRawMeat","_allFixed","_hitpoints","_damage","_part","_cmpt","_damagePercent","_color","_string","_handle","_dogHandle","_lieDown","_warn","_dog","_speed"];[/COLOR]
[COLOR=#808080]_vehicle = vehicle player;[/COLOR]
[COLOR=#808080]_inVehicle = (_vehicle != player);[/COLOR]
[COLOR=#808080]_bag = unitBackpack player;[/COLOR]
[COLOR=#808080]_classbag = typeOf _bag;[/COLOR]
[COLOR=#808080]_isWater = (surfaceIsWater (position player)) or dayz_isSwimming;[/COLOR]
[COLOR=#808080]_hasAntiB = "ItemAntibiotic" in magazines player;[/COLOR]
[COLOR=#808080]_hasFuelE20 = "ItemJerrycanEmpty" in magazines player;[/COLOR]
[COLOR=#808080]_hasFuelE5 = "ItemFuelcanEmpty" in magazines player;[/COLOR]
[COLOR=#808080]//boiled Water[/COLOR]
[COLOR=#808080]_hasbottleitem = "ItemWaterbottle" in magazines player;[/COLOR]
[COLOR=#808080]_hastinitem = false;[/COLOR]
[COLOR=#808080]{[/COLOR]
[COLOR=#808080] if (_x in magazines player) then {[/COLOR]
[COLOR=#808080] _hastinitem = true;[/COLOR]
[COLOR=#808080] };[/COLOR]
[COLOR=#808080]} forEach boil_tin_cans;[/COLOR]
[COLOR=#808080]_hasKnife = "ItemKnife" in items player;[/COLOR]
[COLOR=#808080]_hasMatches = "ItemMatchbox" in items player;[/COLOR]
[COLOR=#808080]_hasToolbox = "ItemToolbox" in items player;[/COLOR]
[COLOR=#808080]//_hasTent = "ItemTent" in items player;[/COLOR]
[COLOR=#808080]_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;[/COLOR]
[COLOR=#808080]_nearLight = nearestObject [player,"LitObject"];[/COLOR]
[COLOR=#808080]_canPickLight = false;[/COLOR]
[COLOR=#808080]if (!isNull _nearLight) then {[/COLOR]
[COLOR=#808080] if (_nearLight distance player < 4) then {[/COLOR]
[COLOR=#808080] _canPickLight = isNull (_nearLight getVariable ["owner",objNull]);[/COLOR]
[COLOR=#808080] };[/COLOR]
[COLOR=#808080]};[/COLOR]
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
if((speed player <= 1) && cursorTarget isKindOf "Old_bike_TK_CIV_EP1" && _canDo) then {
if (s_player_deploybike2 < 0) then {
s_player_deploybike2 = player addaction[("<t color=""#007ab7"">" + ("Re-Pack Bike") +"</t>"),"spawnbike\bike2.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploybike2;
s_player_deploybike2 = -1;
};
if((speed player <= 1) && _hasToolbox && _canDo) then {
if (s_player_deploybike < 0) then {
s_player_deploybike = player addaction[("<t color=""#007ab7"">" + ("Deploy Bike (will loose Toolbox)") +"</t>"),"spawnbike\bike.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploybike;
s_player_deploybike = -1;
};
if((speed player <= 1) && cursorTarget isKindOf "TT650_Civ" && _canDo) then {
if (s_player_deploybike4 < 0) then {
s_player_deploybike4 = player addaction[("<t color=""#007ab7"">" + ("Re-Pack Motorcycle") +"</t>"),"spawnbike\bike4.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploybike4;
s_player_deploybike4 = -1;
};
if((speed player <= 1) && cursorTarget isKindOf "Old_bike_TK_CIV_EP1" && _canDo) then {
if (s_player_deploybike3 < 0) then {
s_player_deploybike3 = player addaction[("<t color=""#007ab7"">" + ("Upgrade to Motorcycle") +"</t>"),"spawnbike\bike3.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploybike3;
s_player_deploybike3 = -1;
};
if((speed player <= 1) && cursorTarget isKindOf "CSJ_GyroC" && _canDo) then {
if (s_player_deploybike6 < 0) then {
s_player_deploybike6 = player addaction[("<t color=""#007ab7"">" + ("Re-Pack GyroCopter") +"</t>"),"spawnbike\bike6.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploybike6;
s_player_deploybike6 = -1;
};
if((speed player <= 1) && cursorTarget isKindOf "TT650_Civ" && _canDo) then {
if (s_player_deploybike5 < 0) then {
s_player_deploybike5 = player addaction[("<t color=""#007ab7"">" + ("Upgrade to GyroCopter") +"</t>"),"spawnbike\bike5.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deploybike5;
s_player_deploybike5 = -1;
};
[COLOR=#ffff00]_isCraft = cursorTarget isKindOf "Land_Chest_EP1";[/COLOR]
[COLOR=#ffff00]_insight = (count ((position player) nearObjects ["Land_Chest_EP1", 5]));[/COLOR]
[COLOR=#ffff00]_isnear = _insight > 0;[/COLOR]
[COLOR=#ffff00]if ((speed player <= 1) && _isCraft && _isnear && _canDo) then[/COLOR]
[COLOR=#ffff00] {[/COLOR]
[COLOR=#ffff00] if (s_player_craftBullet < 0) then {[/COLOR]
[COLOR=#ffff00] s_player_craftBullet = player addAction [("<t color=""#c70000"">" + ("Special OG-Crafting") +"</t>"),"fixes\craft\excute.sqf",cursorTarget, 0, false, true, "",""];[/COLOR]
[COLOR=#ffff00] };[/COLOR]
[COLOR=#ffff00] } else[/COLOR]
[COLOR=#ffff00] {[/COLOR]
[COLOR=#ffff00] player removeAction s_player_craftBullet;[/COLOR]
[COLOR=#ffff00] s_player_craftBullet = -1;[/COLOR]
[COLOR=#ffff00] };[/COLOR]
//Krixes Self Bloodbag
_mags = magazines player;
// Krixes Self Bloodbag
if ("ItemBloodbag" in _mags) then {
hasBagItem = true;
} else { hasBagItem = false;};
if((speed player <= 1) && hasBagItem && _canDo) then {
if (s_player_selfBloodbag < 0) then {
s_player_selfBloodbag = player addaction[("<t color=""#c70000"">" + ("Self Bloodbag") +"</t>"),"\z\addons\dayz_code\actions\player_selfbloodbag.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_selfBloodbag;
s_player_selfBloodbag = -1;
};