Config to enable / disable needed items for actions

Also increased needed "bullets" to inflame
This commit is contained in:
He-Man 2018-03-16 22:11:52 +01:00
parent 353960e38a
commit 25d2f2b24f
3 changed files with 53 additions and 39 deletions

View File

@ -272,17 +272,19 @@ if (_dikCode in (actionKeys "NightVision")) then {
if(!_ctrl && (_dikCode in (actionKeys "HeliRopeAction")))then{ if(!_ctrl && (_dikCode in (actionKeys "HeliRopeAction")))then{
_msg = ""; _msg = "";
if(EPOCH_ArmaSlingLoad)then{ if(EPOCH_ArmaSlingLoad)then{
if(driver vehicle player isEqualTo player)then{ if (["CfgEpochClient", "ActionHookRope", true] call EPOCH_fnc_returnConfigEntryV2) then {
_slung = ropeAttachedObjects vehicle player; if(driver vehicle player isEqualTo player)then{
if(_slung isEqualTo [])then{ _slung = ropeAttachedObjects vehicle player;
if!('ItemRope' in magazines player) then { if(_slung isEqualTo [])then{
_msg = "You need rope to hook"; if!('ItemRope' in magazines player) then {
_handled = true; _msg = "You need rope to hook";
_handled = true;
}else{
player removeItem 'ItemRope';
};
}else{ }else{
player removeItem 'ItemRope'; player addItem 'ItemRope';
}; };
}else{
player addItem 'ItemRope';
}; };
}; };
}else{ }else{
@ -293,5 +295,4 @@ if(!_ctrl && (_dikCode in (actionKeys "HeliRopeAction")))then{
[_msg,5,[[0,0,0,0.2],[1,1,1,1]]] call Epoch_message_stack; [_msg,5,[[0,0,0,0.2],[1,1,1,1]]] call Epoch_message_stack;
}; };
}; };
_handled _handled

View File

@ -26,39 +26,46 @@ params [
_blocked = false; _blocked = false;
_msg = ''; _msg = '';
_type = typeOf _actionObj; _type = typeOf _actionObj;
switch(true)do{ _config = 'CfgEpochClient' call EPOCH_returnConfig;
case (_actionName isEqualTo 'FireInflame'): { switch(_actionName)do{
if!('lighter_epoch' in magazines player) then { case 'FireInflame': {
_msg = 'You need a lighter'; if (["CfgEpochClient", "ActionFireOnLighter", true] call EPOCH_fnc_returnConfigEntryV2) then {
_blocked = true; if!('lighter_epoch' in magazines player) then {
}else{ _msg = 'You need a lighter';
[player,'lighter_epoch',-1] call EPOCH_usedItemRepack;
//[_actionObj] remoteExec ['EPOCH_server_addToFireSystem',2];
};
};
case (_actionName isEqualTo 'FirePutDown'): {
if(_type isEqualTo 'BurnBarrel_EPOCH')then{
if!('ItemFireExtinguisher' in magazines player) then {
_msg = 'You need an extinguisher';
_blocked = true; _blocked = true;
}else{ }else{
[player,'ItemFireExtinguisher',-1] call EPOCH_usedItemRepack; [player,'lighter_epoch',-5] call EPOCH_usedItemRepack;
//[_actionObj] remoteExec ['EPOCH_server_addToFireSystem',2];
}; };
}; };
}; };
case (_actionName isEqualTo 'HookCargo'): { case 'FirePutDown': {
if(EPOCH_ArmaSlingLoad)then{ if (["CfgEpochClient", "ActionBurnBarrelOffExtinguisher", true] call EPOCH_fnc_returnConfigEntryV2) then {
if(driver vehicle player isEqualTo player)then{ if(_type isEqualTo 'BurnBarrel_EPOCH')then{
_slung = ropeAttachedObjects vehicle player; if!('ItemFireExtinguisher' in magazines player) then {
if(_slung isEqualTo [])then{ _msg = 'You need an extinguisher';
if!('ItemRope' in magazines player) then { _blocked = true;
_msg = 'You need rope to hook';
_blocked = true;
}else{
player removeItem 'ItemRope';
};
}else{ }else{
player addItem 'ItemRope'; [player,'ItemFireExtinguisher',-1] call EPOCH_usedItemRepack;
};
};
};
};
case 'HookCargo': {
if(EPOCH_ArmaSlingLoad)then{
if (["CfgEpochClient", "ActionHookRope", true] call EPOCH_fnc_returnConfigEntryV2) then {
if(driver vehicle player isEqualTo player)then{
_slung = ropeAttachedObjects vehicle player;
if(_slung isEqualTo [])then{
if!('ItemRope' in magazines player) then {
_msg = 'You need rope to hook';
_blocked = true;
}else{
player removeItem 'ItemRope';
};
}else{
player addItem 'ItemRope';
};
}; };
}; };
}else{ }else{
@ -66,9 +73,11 @@ switch(true)do{
_blocked = true; _blocked = true;
}; };
}; };
case (_actionName isEqualTo 'UnhookCargo'): { case 'UnhookCargo': {
if(EPOCH_ArmaSlingLoad)then{ if(EPOCH_ArmaSlingLoad)then{
player addItem 'ItemRope'; if (["CfgEpochClient", "ActionHookRope", true] call EPOCH_fnc_returnConfigEntryV2) then {
player addItem 'ItemRope';
};
}else{ }else{
_msg = 'Unhook Malfunction, overrode by R3F or AdvSlingLoad'; _msg = 'Unhook Malfunction, overrode by R3F or AdvSlingLoad';
_blocked = true; _blocked = true;

View File

@ -58,6 +58,10 @@ class CfgEpochClient
AtmBlockedAtPlot = "true"; // Block ATM's in Plotpole-Range AtmBlockedAtPlot = "true"; // Block ATM's in Plotpole-Range
disableRemoteSensors = "true"; // disableRemoteSensors true/false disableRemoteSensors = "true"; // disableRemoteSensors true/false
ActionFireOnLighter = "true"; // Lighter is needed to inflame fires
ActionBurnBarrelOffExtinguisher = "true"; // FireExtinguisher is needed to put off fires
ActionHookRope = "true"; // Rope is needed to hook vehicles (get back on release)
epochMessageBackgroundCol[] = {0,0,0,0.2}; //Epoch_message background color (format: {R,G,B,A}) epochMessageBackgroundCol[] = {0,0,0,0.2}; //Epoch_message background color (format: {R,G,B,A})
epochMessageTextCol[] = {1,1,1,0.95}; //Epoch_message text color (format: {R,G,B,A}) epochMessageTextCol[] = {1,1,1,0.95}; //Epoch_message text color (format: {R,G,B,A})