mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 12:12:34 +03:00
New Logsystem Script Side
This commit is contained in:
@@ -24,7 +24,7 @@ _bos = 0;
|
|||||||
if(_buy_o_sell == "buy") then {
|
if(_buy_o_sell == "buy") then {
|
||||||
_qty = {_x == _part_in} count magazines player;
|
_qty = {_x == _part_in} count magazines player;
|
||||||
} else {
|
} else {
|
||||||
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance];
|
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance_vehicle];
|
||||||
_qty = count _obj;
|
_qty = count _obj;
|
||||||
_bos = 1;
|
_bos = 1;
|
||||||
};
|
};
|
||||||
@@ -81,7 +81,9 @@ if (_qty >= _qty_in) then {
|
|||||||
if (_qty >= _qty_in) then {
|
if (_qty >= _qty_in) then {
|
||||||
|
|
||||||
//["PVDZE_obj_Trade",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
|
//["PVDZE_obj_Trade",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
|
||||||
PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos];
|
if (isNil _obj) then { _obj = "Unknown Vehicle" };
|
||||||
|
if (isNil inTraderCity) then { inTraderCity = "Unknown Trader City" };
|
||||||
|
PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos,_obj,inTraderCity];
|
||||||
publicVariableServer "PVDZE_obj_Trade";
|
publicVariableServer "PVDZE_obj_Trade";
|
||||||
|
|
||||||
//diag_log format["DEBUG Starting to wait for answer: %1", PVDZE_obj_Trade];
|
//diag_log format["DEBUG Starting to wait for answer: %1", PVDZE_obj_Trade];
|
||||||
|
|||||||
@@ -75,14 +75,16 @@ if (_qty >= _qty_in) then {
|
|||||||
if(_buy_o_sell == "buy") then {
|
if(_buy_o_sell == "buy") then {
|
||||||
_qty = {_x == _part_in} count magazines player;
|
_qty = {_x == _part_in} count magazines player;
|
||||||
} else {
|
} else {
|
||||||
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance];
|
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance_boat];
|
||||||
_qty = count _obj;
|
_qty = count _obj;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_qty >= _qty_in) then {
|
if (_qty >= _qty_in) then {
|
||||||
|
|
||||||
//["PVDZE_obj_Trade",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
|
//["PVDZE_obj_Trade",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
|
||||||
PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos];
|
if (isNil _obj) then { _obj = "Unknown Vehicle" };
|
||||||
|
if (isNil inTraderCity) then { inTraderCity = "Unknown Trader City" };
|
||||||
|
PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos,_obj,inTraderCity];
|
||||||
publicVariableServer "PVDZE_obj_Trade";
|
publicVariableServer "PVDZE_obj_Trade";
|
||||||
|
|
||||||
//diag_log format["DEBUG Starting to wait for answer: %1", PVDZE_obj_Trade];
|
//diag_log format["DEBUG Starting to wait for answer: %1", PVDZE_obj_Trade];
|
||||||
|
|||||||
@@ -24,7 +24,12 @@ _bos = 0;
|
|||||||
if(_buy_o_sell == "buy") then {
|
if(_buy_o_sell == "buy") then {
|
||||||
_qty = {_x == _part_in} count magazines player;
|
_qty = {_x == _part_in} count magazines player;
|
||||||
} else {
|
} else {
|
||||||
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance];
|
|
||||||
|
if (_part_in isKindOf "AIR") then {
|
||||||
|
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance_air];
|
||||||
|
} else {
|
||||||
|
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance_vehicle];
|
||||||
|
};
|
||||||
_qty = count _obj;
|
_qty = count _obj;
|
||||||
_bos = 1;
|
_bos = 1;
|
||||||
};
|
};
|
||||||
@@ -85,7 +90,9 @@ if (_qty >= _qty_in) then {
|
|||||||
if (_qty >= _qty_in) then {
|
if (_qty >= _qty_in) then {
|
||||||
|
|
||||||
//["PVDZE_obj_Trade",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
|
//["PVDZE_obj_Trade",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
|
||||||
PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos];
|
if (isNil _obj) then { _obj = "Unknown Vehicle" };
|
||||||
|
if (isNil inTraderCity) then { inTraderCity = "Unknown Trader City" };
|
||||||
|
PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos,_obj,inTraderCity];
|
||||||
publicVariableServer "PVDZE_obj_Trade";
|
publicVariableServer "PVDZE_obj_Trade";
|
||||||
|
|
||||||
//diag_log format["DEBUG Starting to wait for answer: %1", PVDZE_obj_Trade];
|
//diag_log format["DEBUG Starting to wait for answer: %1", PVDZE_obj_Trade];
|
||||||
|
|||||||
@@ -84,7 +84,9 @@ if (_qty >= _qty_in) then {
|
|||||||
if (_qty >= _qty_in) then {
|
if (_qty >= _qty_in) then {
|
||||||
|
|
||||||
//["PVDZE_obj_Trade",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
|
//["PVDZE_obj_Trade",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
|
||||||
PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos];
|
if (isNil _bag) then { _bag = "Unknown Backpack" };
|
||||||
|
if (isNil inTraderCity) then { inTraderCity = "Unknown Trader City" };
|
||||||
|
PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos,_bag,inTraderCity];
|
||||||
publicVariableServer "PVDZE_obj_Trade";
|
publicVariableServer "PVDZE_obj_Trade";
|
||||||
|
|
||||||
//diag_log format["DEBUG Starting to wait for answer: %1", PVDZE_obj_Trade];
|
//diag_log format["DEBUG Starting to wait for answer: %1", PVDZE_obj_Trade];
|
||||||
|
|||||||
@@ -99,8 +99,9 @@ for "_x" from 1 to _total_trades do {
|
|||||||
if (_removed == _qty_in) then {
|
if (_removed == _qty_in) then {
|
||||||
|
|
||||||
// Continue with trade.
|
// Continue with trade.
|
||||||
PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos];
|
if (isNil _part_in) then { _part_in = "Unknown Item" };
|
||||||
publicVariableServer "PVDZE_obj_Trade";
|
if (isNil inTraderCity) then { inTraderCity = "Unknown Trader City" };
|
||||||
|
PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos,_part_in,inTraderCity];
|
||||||
|
|
||||||
waitUntil {!isNil "dayzTradeResult"};
|
waitUntil {!isNil "dayzTradeResult"};
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,9 @@ if (_qty >= _qty_in) then {
|
|||||||
if (_qty >= _qty_in) then {
|
if (_qty >= _qty_in) then {
|
||||||
|
|
||||||
//["PVDZE_obj_Trade",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
|
//["PVDZE_obj_Trade",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
|
||||||
PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos];
|
if (isNil _part_out) then { _part_out = "Unknown Weapon/Magazine" };
|
||||||
|
if (isNil inTraderCity) then { inTraderCity = "Unknown Trader City" };
|
||||||
|
PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos,_part_out,inTraderCity];
|
||||||
publicVariableServer "PVDZE_obj_Trade";
|
publicVariableServer "PVDZE_obj_Trade";
|
||||||
|
|
||||||
waitUntil {!isNil "dayzTradeResult"};
|
waitUntil {!isNil "dayzTradeResult"};
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
private ["_activatingPlayer","_isOK","_object","_worldspace","_location","_dir","_class","_uid","_key","_keySelected","_characterID","_donotusekey"];
|
private ["_activatingPlayer","_isOK","_object","_worldspace","_location","_dir","_class","_uid","_key","_keySelected","_characterID","_donotusekey"];
|
||||||
|
//PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,false,_keySelected,_activatingPlayer];
|
||||||
_object = _this select 0;
|
_object = _this select 0;
|
||||||
_worldspace = _this select 1;
|
_worldspace = _this select 1;
|
||||||
_class = _this select 2;
|
_class = _this select 2;
|
||||||
|
|||||||
@@ -1,14 +1,29 @@
|
|||||||
private ["_character","_traderid","_buyorsell","_data","_result","_key","_outcome","_clientID"];
|
private ["_character","_traderid","_buyorsell","_data","_result","_key","_outcome","_clientID"];
|
||||||
|
/*
|
||||||
|
PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos]; //OLD
|
||||||
|
PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos,_obj,inTraderCity]; //NEW
|
||||||
|
|
||||||
_character = _this select 0;
|
*/
|
||||||
_traderid = _this select 1;
|
|
||||||
_buyorsell = _this select 2;
|
|
||||||
_clientID = owner _character;
|
|
||||||
|
|
||||||
diag_log format["TRADE: Trade Request by ClientID: %1 Character: %2 TraderID: %3 BuyOrSell: %4", _clientID, _character,_traderid,_buyorsell];
|
_player = _this select 0;
|
||||||
|
_traderID = _this select 1;
|
||||||
|
_buyorsell = _this select 2; //0 > Buy // 1 > Sell
|
||||||
|
_classname = _this select 3;
|
||||||
|
_traderCity = _this select 4;
|
||||||
|
_clientID = owner _player;
|
||||||
|
|
||||||
|
//Old Logway
|
||||||
|
//diag_log format["TRADE: Trade Request by ClientID: %1 Character: %2 TraderID: %3 BuyOrSell: %4", _clientID, _character,_traderID,_buyorsell];
|
||||||
|
|
||||||
|
//New Logway WIP by Skaronator
|
||||||
|
if (_buyorsell == 0) then { //Buy
|
||||||
|
diag_log format["EPOCH SERVERTRADE: Player: %1 (%2) bought a %3 in %4", (name _player), (getPlayerUID _player), _classname, _traderCity];
|
||||||
|
} else { //SELL
|
||||||
|
diag_log format["EPOCH SERVERTRADE: Player: %1 (%2) sold a %3 in %4",];
|
||||||
|
};
|
||||||
|
|
||||||
//Send request
|
//Send request
|
||||||
_key = format["CHILD:398:%1:%2:",_traderid,_buyorsell];
|
_key = format["CHILD:398:%1:%2:",_traderID,_buyorsell];
|
||||||
|
|
||||||
_data = "HiveEXT" callExtension _key;
|
_data = "HiveEXT" callExtension _key;
|
||||||
_result = call compile format ["%1",_data];
|
_result = call compile format ["%1",_data];
|
||||||
@@ -16,6 +31,6 @@ _result = call compile format ["%1",_data];
|
|||||||
_outcome = _result select 0;
|
_outcome = _result select 0;
|
||||||
|
|
||||||
dayzTradeResult = _outcome;
|
dayzTradeResult = _outcome;
|
||||||
if(!isNull _character) then {
|
if(!isNull _player) then {
|
||||||
_clientID publicVariableClient "dayzTradeResult";
|
_clientID publicVariableClient "dayzTradeResult";
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user