+ fixed cargo check
+ remove lock/unlock options from vehicles after performing action
This commit is contained in:
vbawol
2013-02-20 12:59:03 -06:00
parent c0d38c824c
commit 16878f0e5a
7 changed files with 38 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
private["_vehicle"]; private ["_vehicle","_class","_maxMagazines","_maxWeapons","_maxBackpacks","_magazineCount","_weaponsCount","_backpackCount"];
_vehicle = _this select 3; _vehicle = _this select 3;
_class = typeOf _vehicle; _class = typeOf _vehicle;
@@ -13,12 +13,21 @@ _maxWeapons = getNumber (configFile >> "CfgVehicles" >> _class >> "transportMaxW
_maxBackpacks = getNumber (configFile >> "CfgVehicles" >> _class >> "transportmaxbackpacks"); _maxBackpacks = getNumber (configFile >> "CfgVehicles" >> _class >> "transportmaxbackpacks");
// Count and show magazines available space // Count and show magazines available space
_magazineCount = count (getMagazineCargo _vehicle); _magazineCount_raw = getMagazineCargo _vehicle;
// Count and show weapons available space // Count and show weapons available space
_weaponsCount = count (getWeaponCargo _vehicle); _weaponsCount_raw = getWeaponCargo _vehicle;
// Count and show backpacks available space // Count and show backpacks available space
_backpackCount = count (getBackpackCargo _vehicle); _backpackCount_raw = getBackpackCargo _vehicle;
cutText [format[("Magazine %1 / %2 - Weapons %3 / %4 - Backpacks %5 / %6"),_magazineCount,_maxMagazines,_weaponsCount,_maxWeapons,_backpackCount,_maxBackpacks], "PLAIN DOWN"]; // Count and show magazines available space
_magazineCount = (_magazineCount_raw select 1) call vehicle_gear_count;
// Count and show weapons available space
_weaponsCount = (_weaponsCount_raw select 1) call vehicle_gear_count;
// Count and show weapons available space
_backpackCount = (_backpackCount_raw select 1) call vehicle_gear_count;
TitleText [format[("Magazine %1 / %2 - Weapons %3 / %4 - Backpacks %5 / %6"),_magazineCount,_maxMagazines,_weaponsCount,_maxWeapons,_backpackCount,_maxBackpacks], "PLAIN DOWN"];

View File

@@ -1,6 +1,9 @@
private["_vehicle"]; private["_vehicle"];
_vehicle = _this select 3; _vehicle = _this select 3;
{player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
s_player_lockUnlock_crtl = -1;
_vehicle setVehicleInit "this lock true; this lockCargo true;"; _vehicle setVehicleInit "this lock true; this lockCargo true;";
processInitCommands; processInitCommands;

View File

@@ -1,6 +1,11 @@
private["_vehicle"]; private["_vehicle"];
_vehicle = _this select 3; _vehicle = _this select 3;
{player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
s_player_lockUnlock_crtl = -1;
_vehicle setVehicleInit "this lock false; this lockCargo false;"; _vehicle setVehicleInit "this lock false; this lockCargo false;";
processInitCommands; processInitCommands;

View File

@@ -111,7 +111,7 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 6))
s_player_lockunlock set [count s_player_lockunlock,_Unlock]; s_player_lockunlock set [count s_player_lockunlock,_Unlock];
s_player_lockUnlock_crtl = 1; s_player_lockUnlock_crtl = 1;
} else { } else {
_Unlock = player addAction ["Vehicle Locked", "",cursorTarget, 2, true, true, "", ""]; _Unlock = player addAction ["<t color='#ff0000'>Vehicle Locked</t>", "",cursorTarget, 2, true, true, "", ""];
s_player_lockunlock set [count s_player_lockunlock,_Unlock]; s_player_lockunlock set [count s_player_lockunlock,_Unlock];
s_player_lockUnlock_crtl = 1; s_player_lockUnlock_crtl = 1;
}; };
@@ -144,7 +144,7 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 6))
if((_isVehicle or _isTent) and _canDo and !_isMan) then { if((_isVehicle or _isTent) and _canDo and !_isMan) then {
if (s_player_checkGear < 0) then { if (s_player_checkGear < 0) then {
s_player_checkGear = player addAction ["Cargo Check", "\z\addons\dayz_code\actions\checkcargo.sqf",cursorTarget, 1, true, true, "", ""]; s_player_checkGear = player addAction ["Cargo Check", "\z\addons\dayz_code\actions\cargocheck.sqf",cursorTarget, 1, true, true, "", ""];
}; };
} else { } else {
player removeAction s_player_checkGear; player removeAction s_player_checkGear;
@@ -448,6 +448,9 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 6))
//{player removeAction _x} forEach s_player_bank;s_player_bank = []; //{player removeAction _x} forEach s_player_bank;s_player_bank = [];
{player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = []; {player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
player removeAction s_player_checkGear;
s_player_checkGear = -1;
//s_player_madsci_crtl = -1; //s_player_madsci_crtl = -1;
s_player_parts_crtl = -1; s_player_parts_crtl = -1;

View File

@@ -33,7 +33,7 @@ class CfgMods
hidePicture = 0; hidePicture = 0;
hideName = 0; hideName = 0;
action = "http://www.dayzepoch.com"; action = "http://www.dayzepoch.com";
version = "0.97"; version = "0.973";
hiveVersion = 0.96; //0.93 hiveVersion = 0.96; //0.93
}; };
}; };

View File

@@ -219,6 +219,15 @@ if (!isDedicated) then {
hint format["Config: %5\nEmpty: %1\nNeeded: %2\nDiff: %3\nSuccess: %4",_empty,_needed,_diff,_success,_config]; hint format["Config: %5\nEmpty: %1\nNeeded: %2\nDiff: %3\nSuccess: %4",_empty,_needed,_diff,_success,_config];
_success _success
}; };
vehicle_gear_count = {
private["_counter"];
_counter = 0;
{
_counter = _counter + _x;
} forEach _this;
_counter
};
dayz_spaceInterrupt = { dayz_spaceInterrupt = {
private ["_dikCode", "_handled"]; private ["_dikCode", "_handled"];

View File

@@ -87,7 +87,7 @@ class RscDisplayMain : RscStandardDisplay
class DAYZ_Version : CA_Version class DAYZ_Version : CA_Version
{ {
idc = -1; idc = -1;
text = "DayZ Epoch 0.97 (1.7.5.1)"; text = "DayZ Epoch 0.973 (1.7.5.1)";
y = "(SafeZoneH + SafeZoneY) - (1 - 0.95)"; y = "(SafeZoneH + SafeZoneY) - (1 - 0.95)";
}; };
class CA_TitleMainMenu; class CA_TitleMainMenu;