How can I get the trader log to work alongside the Respect, currently neither work, if I leave the trader log section out the script itself works however the respect still isn't given. But with the trader log section in nothing works at all. Anyone got any ideas on what may be causing the issue.
Script is here:
Spoiler
/**
* Passe la variable R3F_LOG_joueur_deplace_objet à objNull pour informer le script "deplacer" d'arrêter de déplacer l'objet
*/
if (R3F_LOG_mutex_local_verrou) then
{
hintC STR_R3F_LOG_mutex_action_en_cours;
}
else
{
R3F_LOG_mutex_local_verrou = true;
private _result = ["Do you want to delete the crate?", "Confirm", true, true] call BIS_fnc_guiMessage; // Arma 3
if ( typeName _result isEqualTo typeName true ) then {
if ( _result ) then {
deleteVehicle _crate;
};
};
_logging = getNumber(configFile >> "CfgSettings" >> "Logging" >> "traderLogging");
if (_logging isEqualTo 1) then
{
_traderLog = format ["PLAYER: ( %1 ) %2 SOLD ITEM: %3 (ID# %4) with Cargo %5 FOR %6 POPTABS AND %7 RESPECT | PLAYER TOTAL MONEY: %8",player getPlayerUID,player,typeOf _crate,_crate,_cargo,_revenue,_respectGain,_playerMoney];
"extDB2" callExtension format["1:TRADING:%1",_traderLog];
};
};
How can I get the trader log to work alongside the Respect, currently neither work, if I leave the trader log section out the script itself works however the respect still isn't given. But with the trader log section in nothing works at all. Anyone got any ideas on what may be causing the issue.
Script is here:
/**
* Passe la variable R3F_LOG_joueur_deplace_objet à objNull pour informer le script "deplacer" d'arrêter de déplacer l'objet
*/
if (R3F_LOG_mutex_local_verrou) then
{
hintC STR_R3F_LOG_mutex_action_en_cours;
}
else
{
R3F_LOG_mutex_local_verrou = true;
private _foundTrader = false;
{
_foundTrader = true;
} forEach nearestObjects [player, ["Exile_Trader_WasteDump"], 12];
if (_foundTrader) then {
private ["_playerMoney","_playerRespect","_crate","_cargo","_revenue","_respectGain","_cash","_sessionID","_logging","_traderLog"];
_sessionID = _this select 0;
_crate = R3F_LOG_joueur_deplace_objet;
_cargo = _crate call ExileClient_util_containerCargo_list;
_revenue = _cargo call ExileClient_util_gear_calculateTotalSellPrice;
_cash = _crate getVariable ["ExileMoney", 0];
["SuccessTitleAndText", ["Crate Contents Sold", format["Cargo was sold for %1 Poptabs.", _revenue]]] call ExileClient_gui_toaster_addTemplateToast;
//str(_revenue);
clearWeaponCargoGlobal _crate;
clearItemCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
clearBackpackCargoGlobal _crate;
_playerMoney = player getVariable ["ExileMoney", 0];
_playerMoney = _playerMoney + _cash + _revenue;
player setVariable ["ExileMoney", _playerMoney, true];
_playerRespect = player getVariable ["ExileScore", 0];
_respectGain = _revenue / 2;
_playerRespect = floor (_playerRespect + _respectGain);
player setVariable ["ExileScore", _playerRespect];
format["setAccountScore:%1:%2", _playerRespect, player getVariable ["ExileDatabaseID", 0]] call ExileServer_system_database_query_fireAndForget;
format["setPlayerMoney:%1:%2", _playerMoney, player getVariable ["ExileDatabaseID", 0]] call ExileServer_system_database_query_fireAndForget;
[_sessionID, "wasteDumpResponse", [0, _revenue, str _playerRespect]] call ExileServer_system_network_send_to;
private _result = ["Do you want to delete the crate?", "Confirm", true, true] call BIS_fnc_guiMessage; // Arma 3
if ( typeName _result isEqualTo typeName true ) then {
if ( _result ) then {
deleteVehicle _crate;
};
};
_logging = getNumber(configFile >> "CfgSettings" >> "Logging" >> "traderLogging");
if (_logging isEqualTo 1) then
{
_traderLog = format ["PLAYER: ( %1 ) %2 SOLD ITEM: %3 (ID# %4) with Cargo %5 FOR %6 POPTABS AND %7 RESPECT | PLAYER TOTAL MONEY: %8",player getPlayerUID,player,typeOf _crate,_crate,_cargo,_revenue,_respectGain,_playerMoney];
"extDB2" callExtension format["1:TRADING:%1",_traderLog];
};
};
R3F_LOG_joueur_deplace_objet = objNull;
sleep 0.25;
R3F_LOG_mutex_local_verrou = false;
};
Thanks for the help.
Edited by TroublesimShare this post
Link to post
Share on other sites