Advanced trading fixes, server_handleSafeGear human readibility (#1777)

* Advanced trading fixes

Fixes a few issues and a dupe with advanced trading as well as some
localization of where a vehicle key is going.

Z_at_buyItems: Now adds localization for the key getting added to your
toolbelt, backpack and vehicle, this stops players thinking they didn't
get a key when infact it was added to their backpack/vehicle.

Z_at_canAfford.sqf: This fixes a dupe from a bad copy paste for whomever
wrote this script, it was using _backpackMoney in the
z_allowTakingMoneyFromVehicle part, changed to the proper variable
_vehicleMoney.

z_at_fillBuyableList.sqf: this fixes a bug where a vehicle would show
green even when it isn't local, just basically added more checking to
make sure the vehicle it's making green in the list is a) local, b)
alive and that the typeOf == _name.

z_at_logTrade.sqf: fixes some tidyness.

advancedTrading/init.sqf: adds a z_checkCloseVehicle call otherwise even
with Z_AllowTakingMoneyFromVehicle = true it will not get currency from
your vehicle until you clicked on the "Vehicle" tab.

dayz_server/server_tradeObject.sqf: More tidying as per the
z_at_logTrade and removes the useless Player:, as it is obvious a player
has bought something not an AI.

dayz_server/server_handleSafeGear.sqf: Makes the diag_log at the end
more human readable with GPS coordinates as well as the lock code for
the safe or the lockbox.

* advanced trading fixes. I hate you github

WHY U GET MISSED?? STUPID GITHUB.

* snappoints changes

Fixes the issue @SmokeyBR reported
https://github.com/EpochModTeam/DayZ-Epoch/issues/1766#issuecomment-253864795
Adds all floor types to snap list for all barriers so you can snap a
sandbag etc to a floor instead of manually lining it up
This commit is contained in:
oiad
2016-10-26 03:10:48 +10:00
committed by ebaydayz
parent 56abe26b92
commit bef2506653
11 changed files with 93 additions and 41 deletions

View File

@@ -1,5 +1,4 @@
private ["_player","_obj","_objectID","_objectUID","_statusText","_puid","_status","_clientID","_type","_lockedClass","_unlockedClass","_packedClass",
"_name","_pos","_dir","_vector","_charID","_ownerID","_weapons","_magazines","_backpacks","_holder"];
private ["_backpacks","_charID","_clientID","_dir","_dllcall","_holder","_lockBoxes","_lockCode","_lockColor","_lockedClass","_magazines","_name","_obj","_objectID","_objectUID","_ownerID","_packedClass","_player","_playerUID","_pos","_status","_statusText","_type","_unlockedClass","_vector","_weapons"];
_player = _this select 0;
_obj = _this select 1;
@@ -19,7 +18,7 @@ _ownerID = _obj getVariable ["ownerPUID","0"];
if (isNull _player) then {diag_log "ERROR: server_handleSafeGear called with Null player object";};
_clientID = owner _player;
_puid = getPlayerUID _player;
_playerUID = getPlayerUID _player;
_statusText = switch (_status) do {
case 0: {"UNLOCKED"};
@@ -28,7 +27,7 @@ _statusText = switch (_status) do {
};
if (isNull _obj) exitWith {
diag_log format["ERROR: server_handleSafeGear called with Null safe object by %1(%2). %3 attempt failed.",_name,_puid,_statusText];
diag_log format["ERROR: server_handleSafeGear called with Null safe object by %1(%2). %3 attempt failed.",_name,_playerUID,_statusText];
dze_waiting = "fail";
_clientID publicVariableClient "dze_waiting";
};
@@ -106,11 +105,27 @@ switch (_status) do {
_type = switch _type do {
case "VaultStorage";
case "VaultStorageLocked": {"Safe"};
case "VaultStorageLocked": {
_lockCode = _charID;
"Safe"
};
case "LockboxStorage";
case "LockboxStorageLocked": {"LockBox"};
case "LockboxStorageLocked": {
_lockBoxes = ["LockboxStorage","LockboxStorageLocked"];
if (_type in _lockBoxes) then {
_lockCode = parseNumber _charID;
_lockCode = _lockCode - 10000;
if (_lockCode <= 99) then { _lockColor = "Red"; };
if (_lockCode >= 100 && _lockCode <= 199) then { _lockColor = "Green"; _lockCode = _lockCode - 100; };
if (_lockCode >= 200) then { _lockColor = "Blue"; _lockCode = _lockCode - 200; };
if (_lockCode <= 9) then { _lockCode = format["0%1", _lockCode]; };
_lockCode = format ["%1%2",_lockColor,_lockCode];
};
"LockBox"
};
};
diag_log format["%6 %5: ObjID:%1 ObjUID:%2 CharID:%7 OwnerID:%8 BY %3(%4)",_objectID,_objectUID,_name,_puid,_statusText,_type,_charID,_ownerID];
diag_log format["%1 (%2) %3 %4 with code: %5 @%6 (%7)",_name,_playerUID,_statusText,_type,_lockCode,mapGridPosition _pos,_pos];
dze_waiting = "success";
_clientID publicVariableClient "dze_waiting";