TheOperator

[Release] R3F-Waste Dump Override

12 posts in this topic

Hello everyone,

This is my first real release on the Exile forums. Be gentle.

This is a simple override that can be used in conjunction with R3F-Logistics. Instead of players having to unload and drop those mission crates all over your tradezones, they can simple walk up to the wastedump trader and sell them.

https://github.com/TheSmoothOperator/R3F-WasteDumpOverride

Very simple script setup. Just look over the readme.

 

Operator

6 people like this

Share this post


Link to post
Share on other sites

nvm my mistake i disabled the load cargo into Veh some time ago and thought this was load cargo into back of veh lol, everything works thanks.

Edited by KillingRe

Share this post


Link to post
Share on other sites
Advertisement

A quick question.

When players go to sell the crate from the vehicle it teleport's the vehicle to the corner of the map. I have been trying to figure out what its causing it. any ideas? 

edit* turns out it is infistar v71

 

Edited by YetiBlood

Share this post


Link to post
Share on other sites

The better solution is to use that's ;)  You can sell the crate at waste dump or trader :)  [ R3F is required ]

class CfgExileCustomCode:

Spoiler

    ExileClient_gui_traderDialog_updateInventoryDropdown = "custom\overwrites\ExileClient_gui_traderDialog_updateInventoryDropdown.sqf";
    ExileClient_gui_wasteDumpDialog_show = "custom\overwrites\ExileClient_gui_wasteDumpDialog_show.sqf";

ExileClient_gui_traderDialog_updateInventoryDropdown:

Spoiler

/**
 * ExileClient_gui_traderDialog_updateInventoryDropdown
 *
 * 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["_dialog","_inventoryDropdown","_index","_nearVehicles"];
disableSerialization;
_dialog = uiNameSpace getVariable ["RscExileTraderDialog", displayNull];
_inventoryDropdown = _dialog displayCtrl 4004;
lbClear _inventoryDropdown;
_index = _inventoryDropdown lbAdd "Equipment";
_inventoryDropdown lbSetValue [_index, 1];
_inventoryDropdown lbSetPicture [_index, "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\face_ca.paa"];
_inventoryDropdown lbSetCurSel 0;
if !((uniform player) isEqualTo "") then
{
    _index = _inventoryDropdown lbAdd "Uniform";
    _inventoryDropdown lbSetPicture [_index, "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\uniform_ca.paa"];
    _inventoryDropdown lbSetValue [_index, 2];
};
if !((vest player) isEqualTo "") then
{
    _index = _inventoryDropdown lbAdd "Vest";
    _inventoryDropdown lbSetPicture [_index, "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\vest_ca.paa"];
    _inventoryDropdown lbSetValue [_index, 3];
};
if !((backpack player) isEqualTo "") then
{
    _index = _inventoryDropdown lbAdd "Backpack";
    _inventoryDropdown lbSetPicture [_index, "a3\ui_f\data\gui\Rsc\RscDisplayArsenal\backpack_ca.paa"];
    _inventoryDropdown lbSetValue [_index, 4];
};
_nearVehicles = nearestObjects [player, ["LandVehicle", "Air", "Ship", "Box_NATO_WpsSpecial_F", ], 80];
{
    if (local _x) then
    {
        if (alive _x) then
        {
            _index = _inventoryDropdown lbAdd getText(configFile >> "CfgVehicles" >> (typeOf _x) >> "displayName");
            _inventoryDropdown lbSetData [_index, netId _x];
            _inventoryDropdown lbSetValue [_index, 5];
        };
    };
}
forEach _nearVehicles;
true

 

ExileClient_gui_wasteDumpDialog_show:

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"];
disableSerialization;
_nearVehicles = nearestObjects [player, ["LandVehicle", "Air", "Ship", "Box_NATO_WpsSpecial_F"], 150];
_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");
    _index = _dropdown lbAdd (format ["Cargo: %1", _vehicleName]);
    _dropdown lbSetData [_index, netId _vehicleObject];
    _dropdown lbSetValue [_index, 1];
    _index = _dropdown lbAdd (format ["Vehicle + Cargo: %1", _vehicleName]);
    _dropdown lbSetData [_index, netId _vehicleObject];
    _dropdown lbSetValue [_index, 2];
}
forEach _localVehicles;
true call ExileClient_gui_postProcessing_toggleDialogBackgroundBlur;
true

 

Enjoy!

Edited by Flipspipe
1 person likes this

Share this post


Link to post
Share on other sites
6 hours ago, YetiBlood said:

A quick question.

When players go to sell the crate from the vehicle it teleport's the vehicle to the corner of the map. I have been trying to figure out what its causing it. any ideas? 

edit* turns out it is infistar v71

 

Yes there is such problem. Too I can't solve this problem. This question needs to be asked at

infiSTAR

http://www.exilemod.com/forum/103-anti-hack/

Share this post


Link to post
Share on other sites

In the Update you will be able to disable my wasteDumpTrader checks to make this addon work again by putting

/*
    server side check for the famous "wastedump dupe" as well as client side cooldown
*/
fix_wastedump_dupe = "false";

1 person likes this

Share this post


Link to post
Share on other sites

Sells boxes with transport. Help how to be?

 

Edited by ROFI492

Share this post


Link to post
Share on other sites
18 hours ago, ROFI492 said:

Sells boxes with transport. Help how to be?

 

infiSTAR  v0072

/*
    server side check for the famous "wastedump dupe" as well as client side cooldown
*/
fix_wastedump_dupe = "false";

Share this post


Link to post
Share on other sites

Posted (edited)

Hi Everyone

Is there a way to disable selling the content of a box after its been unloaded and released as this script implements this, I just want sell Vehicle Load, sell Vehicle Cargo and Sell Vehicle + Cargo + Load.

It's took me several hours just to get this sorted for selling from Vehicle on my server and I'm lost on how to disable selling from a Released box outside of the Vehicle where it puts the pop tabs in the box and the content disappears.

Also if anyone has an answer on how to delete a loaded vehicle box after selling that would be awesome (don't think anyone has so far like but worth the ask)

I haven't yet figured the problem above however I will share the files with those that want to use this as I have it fully working to sell from vehicle for all three options.

Sell Loaded Cargo, Sell Cargo and sell Load, Cargo and Vehicle with proper Price fix, Respect and Money to Player all from Vehicle.

1 Create a overrides folder in the root of your mpmissions/mapname folder

2 Add Custom Code to Config.cpp

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";

3 copy the 3 files below, save as .sqf and place in overrides folder

4 Re .Pbo your mpmission folder and enjoy

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

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

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

 

Thanks

John

Edited by johnyboy2o11

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.