/* ##################### DYNAMIC MARKET SCRIPT ##################### ### AUTHOR: RYAN TT. ### ### STEAM: www.steamcommunity.com/id/ryanthett ### ### ### ### DISCLAIMER: THIS SCRIPT CAN BE USED ON EVERY SERVER ONLY ### ### WITH THIS HEADER / NOTIFICATION ### ################################################################# */ // ███████████████████████████████████████████████████████████████████████ // █████████████████ DYNAMIC MARKET BASIC CONFIGURATION ██████████████████ // ███████████████████████████████████████████████████████████████████████ DYNMARKET_Serveruptime = 6; // Serveruptime after restart in hours DYNMARKET_UseExternalDatabase = true; // Should the script use the External Database? DYNMARKET_PriceUpdateInterval = 5; // After how many minutes should the price be updated? DYNMARKET_CreateBackups = true; // Should the server save write the prices regulary into the Database? If false, it will save the prices before Server-restart? DYNMARKET_CreateBackupInterval = 1; // After how many updates (PriceUpdateIntervals) should the prices be saved into the Database? DYNMARKET_UserNotification = true; // Should the user be informed with a hint whenever the prices got updated? // █████████████████ USER NOTIFICATION TEXTS █████████████████ DYNMARKET_UserNotification_Text = [ "Die Marktpreise haben sich geändert!", "Die neuen Preise werden vom Server berrechnet..." ]; // █████████████████ ITEM GROUP CONFIGURATION █████████████████ DYNMARKET_Items_Groups = [ ["All", [ ["silber",-1,1,3500], ["aluminium",-1,1,3200], ["iridium",-1,1,3000], ["oil_processed",-1,1,3500], ["copper_refined",-1,1,2400], ["iron_refined",-1,1,3000], ["salt_refined",-1,1,2500], ["glass",-1,1,3750], ["diamond_cut",-1,1,3800], ["cement",-1,1,3700], ["bier",-1,1,5000], ["uran",-1,1,32000], ["lsd",-1,1,7000], ["heroin_processed",-1,1,5650], ["marijuana",-1,1,5050], ["cocaine_processed",-1,1,6350], ["turtle_raw",-1,1,35000] ], 0.3 ] ]; // █████████████████ ALL SELLABLE ITEMS █████████████████ DYNMARKET_Items_ToTrack = [ ["silber",2800], ["aluminium",2500], ["iridium",2300], ["oil_processed",2800], ["copper_refined",1000], ["iron_refined",1500], ["salt_refined",1000], ["glass",2650], ["diamond_cut",2900], ["cement",2500], ["bier",1000], ["uran",30000], ["lsd",4000], ["heroin_processed",3950], ["marijuana",3350], ["cocaine_processed",4650], ["turtle_raw",30000] ]; //███████████████████████████████████████████████████████████████████████ //██████████████████ DO NOT MODIFY THE FOLLOWING CODE! ██████████████████ //███████████████████████████████████████████████████████████████████████ DYNMARKET_Items_CurrentPriceArr = []; DYNMARKET_sellarraycopy = DYNMARKET_Items_ToTrack; DYNMARKET_Serveruptime = (DYNMARKET_Serveruptime * 3600) - 300; { _currentArray = _x; DYNMARKET_Items_CurrentPriceArr pushBack [_currentArray select 0,_currentArray select 1,0]; } forEach DYNMARKET_Items_ToTrack; publicVariable "DYNMARKET_UserNotification"; publicVariable "DYNMARKET_UserNotification_Text"; if (DYNMARKET_UseExternalDatabase) then {[1] call TON_fnc_HandleDB;}; DYNMARKET_UpdateCount = 0; if (DYNMARKET_UseExternalDatabase) then { [] spawn { while {true} do { sleep DYNMARKET_Serveruptime; diag_log "### DYNMARKET >> CURRENT PRICES ARE BEING WRITTEN TO THE DATABASE ###"; diag_log "### DYNMARKET >> AS PLANNED, AWAITING RESULT... ###"; [0] call TON_fnc_HandleDB; }; }; }; sleep 5; [] call TON_fnc_sleeper;