• 0
Troublesim

Sell Crate function not adding respect and trader log not working

Question

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 _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 Troublesim

Share this post


Link to post
Share on other sites

3 answers to this question

  • 0
On 7/3/2017 at 9:37 PM, Troublesim said:

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:

  Reveal hidden contents

/**
 * 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.

What Map are you using m8

Share this post


Link to post
Share on other sites
  • 0

Here you go m8 one from my server.

ExileClient_gui_wasteDumpDialog_event_onModeDropDownSelectionChanged.sqf

Spoiler

/**
 * ExileClient_gui_wasteDumpDialog_event_onModeDropDownSelectionChanged
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_display","_dropdown","_index","_vehicleObject","_mode","_cargo","_revenue","_revenueControl","_sellButton","_crateTypes"];
disableSerialization;
_crateTypes = [
        "CargoNet_01_box_F",
        "Exile_Container_SupplyBox",
        "I_CargoNet_01_ammo_F",
        "O_CargoNet_01_ammo_F",
        "B_CargoNet_01_ammo_F",
        "I_supplyCrate_F", 
        "O_supplyCrate_F", 
        "B_supplyCrate_F", 
        "C_supplyCrate_F",
        "IG_supplyCrate_F", 
        "Box_NATO_AmmoVeh_F", 
        "Box_East_AmmoVeh_F", 
        "Box_IND_AmmoVeh_F", 
        "I_CargoNET_01_F",
        "O_CargoNET_01_F",
        "B_CargoNET_01_F",
        "Land_CargoBox_V1_F", 
        "ASC_B_box",
        "Box_NATO_Wps_F", 
        "Box_East_Wps_F", 
        "Box_IND_Wps_F", 
        "Box_East_WpsLaunch_F", 
        "Box_NATO_WpsLaunch_F", 
        "Box_IND_WpsLaunch_F", 
        "Box_IND_WpsSpecial_F", 
        "Box_East_WpsSpecial_F", 
        "Box_NATO_WpsSpecial_F",
        "Box_NATO_Wps_F", 
        "Box_East_Wps_F", 
        "Box_IND_Wps_F", 
        "Box_East_WpsLaunch_F", 
        "Box_NATO_WpsLaunch_F", 
        "Box_IND_WpsLaunch_F", 
        "Box_IND_WpsSpecial_F", 
        "Box_East_WpsSpecial_F", 
        "Box_NATO_WpsSpecial_F",
        "Box_NATO_AmmoOrd_F", 
        "Box_East_AmmoOrd_F", 
        "Box_IND_AmmoOrd_F", 
        "Box_NATO_Grenades_F", 
        "Box_East_Grenades_F", 
        "Box_IND_Grenades_F", 
        "Box_NATO_Ammo_F", 
        "Box_East_Ammo_F", 
        "Box_IND_Ammo_F", 
        "Box_IND_Support_F", 
        "Box_East_Support_F", 
        "Box_NATO_Support_F"
    ];
_display = uiNameSpace getVariable ["RscExileWasteDumpDialog", displayNull];
_dropdown = _this select 0;
_index = _this select 1;
_vehicleObject = objectFromNetId (_dropdown lbData _index);
if (isNull _vehicleObject) then
{
    closeDialog 0;
}
else 
{
    _mode = _dropdown lbValue _index;
    _cargo = [];
    _revenue = 0;
    
    //Mode 1: Selling loaded items and contents
    if (_mode isEqualTo 1) then {
        //Calculate revenue of loaded R3F items and contents
        {
            _cargo = _x call ExileClient_util_containerCargo_list;
            _revenue = _revenue + (_cargo call ExileClient_util_gear_calculateTotalSellPrice);
            _revenue = _revenue + ([(typeOf _x)] call ExileClient_util_gear_calculateTotalSellPrice);
        } forEach (_vehicleObject getVariable ["R3F_LOG_objets_charges", []]);
        //Calculate revenue of attached items and contents, works with Igiload
        {
            _cargo = _x call ExileClient_util_containerCargo_list;
            _revenue = _revenue + (_cargo call ExileClient_util_gear_calculateTotalSellPrice);
            _revenue = _revenue + ([(typeOf _x)] call ExileClient_util_gear_calculateTotalSellPrice);
        } forEach attachedObjects _vehicleObject;
    };
    
    //Mode 2: Sell regular vehicle inventory
    if (_mode isEqualTo 2) then {
        _cargo = _vehicleObject call ExileClient_util_containerCargo_list;
        _revenue = _cargo call ExileClient_util_gear_calculateTotalSellPrice;
    };
    
    //Mode 3: Sell vehicle, cargo, and loaded items and contents
    if (_mode isEqualTo 3) then {
        _cargo = _vehicleObject call ExileClient_util_containerCargo_list;
        _revenue = _revenue + (_cargo call ExileClient_util_gear_calculateTotalSellPrice);
        //Calculate revenue of loaded R3F items and contents
        if (count (_vehicleObject getVariable ["R3F_LOG_objets_charges", []]) >0) then {
            {
                _cargo = _x call ExileClient_util_containerCargo_list;
                _revenue = _revenue + (_cargo call ExileClient_util_gear_calculateTotalSellPrice);
                _revenue = _revenue + ([(typeOf _x)] call ExileClient_util_gear_calculateTotalSellPrice);
            } forEach (_vehicleObject getVariable ["R3F_LOG_objets_charges", []]);
        };
        //Calculate revenue of attached items and contents, works with Igiload
        if(count (attachedObjects _vehicleObject) > 0) then {
            {
                _cargo = _x call ExileClient_util_containerCargo_list;
                _revenue = _revenue + (_cargo call ExileClient_util_gear_calculateTotalSellPrice);
                _revenue = _revenue + ([(typeOf _x)] call ExileClient_util_gear_calculateTotalSellPrice);
            } forEach attachedObjects _vehicleObject;
        };
        _revenue = _revenue + ([(typeOf _vehicleObject)] call ExileClient_util_gear_calculateTotalSellPrice);
    };
    _revenueControl = _display displayCtrl 4001;
    _revenueControl ctrlSetStructuredText (parseText (format ["<t size='1.4'>%1<img image='\exile_assets\texture\ui\poptab_notification_ca.paa' size='1' shadow='true' /></t>", _revenue]));
    _sellButton = _display displayCtrl 4000;
    _sellButton ctrlEnable true;
};
true

ExileClient_gui_wasteDumpDialog_show.sqf

Spoiler

/**
 * ExileClient_gui_wasteDumpDialog_show
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_nearVehicles","_localVehicles","_display","_revenue","_sellButton","_dropdown","_vehicleObject","_vehicleName","_index","_crateTypes"];
disableSerialization;
_crateTypes = [
        "CargoNet_01_box_F",
        "Exile_Container_SupplyBox",
        "I_CargoNet_01_ammo_F",
        "O_CargoNet_01_ammo_F",
        "B_CargoNet_01_ammo_F",
        "I_supplyCrate_F", 
        "O_supplyCrate_F", 
        "B_supplyCrate_F", 
        "C_supplyCrate_F",
        "IG_supplyCrate_F", 
        "Box_NATO_AmmoVeh_F", 
        "Box_East_AmmoVeh_F", 
        "Box_IND_AmmoVeh_F", 
        "I_CargoNET_01_F",
        "O_CargoNET_01_F",
        "B_CargoNET_01_F",
        "Land_CargoBox_V1_F", 
        "ASC_B_box",
        "Box_NATO_Wps_F", 
        "Box_East_Wps_F", 
        "Box_IND_Wps_F", 
        "Box_East_WpsLaunch_F", 
        "Box_NATO_WpsLaunch_F", 
        "Box_IND_WpsLaunch_F", 
        "Box_IND_WpsSpecial_F", 
        "Box_East_WpsSpecial_F", 
        "Box_NATO_WpsSpecial_F",
        "Box_NATO_Wps_F", 
        "Box_East_Wps_F", 
        "Box_IND_Wps_F", 
        "Box_East_WpsLaunch_F", 
        "Box_NATO_WpsLaunch_F", 
        "Box_IND_WpsLaunch_F", 
        "Box_IND_WpsSpecial_F", 
        "Box_East_WpsSpecial_F", 
        "Box_NATO_WpsSpecial_F",
        "Box_NATO_AmmoOrd_F", 
        "Box_East_AmmoOrd_F", 
        "Box_IND_AmmoOrd_F", 
        "Box_NATO_Grenades_F", 
        "Box_East_Grenades_F", 
        "Box_IND_Grenades_F", 
        "Box_NATO_Ammo_F", 
        "Box_East_Ammo_F", 
        "Box_IND_Ammo_F", 
        "Box_IND_Support_F", 
        "Box_East_Support_F", 
        "Box_NATO_Support_F"
    ];
_nearVehicles = nearestObjects [player, ["LandVehicle", "Air", "Ship"], 50];
_localVehicles = [];
{
    if (local _x) then
    {
        if (alive _x) then
        {
            _localVehicles pushBack _x;
        };
    };
}
forEach _nearVehicles;
if (_localVehicles isEqualTo []) exitWith
{
    ["ErrorTitleAndText", ["Whoops!", "Park within 50m and get in as driver first."]] call ExileClient_gui_toaster_addTemplateToast;
};
ExileClientCurrentTrader = _this;
createDialog "RscExileWasteDumpDialog";
waitUntil { !isNull findDisplay 24011 };
_display = uiNameSpace getVariable ["RscExileWasteDumpDialog", displayNull];
_revenue = _display displayCtrl 4001;
_revenue ctrlSetStructuredText (parseText "<t size='1.4'>0<img image='\exile_assets\texture\ui\poptab_notification_ca.paa' size='1' shadow='true' /></t>");
_sellButton = _display displayCtrl 4000;
_sellButton ctrlEnable false;
_dropdown = _display displayCtrl 4002;
lbClear _dropdown;
{
    _vehicleObject = _x;
    _vehicleName = getText(configFile >> "CfgVehicles" >> (typeOf _vehicleObject) >> "displayName");
    
    _R3FObjectsCnt = count (_vehicleObject getVariable ["R3F_LOG_objets_charges", []]);
    _attachedObjectCnt = count (attachedObjects _vehicleObject);
    _loadedObjectCnt = _R3FObjectsCnt + _attachedObjectCnt;
    
    if (_loadedObjectCnt > 0) then {
        _index = _dropdown lbAdd (format ["Load(%2): %1", _vehicleName, _loadedObjectCnt]);
        _dropdown lbSetData [_index, netId _vehicleObject];
        _dropdown lbSetValue [_index, 1];
    };
    _index = _dropdown lbAdd (format ["Cargo: %1", _vehicleName]);
    _dropdown lbSetData [_index, netId _vehicleObject];
    _dropdown lbSetValue [_index, 2];
    
    if (_loadedObjectCnt >0) then {
        _index = _dropdown lbAdd (format ["Vehicle + Cargo + Load(%2): %1", _vehicleName, _loadedObjectCnt]);
        _dropdown lbSetData [_index, netId _vehicleObject];
        _dropdown lbSetValue [_index, 3];
    else {
        _index = _dropdown lbAdd (format ["Vehicle + Cargo: %1", _vehicleName]);
        _dropdown lbSetData [_index, netId _vehicleObject];
        _dropdown lbSetValue [_index, 3];
    };
}
forEach _localVehicles;
true call ExileClient_gui_postProcessing_toggleDialogBackgroundBlur;
true

ExileServer_system_trading_network_wasteDumpRequest.sqf

Spoiler

/**
 * ExileServer_system_trading_network_wasteDumpRequest
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_sessionID","_parameters","_vehicleNetID","_mode","_vehicleObject","_vehicleDBID","_playerObject","_cargo","_revenue","_playerMoney","_respectGain","_playerRespect","_logging","_traderLog","_responseCode","_crateTypes"];
_sessionID = _this select 0;
_parameters = _this select 1;
_vehicleNetID = _parameters select 0;
_mode = _parameters select 1;
_crateTypes = [
        "CargoNet_01_box_F",
        "Exile_Container_SupplyBox",
        "I_CargoNet_01_ammo_F",
        "O_CargoNet_01_ammo_F",
        "B_CargoNet_01_ammo_F",
        "I_supplyCrate_F", 
        "O_supplyCrate_F", 
        "B_supplyCrate_F", 
        "C_supplyCrate_F",
        "IG_supplyCrate_F", 
        "Box_NATO_AmmoVeh_F", 
        "Box_East_AmmoVeh_F", 
        "Box_IND_AmmoVeh_F", 
        "I_CargoNET_01_F",
        "O_CargoNET_01_F",
        "B_CargoNET_01_F",
        "Land_CargoBox_V1_F", 
        "ASC_B_box",
        "Box_NATO_Wps_F", 
        "Box_East_Wps_F", 
        "Box_IND_Wps_F", 
        "Box_East_WpsLaunch_F", 
        "Box_NATO_WpsLaunch_F", 
        "Box_IND_WpsLaunch_F", 
        "Box_IND_WpsSpecial_F", 
        "Box_East_WpsSpecial_F", 
        "Box_NATO_WpsSpecial_F",
        "Box_NATO_Wps_F", 
        "Box_East_Wps_F", 
        "Box_IND_Wps_F", 
        "Box_East_WpsLaunch_F", 
        "Box_NATO_WpsLaunch_F", 
        "Box_IND_WpsLaunch_F", 
        "Box_IND_WpsSpecial_F", 
        "Box_East_WpsSpecial_F", 
        "Box_NATO_WpsSpecial_F",
        "Box_NATO_AmmoOrd_F", 
        "Box_East_AmmoOrd_F", 
        "Box_IND_AmmoOrd_F", 
        "Box_NATO_Grenades_F", 
        "Box_East_Grenades_F", 
        "Box_IND_Grenades_F", 
        "Box_NATO_Ammo_F", 
        "Box_East_Ammo_F", 
        "Box_IND_Ammo_F", 
        "Box_IND_Support_F", 
        "Box_East_Support_F", 
        "Box_NATO_Support_F"
    ];
try 
{
    _vehicleObject = objectFromNetId _vehicleNetID;
    _vehicleDBID = _vehicleObject getVariable "ExileDatabaseID";
    if (isNull _vehicleObject) then
    {
        throw 6;
    };
    if (_vehicleObject getVariable ["ExileMutex", false]) then
    {
        throw 12;
    };
    _vehicleObject setVariable ["ExileMutex", true];
    _playerObject = _sessionID call ExileServer_system_session_getPlayerObject;
    if (isNull _playerObject) then
    {
        throw 1;
    };
    if !(alive _playerObject) then
    {
        throw 2;
    };
    if !((owner _vehicleObject) isEqualTo (owner _playerObject)) then 
    {
        throw 6;
    };
    /* deafult
    _cargo = _vehicleObject call ExileClient_util_containerCargo_list;
    _revenue = _cargo call ExileClient_util_gear_calculateTotalSellPrice;
    clearBackpackCargoGlobal _vehicleObject;
    clearItemCargoGlobal _vehicleObject;
    clearMagazineCargoGlobal _vehicleObject;
    clearWeaponCargoGlobal _vehicleObject;
    */
    _cargo = [];
    _revenue = 0;
    
    if(_mode isEqualTo 1) then
    {
        if (count (_vehicleObject getVariable ["R3F_LOG_objets_charges", []]) >0) then
        {
            {
                _cargo = _x call ExileClient_util_containerCargo_list;
                _revenue = _revenue + (_cargo call ExileClient_util_gear_calculateTotalSellPrice);
                _revenue = _revenue + ([(typeOf _x)] call ExileClient_util_gear_calculateTotalSellPrice);
                clearBackpackCargoGlobal _x;
                clearItemCargoGlobal _x;
                clearMagazineCargoGlobal _x;
                clearWeaponCargoGlobal _x;
            }forEach (_vehicleObject getVariable ["R3F_LOG_objets_charges", []]);
        };
        _vehicleObject setVariable ["R3F_LOG_objets_charges", [], true];
        _vehicleObject call ExileServer_object_vehicle_database_update;
    };
    if(_mode isEqualTo 2) then 
    {
        //standard cargo
        _cargo = _vehicleObject call ExileClient_util_containerCargo_list;
        _revenue = _cargo call ExileClient_util_gear_calculateTotalSellPrice;
        clearBackpackCargoGlobal _vehicleObject;
        clearItemCargoGlobal _vehicleObject;
        clearMagazineCargoGlobal _vehicleObject;
        clearWeaponCargoGlobal _vehicleObject;
        _vehicleObject call ExileServer_object_vehicle_database_update;
    };
    if (_mode isEqualTo 3) then
    {
            {
                _cargo = _x call ExileClient_util_containerCargo_list;
                _revenue = _revenue + (_cargo call ExileClient_util_gear_calculateTotalSellPrice);
                _revenue = _revenue + ([(typeOf _x)] call ExileClient_util_gear_calculateTotalSellPrice);
                clearBackpackCargoGlobal _x;
                clearItemCargoGlobal _x;
                clearMagazineCargoGlobal _x;
                clearWeaponCargoGlobal _x;
                _x call ExileServer_object_vehicle_remove;
                deleteVehicle _x;
            }forEach (_vehicleObject getVariable ["R3F_LOG_objets_charges", []]);

        //standard cargo
        _cargo = _vehicleObject call ExileClient_util_containerCargo_list;
        _revenue = _revenue + (_cargo call ExileClient_util_gear_calculateTotalSellPrice);
        clearBackpackCargoGlobal _vehicleObject;
        clearItemCargoGlobal _vehicleObject;
        clearMagazineCargoGlobal _vehicleObject;
        clearWeaponCargoGlobal _vehicleObject;
        
        _revenue = _revenue + ([(typeOf _vehicleObject)] call ExileClient_util_gear_calculateTotalSellPrice);
        _vehicleObject call ExileServer_object_vehicle_remove;
        deleteVehicle _vehicleObject;
    };
    /*
    else 
    {
        _vehicleObject call ExileServer_object_vehicle_database_update;
    };
    */
    _playerMoney = _playerObject getVariable ["ExileMoney", 0];
    _playerMoney = _playerMoney + _revenue;
    _playerObject setVariable ["ExileMoney", _playerMoney, true];
    format["setPlayerMoney:%1:%2", _playerMoney, _playerObject getVariable ["ExileDatabaseID", 0]] call ExileServer_system_database_query_fireAndForget;
    _respectGain = _revenue * getNumber (configFile >> "CfgSettings" >> "Respect" >> "tradingRespectFactor");
    _playerRespect = _playerObject getVariable ["ExileScore", 0];
    _playerRespect = floor (_playerRespect + _respectGain);
    _playerObject setVariable ["ExileScore", _playerRespect];
    format["setAccountScore:%1:%2", _playerRespect, (getPlayerUID _playerObject)] call ExileServer_system_database_query_fireAndForget;
    [_sessionID, "wasteDumpResponse", [0, _revenue, str _playerRespect]] call ExileServer_system_network_send_to;
    _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",getPlayerUID _playerObject,_playerObject,typeOf _vehicleObject,_vehicleDBID,_cargo,_revenue,_respectGain,_playerMoney];
        "extDB2" callExtension format["1:TRADING:%1",_traderLog];
    };
}
catch
{
    _responseCode = _exception;
    [_sessionID, "wasteDumpResponse", [_responseCode, 0, ""]] call ExileServer_system_network_send_to;
};
if (!isNull _vehicleObject) then
{
    _vehicleObject setVariable ["ExileMutex", false];
};
true

add this to your custom code in config.cpp and change folder to specify location as you can see mine is overrides folder

Spoiler

// Sell Crates
    ExileClient_gui_wasteDumpDialog_event_onModeDropDownSelectionChanged "overrides\ExileClient_gui_wasteDumpDialog_event_onModeDropDownSelectionChanged.sqf";
    ExileClient_gui_wasteDumpDialog_show = "overrides\ExileClient_gui_wasteDumpDialog_show.sqf";
    ExileServer_system_trading_network_wasteDumpRequest = "overrides\ExileServer_system_trading_network_wasteDumpRequest.sqf";

 

Enjoy

John

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.