mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 20:13:13 +03:00
Update server_tradeObject.sqf
- Remove publicVariableClient "dayzTradeResult" this is no longer needed. - Add a dupe check made by @oiad - Switch from private to local which suits better in Arma 2.
This commit is contained in:
@@ -1,27 +1,34 @@
|
|||||||
private ["_player","_playerUID","_name","_traderid","_buyorsell","_data","_result","_key","_outcome","_clientID","_price","_quantity","_container","_return","_classname","_traderCity","_currency","_message"];
|
local _player = _this select 0;
|
||||||
|
local _traderID = _this select 1;
|
||||||
|
local _buyorsell = _this select 2; //0 > Buy // 1 > Sell
|
||||||
|
local _classname = _this select 3;
|
||||||
|
local _traderCity = _this select 4;
|
||||||
|
local _currency = _this select 5;
|
||||||
|
local _price = _this select 6;
|
||||||
|
|
||||||
_player = _this select 0;
|
local _message = "";
|
||||||
_traderID = _this select 1;
|
local _playerUID = getPlayerUID _player;
|
||||||
_buyorsell = _this select 2; //0 > Buy // 1 > Sell
|
local _name = if (alive _player) then {name _player} else {"Dead Player"};
|
||||||
_classname = _this select 3;
|
local _quantity = 1;
|
||||||
_traderCity = _this select 4;
|
local _container = "gear";
|
||||||
_currency = _this select 5;
|
|
||||||
_price = _this select 6;
|
|
||||||
|
|
||||||
_clientID = owner _player;
|
|
||||||
_playerUID = getPlayerUID _player;
|
|
||||||
_name = if (alive _player) then {name _player} else {"Dead Player"};
|
|
||||||
|
|
||||||
if (count _this > 7) then {
|
if (count _this > 7) then {
|
||||||
_quantity = _this select 7;
|
_quantity = _this select 7;
|
||||||
_container = _this select 8;
|
_container = _this select 8;
|
||||||
_return = false;
|
|
||||||
} else {
|
|
||||||
_quantity = 1;
|
|
||||||
_container = "gear";
|
|
||||||
_return = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
local _checkItems = true; // Activate this to log all items within the '_watchClasses'. Specify the quantity with '_watchNumber' when the sold items will be logged.
|
||||||
|
|
||||||
|
if (_checkItems) then {
|
||||||
|
local _watchClasses = ["ItemBriefcase40oz","ItemBriefcase50oz","ItemBriefcase60oz","ItemBriefcase70oz","ItemBriefcase80oz","ItemBriefcase90oz","ItemBriefcase100oz","ItemTopaz","ItemObsidian","ItemSapphire","ItemAmethyst","ItemEmerald","ItemCitrine","ItemRuby"]; // Items to be logged
|
||||||
|
local _watchNumber = 4; // Minimum number of quantity before logging occurs
|
||||||
|
|
||||||
|
if (_quantity >= _watchNumber && {_className in _watchClasses} && {_buyOrSell == 1}) then {
|
||||||
|
_message = format ["%1 (%2) could be duping! Selling %3x %4",_name,_playerUID,_quantity,_className];
|
||||||
|
diag_log _message;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
if (typeName _currency == "STRING") then {_price = format ["%1 %2",_price,_currency];};
|
if (typeName _currency == "STRING") then {_price = format ["%1 %2",_price,_currency];};
|
||||||
|
|
||||||
if (_buyorsell == 0) then { // Buy
|
if (_buyorsell == 0) then { // Buy
|
||||||
@@ -30,12 +37,4 @@ if (_buyorsell == 0) then { // Buy
|
|||||||
_message = format["Trader Menu: %1 (%2) sold %3x %4 from %5 at %6 for %7",_name,_playerUID,_quantity,_classname,_container,_traderCity,_price];
|
_message = format["Trader Menu: %1 (%2) sold %3x %4 from %5 at %6 for %7",_name,_playerUID,_quantity,_classname,_container,_traderCity,_price];
|
||||||
};
|
};
|
||||||
|
|
||||||
diag_log _message;
|
diag_log _message;
|
||||||
_outcome = "PASS";
|
|
||||||
|
|
||||||
if (_return) then {
|
|
||||||
dayzTradeResult = _outcome;
|
|
||||||
if (!isNull _player) then {
|
|
||||||
_clientID publicVariableClient "dayzTradeResult";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
Reference in New Issue
Block a user