Paradox121 Posted January 11, 2015 Report Share Posted January 11, 2015 Yeah but i change that in client files another user must have this to or not ? Link to comment Share on other sites More sharing options...
Humpabry Posted January 11, 2015 Report Share Posted January 11, 2015 no this will run server side still and it does not affect other players files etc. only you need to change that..i have the guns all added to the CfgPricing. but still does not overwrite the original CfgPricing..any help would be lovely :) Link to comment Share on other sites More sharing options...
Paradox121 Posted January 11, 2015 Report Share Posted January 11, 2015 Hmm i change the File now. Soll i repack that and put to @Epoch ? or in @epochhive? cheerz Link to comment Share on other sites More sharing options...
Humpabry Posted January 11, 2015 Report Share Posted January 11, 2015 if only it was that easy lol... thats the start mate u gotta download emod etc and make sure u get the right files on mission side and edit them so it calls mission side before server side and overwrites the files Link to comment Share on other sites More sharing options...
Humpabry Posted January 11, 2015 Report Share Posted January 11, 2015 #include "missionconfigfile\CfgPricing.hpp" in description.ext OP_NpcTraderAdd.sqf private ["_uiItem","_item","_worth","_cryptoCount","_control","_selected","_index","_sizeOut","_array"]; _control = _this select 0; _selected = _this select 1; _uiItem = (_selected select 0) lbData (_selected select 1); if (isClass(missionconfigfile >> "CfgPricing" >> _uiItem)) then { _index = lbAdd [_control, ((_selected select 0) lbText (_selected select 1))]; lbSetData [_control, _index, _uiItem]; lbSetPicture [_control, _index, ((_selected select 0) lbPicture (_selected select 1))]; (_selected select 0) lbDelete (_selected select 1); _cryptoCount = 0; _sizeOut = lbSize 41501; //_array = []; if (_sizeOut > 0) then { for "_i" from 0 to (_sizeOut - 1) do { _item = lbData [41501, _i]; //_array pushBack _item; _worth = getNumber(missionconfigfile >> "CfgPricing" >> _item >> "price"); _cryptoCount = _cryptoCount + _worth; }; }; ctrlSetText [41004, (format ["%1 Krypto", _cryptoCount])]; _cryptoCount = 0; _sizeOut = lbSize 41502; //_array = []; if (_sizeOut > 0) then { for "_i" from 0 to (_sizeOut - 1) do { _item = lbData [41502, _i]; //_array pushBack _item; _itemWorth = getNumber(missionconfigfile >> "CfgPricing" >> _item >> "price"); _itemTax = getNumber(missionconfigfile >> "CfgPricing" >> _item >> "tax"); _tax = _itemWorth * (EPOCH_taxRate + _itemTax); _itemWorth = ceil(_itemWorth + _tax); //diag_log format["_finalWorth %1", _finalWorth]; _cryptoCount = _cryptoCount + _itemWorth; }; }; ctrlSetText [41005, (format ["%1 Krypto", _cryptoCount])]; }; OP_StartNpcsTrade.sqf private["_item", "_currQty", "_tradeType", "_itemWorth", "_aiItems", "_itemClasses", "_itemQtys", "_qtyIndex", "_tradeTotal", "_tradeQtyTotal", "_errorMsg", "_target", "_sizeOut", "_array", "_makeTrade", "_vehSlot", "_vehicle", "_vehicles", "_display", "_addWeaponToHands", "_type", "_tax"]; if (!isNil "EPOCH_TRADE_COMPLETE") exitWith {}; if (!isNil "EPOCH_TRADE_STARTED") exitWith{}; if (!isNull _this) then{ EPOCH_TRADE_STARTED = true; _current_crypto = EPOCH_playerCrypto; // _arrayIn = Sell Array _sizeOut = lbSize 41501; _arrayIn = []; if (_sizeOut > 0) then{ for "_i" from 0 to(_sizeOut - 1) do { _item = lbData[41501, _i]; if (isClass(missionconfigfile >> "CfgPricing" >> _item)) then{ // test remove items to be sold and add to array if ([_item, "CfgWeapons"] call EPOCH_isAny) then{ if (_item in items player) then{ player removeItem _item; _arrayIn pushBack _item; }; } else { if ([_item, "CfgVehicles"] call EPOCH_isAny) then{ _vehicles = _this nearEntities[[_item], 30]; if (!(_vehicles isEqualTo[])) then{ _vehicle = _vehicles select 0; if (!isNull _vehicle) then{ if (local _vehicle) then{ _vehSlot = _vehicle getVariable["VEHICLE_SLOT", "ABORT"]; if (_vehSlot != "ABORT") then{ _arrayIn pushBack _item; // will be removed server side }; }; }; }; } else { if (_item in magazines player) then{ player removeMagazine _item; _arrayIn pushBack _item; }; }; }; // test }; }; }; // _arrayOut = Purchase Array _sizeOut = lbSize 41502; _arrayOut = []; if (_sizeOut > 0) then{ for "_i" from 0 to(_sizeOut - 1) do { _item = lbData[41502, _i]; if (isClass(missionconfigfile >> "CfgPricing" >> _item)) then{ _itemWorth = getNumber(missionconfigfile >> "CfgPricing" >> _item >> "price"); _itemTax = getNumber(missionconfigfile >> "CfgPricing" >> _item >> "tax"); _tax = _itemWorth * (EPOCH_taxRate + _itemTax); _itemWorth = ceil(_itemWorth + _tax); if (_current_crypto >= _itemWorth) then { _current_crypto = _current_crypto - _itemWorth; _arrayOut pushBack _item; }; }; }; }; if (!(_arrayIn isEqualTo[]) || !(_arrayOut isEqualTo[])) then{ // make trade EPOCH_MAKENPCTRADE = [_this, _arrayIn, _arrayOut, player, Epoch_personalToken]; publicVariableServer "EPOCH_MAKENPCTRADE"; // close menu closeDialog 0; [_arrayIn, _arrayOut] spawn{ waitUntil{ sleep 0.1; !isNil "EPOCH_TRADE_COMPLETE" }; // SOLD ITEMS ARRAY if !((EPOCH_TRADE_COMPLETE select 0) isEqualTo[]) then{ if ((EPOCH_TRADE_COMPLETE select 0) isEqualTo(_this select 0)) then{ _errorMsg = 'Items Sold'; 0 = [format["%1", _errorMsg], 0, 1, 5, 2, 0, 1] spawn bis_fnc_dynamictext; } else { _errorMsg = 'Failed To Sell Items'; 0 = [format["%1", _errorMsg], 0, 1, 5, 2, 0, 1] spawn bis_fnc_dynamictext; }; }; // PURCHASED ITEMS ARRAY if !((EPOCH_TRADE_COMPLETE select 1) isEqualTo[]) then{ if ((EPOCH_TRADE_COMPLETE select 1) isEqualTo(_this select 1)) then{ _errorMsg = 'Items Purchased'; // add purchased items { if ([_x, "CfgWeapons"] call EPOCH_isAny) then{ if (player canAdd _x) then{ player addItem _x; } else { _type = getNumber(configfile >> "CfgWeapons" >> (_x) >> "type"); _addWeaponToHands = false; switch (_type) do { case 1: { if (primaryWeapon player == "") then{ _addWeaponToHands = true; }; }; case 2: { if (secondaryWeapon player == "") then{ _addWeaponToHands = true; }; }; case 4: { if (handgunWeapon player == "") then{ _addWeaponToHands = true; }; }; }; if (_addWeaponToHands) then{ player addWeapon _x; } else { _errorMsg = "Not enough space"; }; }; } else { if ([_x, "CfgMagazines"] call EPOCH_isAny) then{ if (player canAdd _x) then{ player addMagazine _x; } else { _errorMsg = "Not enough space"; }; }; }; } forEach(_this select 1); 0 = [format["%1", _errorMsg], 0, 0.4, 5, 2, 0, 2] spawn bis_fnc_dynamictext; } else { _errorMsg = 'Failed To Purchase Items'; 0 = [format["%1", _errorMsg], 0, 0.4, 5, 2, 0, 2] spawn bis_fnc_dynamictext; }; }; EPOCH_TRADE_COMPLETE = nil; EPOCH_TRADE_STARTED = nil; }; }; }; precompile.sqf diag_log 'EMOD: Precompile Running'; EPOCH_npcTraderAdd = compileFinal preprocessFileLineNumbers "custom\a3_epoch_code\compile\traders\OP_npcTraderAdd.sqf"; EPOCH_startNpcTrade = compileFinal preprocessFileLineNumbers "custom\a3_epoch_code\compile\traders\OP_startNpcTrade.sqf"; call compile preprocessFileLineNumbers "custom\a3_epoch_code\init\fn_init.sqf"; diag_log 'EMOD: Precompile Finished'; so wats missing? ;p Link to comment Share on other sites More sharing options...
Paradox121 Posted January 11, 2015 Report Share Posted January 11, 2015 Ah okay Again: I create a folder called configs and there i put the CfgPricing.hpp Now i includ it in the description ?? And i must run emod on my server + the included in the description right? Link to comment Share on other sites More sharing options...
Humpabry Posted January 11, 2015 Report Share Posted January 11, 2015 wen i have it done ill share it but for now im stuck my self ;) Link to comment Share on other sites More sharing options...
Paradox121 Posted January 11, 2015 Report Share Posted January 11, 2015 Is my way right or not ? Link to comment Share on other sites More sharing options...
Humpabry Posted January 11, 2015 Report Share Posted January 11, 2015 in description.ext #include "missionconfigfile\CfgPricing.hpp" in description.ext download emod and follow instructions and put your CfgPricing in wat ever folder u named it "missionconfigfile\CfgPricing.hpp" missionconfigfile is mine Link to comment Share on other sites More sharing options...
Paradox121 Posted January 11, 2015 Report Share Posted January 11, 2015 oKAY i will try it thank you:D Link to comment Share on other sites More sharing options...
prue420 Posted January 11, 2015 Report Share Posted January 11, 2015 I got to the point where you add the items to sell it and it goes in the box but i get no money. Link to comment Share on other sites More sharing options...
Humpabry Posted January 11, 2015 Report Share Posted January 11, 2015 how u get the items into the trade box? not got that far yet.. Link to comment Share on other sites More sharing options...
prue420 Posted January 11, 2015 Report Share Posted January 11, 2015 the first time i go to trade it says trading failed and it still takes the items but gives me no money. Then after that no message and takes the stuff with no money Link to comment Share on other sites More sharing options...
Humpabry Posted January 11, 2015 Report Share Posted January 11, 2015 did you add prices to your guns you added into the CfgPricing? Link to comment Share on other sites More sharing options...
prue420 Posted January 11, 2015 Report Share Posted January 11, 2015 yes Link to comment Share on other sites More sharing options...
BenR Posted January 11, 2015 Report Share Posted January 11, 2015 #include "missionconfigfile\CfgPricing.hpp" in description.ext OP_NpcTraderAdd.sqf private ["_uiItem","_item","_worth","_cryptoCount","_control","_selected","_index","_sizeOut","_array"]; _control = _this select 0; _selected = _this select 1; _uiItem = (_selected select 0) lbData (_selected select 1); if (isClass(missionconfigfile >> "CfgPricing" >> _uiItem)) then { _index = lbAdd [_control, ((_selected select 0) lbText (_selected select 1))]; lbSetData [_control, _index, _uiItem]; lbSetPicture [_control, _index, ((_selected select 0) lbPicture (_selected select 1))]; (_selected select 0) lbDelete (_selected select 1); _cryptoCount = 0; _sizeOut = lbSize 41501; //_array = []; if (_sizeOut > 0) then { for "_i" from 0 to (_sizeOut - 1) do { _item = lbData [41501, _i]; //_array pushBack _item; _worth = getNumber(missionconfigfile >> "CfgPricing" >> _item >> "price"); _cryptoCount = _cryptoCount + _worth; }; }; ctrlSetText [41004, (format ["%1 Krypto", _cryptoCount])]; _cryptoCount = 0; _sizeOut = lbSize 41502; //_array = []; if (_sizeOut > 0) then { for "_i" from 0 to (_sizeOut - 1) do { _item = lbData [41502, _i]; //_array pushBack _item; _itemWorth = getNumber(missionconfigfile >> "CfgPricing" >> _item >> "price"); _itemTax = getNumber(missionconfigfile >> "CfgPricing" >> _item >> "tax"); _tax = _itemWorth * (EPOCH_taxRate + _itemTax); _itemWorth = ceil(_itemWorth + _tax); //diag_log format["_finalWorth %1", _finalWorth]; _cryptoCount = _cryptoCount + _itemWorth; }; }; ctrlSetText [41005, (format ["%1 Krypto", _cryptoCount])]; }; OP_StartNpcsTrade.sqf private["_item", "_currQty", "_tradeType", "_itemWorth", "_aiItems", "_itemClasses", "_itemQtys", "_qtyIndex", "_tradeTotal", "_tradeQtyTotal", "_errorMsg", "_target", "_sizeOut", "_array", "_makeTrade", "_vehSlot", "_vehicle", "_vehicles", "_display", "_addWeaponToHands", "_type", "_tax"]; if (!isNil "EPOCH_TRADE_COMPLETE") exitWith {}; if (!isNil "EPOCH_TRADE_STARTED") exitWith{}; if (!isNull _this) then{ EPOCH_TRADE_STARTED = true; _current_crypto = EPOCH_playerCrypto; // _arrayIn = Sell Array _sizeOut = lbSize 41501; _arrayIn = []; if (_sizeOut > 0) then{ for "_i" from 0 to(_sizeOut - 1) do { _item = lbData[41501, _i]; if (isClass(missionconfigfile >> "CfgPricing" >> _item)) then{ // test remove items to be sold and add to array if ([_item, "CfgWeapons"] call EPOCH_isAny) then{ if (_item in items player) then{ player removeItem _item; _arrayIn pushBack _item; }; } else { if ([_item, "CfgVehicles"] call EPOCH_isAny) then{ _vehicles = _this nearEntities[[_item], 30]; if (!(_vehicles isEqualTo[])) then{ _vehicle = _vehicles select 0; if (!isNull _vehicle) then{ if (local _vehicle) then{ _vehSlot = _vehicle getVariable["VEHICLE_SLOT", "ABORT"]; if (_vehSlot != "ABORT") then{ _arrayIn pushBack _item; // will be removed server side }; }; }; }; } else { if (_item in magazines player) then{ player removeMagazine _item; _arrayIn pushBack _item; }; }; }; // test }; }; }; // _arrayOut = Purchase Array _sizeOut = lbSize 41502; _arrayOut = []; if (_sizeOut > 0) then{ for "_i" from 0 to(_sizeOut - 1) do { _item = lbData[41502, _i]; if (isClass(missionconfigfile >> "CfgPricing" >> _item)) then{ _itemWorth = getNumber(missionconfigfile >> "CfgPricing" >> _item >> "price"); _itemTax = getNumber(missionconfigfile >> "CfgPricing" >> _item >> "tax"); _tax = _itemWorth * (EPOCH_taxRate + _itemTax); _itemWorth = ceil(_itemWorth + _tax); if (_current_crypto >= _itemWorth) then { _current_crypto = _current_crypto - _itemWorth; _arrayOut pushBack _item; }; }; }; }; if (!(_arrayIn isEqualTo[]) || !(_arrayOut isEqualTo[])) then{ // make trade EPOCH_MAKENPCTRADE = [_this, _arrayIn, _arrayOut, player, Epoch_personalToken]; publicVariableServer "EPOCH_MAKENPCTRADE"; // close menu closeDialog 0; [_arrayIn, _arrayOut] spawn{ waitUntil{ sleep 0.1; !isNil "EPOCH_TRADE_COMPLETE" }; // SOLD ITEMS ARRAY if !((EPOCH_TRADE_COMPLETE select 0) isEqualTo[]) then{ if ((EPOCH_TRADE_COMPLETE select 0) isEqualTo(_this select 0)) then{ _errorMsg = 'Items Sold'; 0 = [format["%1", _errorMsg], 0, 1, 5, 2, 0, 1] spawn bis_fnc_dynamictext; } else { _errorMsg = 'Failed To Sell Items'; 0 = [format["%1", _errorMsg], 0, 1, 5, 2, 0, 1] spawn bis_fnc_dynamictext; }; }; // PURCHASED ITEMS ARRAY if !((EPOCH_TRADE_COMPLETE select 1) isEqualTo[]) then{ if ((EPOCH_TRADE_COMPLETE select 1) isEqualTo(_this select 1)) then{ _errorMsg = 'Items Purchased'; // add purchased items { if ([_x, "CfgWeapons"] call EPOCH_isAny) then{ if (player canAdd _x) then{ player addItem _x; } else { _type = getNumber(configfile >> "CfgWeapons" >> (_x) >> "type"); _addWeaponToHands = false; switch (_type) do { case 1: { if (primaryWeapon player == "") then{ _addWeaponToHands = true; }; }; case 2: { if (secondaryWeapon player == "") then{ _addWeaponToHands = true; }; }; case 4: { if (handgunWeapon player == "") then{ _addWeaponToHands = true; }; }; }; if (_addWeaponToHands) then{ player addWeapon _x; } else { _errorMsg = "Not enough space"; }; }; } else { if ([_x, "CfgMagazines"] call EPOCH_isAny) then{ if (player canAdd _x) then{ player addMagazine _x; } else { _errorMsg = "Not enough space"; }; }; }; } forEach(_this select 1); 0 = [format["%1", _errorMsg], 0, 0.4, 5, 2, 0, 2] spawn bis_fnc_dynamictext; } else { _errorMsg = 'Failed To Purchase Items'; 0 = [format["%1", _errorMsg], 0, 0.4, 5, 2, 0, 2] spawn bis_fnc_dynamictext; }; }; EPOCH_TRADE_COMPLETE = nil; EPOCH_TRADE_STARTED = nil; }; }; }; precompile.sqf diag_log 'EMOD: Precompile Running'; EPOCH_npcTraderAdd = compileFinal preprocessFileLineNumbers "custom\a3_epoch_code\compile\traders\OP_npcTraderAdd.sqf"; EPOCH_startNpcTrade = compileFinal preprocessFileLineNumbers "custom\a3_epoch_code\compile\traders\OP_startNpcTrade.sqf"; call compile preprocessFileLineNumbers "custom\a3_epoch_code\init\fn_init.sqf"; diag_log 'EMOD: Precompile Finished'; so wats missing? ;p Server side make npc trade, thats whats missing Link to comment Share on other sites More sharing options...
Leigham Posted January 11, 2015 Report Share Posted January 11, 2015 i cant find the prices, where would i get this ? Link to comment Share on other sites More sharing options...
Humpabry Posted January 11, 2015 Report Share Posted January 11, 2015 Server side make npc trade, thats whats missing thank you very bloody much! Link to comment Share on other sites More sharing options...
Humpabry Posted January 11, 2015 Report Share Posted January 11, 2015 so if i change configFile >> "CfgPricing to missionconfigfile >> "CfgPricing will this work? Link to comment Share on other sites More sharing options...
BenR Posted January 11, 2015 Report Share Posted January 11, 2015 That will get info from your custom cfgpricing yeah Link to comment Share on other sites More sharing options...
Humpabry Posted January 11, 2015 Report Share Posted January 11, 2015 server did not boot wen i changed it to that :/ i changed all the configFile >> "CfgPricing to missionconfigfile >> "CfgPricing in Epoch_server_MakeNpcTrade that correct? also would i have to do it with the CfgVehicles too..is that possibly why server did not load? Link to comment Share on other sites More sharing options...
BenR Posted January 11, 2015 Report Share Posted January 11, 2015 The epoch server dll breaks the server if you change the server files, for bug fixing reasons. Secondly you dont want to mess with the cfgvehicles entries as they do not need to be changed Link to comment Share on other sites More sharing options...
Humpabry Posted January 11, 2015 Report Share Posted January 11, 2015 (edited) so i guess i can copy the file over to my mission side..call it from precomfile? or will this also break it? that does not work Edited January 11, 2015 by Humpabry Link to comment Share on other sites More sharing options...
Ducky Posted January 14, 2015 Report Share Posted January 14, 2015 Anyone got any further on this then??? Link to comment Share on other sites More sharing options...
prue420 Posted January 14, 2015 Report Share Posted January 14, 2015 I know i am close but i just cant get money back. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now