Skip to content

Install [LVOS] Stock Exchange

PandaBasketteur edited this page Jun 1, 2017 · 4 revisions

Installing FiveM Files

This step is not necessary, it is better to adapt your inventory system

  • Download resources on github
  • In folder : Server. Copy stock_exchange folder in it to the resources folder
  • Add '- stock_exchange' to AutoStartResources in citmp-server.yml
  • Adapt the script to your resources

Installing the Stock Exchange Processing Files

This part of the installation is quite important if you want the purse to be automatic. All the procedures were done on Debian 8. There must be equivalents for windows, but I would explain only for Linux.

  1. Put processing files in a folder on your linux server

Copy folder LVOS_Treatment in Web folder on GitHub Project, Put in the folder /home for example. It is not necessary to have apache to execute, it is even recommended to leave these files offline not accesible from the outside.

If this is not done install php on your machine : apt-get install php5 php5-cli

In our case we will put the file in /home of the hit the path will be /home/LVOS_Treatment

  1. Create CRON Tasks

Now we will create tasks that run every 10 minutes, you can change this value of course according to your desires. With this, the scholarship will be updated every 10 minutes.

To do this, install crontab : apt-get install

Once installed we will add the tasks, to add a task done:

crontab -e

Then add for example :

*/10 * * * * php /home/LVOS_Treatment/cannabis-extasy.php

And for reset stock exchange (In this example the purse resets to zero every day at midnight) :

0 0 * * * php /home/LVOS_Treatment/reset.php

Cela pourrais ressemble à :

*/10 * * * * php /home/LVOS_Treatment/cannabis-extasy.php

*/10 * * * * php /home/LVOS_Treatment/cocaine-heroine.php

*/10 * * * * php /home/LVOS_Treatment/fuel-bois.php

*/10 * * * * php /home/LVOS_Treatment/saumon-or.php

*/10 * * * * php /home/LVOS_Treatment/thon-fer.php

*/10 * * * * php /home/LVOS_Treatment/thonrouge-diamant.php

0 0 * * * php /home/LVOS_Treatment/reset.php

Here is your scholarship is now dynamic we will see later to configure the parameters of price variation

  1. Change Database SQL informations

Change the information in the database.php file to /home/LVOS_Treatment/pass/database.php

$bdd = new PDO('mysql:host=SERVER;dbname=DATABASENAME', 'USER', 'PASSWD');

  1. Great !

Installing Web Site

This step is not mandatory, I could not tell you exactly how to setup a website there are several method to you to see which one. #Google.com

Put files in the /LVOS_WebSite Stock Exchange folder either at root of your site or in a folder called stock_exchange for example to access it by spanking www.site.com/strock_exchange for example. Up to you.

Configure the values for the database, know that the page can contain a different database .. finally you have surely understood. I put an example in the menu with a little reflection you can easily make a menu with multiple server connected to several base if necessary. The configuration file is located in /pass/database.php or /pass/database2.php for another server. Copy / Paste to do other stock exchange according to the servers.

More information in the configuration section of the wiki.

Others

I would not be responsible for any problems