Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ##################### 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 = 1; // Serveruptime after restart in hours
- DYNMARKET_UseExternalDatabase = true; // Should the script use the External Database?
- DYNMARKET_PriceUpdateInterval = 1; // 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 = false; // Should the user be informed with a hint whenever the prices got updated?
- // █████████████████ USER NOTIFICATION TEXTS █████████████████
- DYNMARKET_UserNotification_Text =
- [
- "les prix sont mis a jour ! ",
- "Les nouveaux prix sont calculés par l'île ..."
- ];
- // █████████████████ ITEM GROUP CONFIGURATION █████████████████
- DYNMARKET_Items_Groups =
- [
- ["Legal",
- [
- ["oil_processed",-1,900,1750],
- ["copper_refined",-1,400,1200],
- ["iron_refined",-1,400,1200],
- ["salt_refined",-1,800,1600],
- ["glass",-1,800,1600],
- ["diamond_cut",-1,1500,2250],
- ["cement",-1,800,2220],
- ["popcorn",-1,150,400],
- ["pot_de_miel",-1,975,2500],
- ["lingot_argent",-1,1500,2250],
- ["sucre",-1,1000,2500],
- ["coffee",-1,2200,3800],
- ["cannabis_medic",-1,2800,4000],
- ["meuble",-1,3000,4200],
- ["chaussure",-1,2750,4300],
- ["pizza",-1,3300,5000],
- ["bouteille_de_vinasse",-1,3500,6500],
- ["mojito",-1,10000,25000]
- ],
- 0.5
- ],
- ["Illegal",
- [
- ["heroin_processed",1,5320,8640],
- ["marijuana",1,4590,7860],
- ["cocaine_processed",1,5320,8670],
- ["chaussure_de_contrebande",1,4000,8000],
- ["arme",1,6000,12000],
- ["bijou",1,7000,14000],
- ["sachet_de_champi",1,9000,18000],
- ["bouteille_absinthe",1,10000,25000],
- ["organe_masculin",1,25000,40000],
- ["organe_feminin",1,28000,43000],
- ["organe_enfant",1,35000,48000],
- ["goldbar",1,200000,255000]
- ],
- 0.5
- ]
- ];
- //ALL SELLABLE ITEMS
- DYNMARKET_Items_ToTrack =
- [
- ["popcorn",250],
- ["copper_refined",400],
- ["iron_refined",400],
- ["salt_refined",800],
- ["glass",800],
- ["cement",800],
- ["oil_processed",900],
- ["diamond_cut",1500],
- ["pot_de_miel",975],
- ["lingot_argent",1500],
- ["sucre",1000],
- ["coffee",2200],
- ["cannabis_medic",2800],
- ["meuble",3000],
- ["marijuana",4590],
- ["chaussure",2750],
- ["heroin_processed",5320],
- ["cocaine_processed",5320],
- ["pizza",3300],
- ["bouteille_de_vinasse",3500],
- ["chaussure_de_contrebande",4000],
- ["arme",6000],
- ["bijou",7000],
- ["sachet_de_champi",9000],
- ["bouteille_absinthe",10000],
- ["mojito",10000],
- ["organe_masculin",25000],
- ["organe_feminin",28000],
- ["organe_enfant",35000],
- ["goldBar",200000]
- ];
- //███████████████████████████████████████████████████████████████████████
- //██████████████████ 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 {
- 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;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement