Advanced trading tidying, spelling fixes, private fixes and string fixes (#1716)

* Advanced trading tidying, spelling fixes, private fixes and string fixes.

Fixes snap building issue with metal floors
Fixed spelling mistakes in various scripts
Fixed formatting uglyness in various scripts
Fixed invalid private lines in various scripts
Changed Advanced trading so buying worked more like selling, You can't
select backpack if you don't have a pack nor can you select a vehicle if
you don't have a vehicle.
Removed some redundant strings from Advanced trading and changed a few
of the strings to be more englishy
Removed the ability to buy a backpack into your backpack (You cant do
this anyway)
Fixed a bug where if you had nothing in your backpack it would break the
checkArrayInConfig script so the titlebar would not refresh correctly
Removed slot counts on no backpack and no vehicle (No need for it, just
clutter)
Moved backpack/vehicle checking to z_at_getContainer.sqf

* Last part of tidyness fixes

Last part of tidyness fixes

* Actual backpack fix

Lets actually fix the buying backpack into backpack or backpack when you
already have one.

* Missing from commit

Missing from commit
This commit is contained in:
oiad
2016-07-31 02:03:00 +12:00
committed by ebaydayz
parent 1d2fc3b266
commit 7c4d25ef1a
59 changed files with 536 additions and 538 deletions

View File

@@ -1,7 +1,7 @@
/* ----------------------------------------------------------------------------
Examples:
_result = [_backpack, ["SmokeShell","M16_AMMO"],["M16","M16","M240"],["backpack1","backpack2"]] call ZUPA_fnc_removeWeaponsAndMagazinesCargo;
_result == [[1,0,0,1,1,1,0],[1,0,0,1],[1,0]]; // 1 = success, 0 = fail ->( item was not in cargo)
_result == [[1,0,0,1,1,1,0],[1,0,0,1],[1,0]]; // 1 = success, 0 = fail ->(item was not in cargo)
Author:
Zupa 2014-09-30
@@ -14,7 +14,7 @@ _weaps = _this select 2;
_bags = [];
_vehInfo = [];
if(count _this > 3) then {
if (count _this > 3) then {
if (count (_this select 3) > 0) then {
if (typeName ((_this select 3) select 0) == "STRING") then {
_bags = _this select 3;
@@ -46,31 +46,31 @@ _unit_allBags_count = _unit_allBags select 1;
clearMagazineCargoGlobal _unit;
clearWeaponCargoGlobal _unit;
if( count _bags > 0 )then{
if (count _bags > 0) then {
clearBackpackCargoGlobal _unit;
};
{
_counter = 0 ;
while{ _counter < ( _unit_allItems_count select _forEachIndex)}do{
_normalItems set [count(_normalItems),_x];
_counter = _counter + 1;
while {_counter < (_unit_allItems_count select _forEachIndex)} do {
_normalItems set [count(_normalItems),_x];
_counter = _counter + 1;
};
}forEach _unit_allItems_types;
} forEach _unit_allItems_types;
{
_counter = 0 ;
while{ _counter < ( _unit_allWeaps_count select _forEachIndex)}do{
_normalWeaps set [count(_normalWeaps),_x];
_counter = _counter + 1;
while {_counter < (_unit_allWeaps_count select _forEachIndex)} do {
_normalWeaps set [count(_normalWeaps),_x];
_counter = _counter + 1;
};
}forEach _unit_allWeaps_types;
} forEach _unit_allWeaps_types;
{
_counter = 0 ;
while{ _counter < ( _unit_allBags_count select _forEachIndex)}do{
_normalBagss set [count(_normalBags),_x];
_counter = _counter + 1;
while {_counter < (_unit_allBags_count select _forEachIndex)} do {
_normalBagss set [count(_normalBags),_x];
_counter = _counter + 1;
};
}forEach _unit_allBags_types;
} forEach _unit_allBags_types;
_returnVar = [];
_returnMag = [];
@@ -78,45 +78,45 @@ _returnWeap = [];
_returnBag = [];
{
_inCargo = _normalItems find _x;
if(_inCargo > -1)then{
if (_inCargo > -1) then {
_normalItems set [_inCargo, "soldItem"];
_returnMag set [count(_returnMag),1];
}else{
} else {
_returnMag set [count(_returnMag),0];
};
}count _items;
} count _items;
_normalItems = _normalItems - ["soldItem"];
{
_unit addMagazineCargoGlobal [_x, 1];
}count _normalItems;
} count _normalItems;
{
_inCargo = _normalBags find _x;
if(_inCargo > -1)then{
if (_inCargo > -1) then {
_normalBags set [_inCargo, "soldItem"];
_returnBag set [count(_returnBag),1];
}else{
} else {
_returnBag set [count(_returnBag),0];
};
}count _bags;
} count _bags;
{
_unit addBackpackCargoGlobal [_x, 1];
}count _normalBags;
} count _normalBags;
{
_inCargo = _normalWeaps find _x;
if(_inCargo > -1)then{
if (_inCargo > -1) then {
_normalWeaps set [_inCargo, "soldItem"];
_returnWeap set [count(_returnWeap),1];
}else{
} else {
_returnWeap set [count(_returnWeap),0];
};
}count _weaps;
} count _weaps;
_normalWeaps = _normalWeaps - ["soldItem"];
{
_unit addWeaponCargoGlobal [_x, 1];
}count _normalWeaps;
} count _normalWeaps;
_normalWeaps = _normalWeaps - ["soldItem"];
if (count _vehInfo > 0) then {
@@ -130,4 +130,4 @@ _returnVar set [0,_returnMag];
_returnVar set [1,_returnWeap];
_returnVar set [2,_returnBag];
_returnVar;
_returnVar;