Crypto

Welcome to Crypto DLC

Introduction

Quasar Crypto is an exclusive DLC for Quasar Smartphone, this DLC will add a new application of virtual Cryptocurrencies (they are not real) which allows players to invest in their favorite crypto, buy or sell.

This DLC requires adding a new account in case of esx, you must create the crypto account in your es_extended/config.lua.

Features

  • Trade crypto currencies.

  • Sell cryptocurrency.

  • Buy cryptocurrencies.

  • A new account on your server.

  • These currencies are fictitious, there is nothing to do with real crypto.

Dependencies

This package is compatible with es_extended 1.2 and all Legacy.

  • es_extended or qb-core

  • qs-smartphone

Starting order of the assets

ensure qb-core
ensure [inventory]

-- [smartphone]
ensure PolyZone
ensure xsound
ensure screeshot-basic
ensure qs-videos
ensure qs-smartphone

-- all 
OTHERS SCRIPTS

-- DLCS
ensure qs-cryto

Installation

1. Install the sql

DROP TABLE IF EXISTS `phone_crypto`;
CREATE TABLE `phone_crypto` (
  `crypto` varchar(50) NOT NULL DEFAULT 'btc',
  `worth` int(11) NOT NULL DEFAULT 0,
  `history` text NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

ALTER TABLE `phone_crypto`
  ADD PRIMARY KEY (`crypto`);
COMMIT;

DROP TABLE IF EXISTS `crypto_transactions`;
CREATE TABLE `crypto_transactions` (
  `id` int(11) NOT NULL,
  `identifier` varchar(46) DEFAULT NULL,
  `title` varchar(50) DEFAULT NULL,
  `message` varchar(50) DEFAULT NULL,
  `date` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

ALTER TABLE `crypto_transactions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `identifier` (`identifier`);

ALTER TABLE `crypto_transactions`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=753;
COMMIT;

2. Prepare your Config.lua

Go to config.lua and set it your way for ESX

Config = {}
Locales = Locales or {}

Config.Framework = 'qb' -- 'esx' or 'qb'

Config.Language = 'en'

Crypto = {
    Lower = 500,
    Upper = 5000,

    Debug = true,

    History = {
        ["btc"] = {}
    },

    Worth = {
        ["btc"] = 1000
    },

    Labels = {
        ["btc"] = "BTC"
    },

    Exchange = {
        coords = vector3(1276.21, -1709.88, 54.57),
        RebootInfo = {
            state = false,
            percentage = 0
        },
    },

    Coin = 'btc', -- For auto updating the value of btc
    RefreshTimer = 5, -- In minutes, so every 5 minutes.

    ChanceOfCrashOrLuck = 2, -- This is in % (1-100)
    Crash = {20,80}, -- Min / Max
    Luck = {20,45}, -- Min / Max

    ChanceOfDown = 30, -- If out of 100 hits less or equal to
    ChanceOfUp = 60, -- If out of 100 is greater or equal to
    CasualDown = {1,10}, -- Min / Max (If it goes down)
    CasualUp = {1,10}, -- Min / Max (If it goes up)
}

Ticker = {
    Enabled = false, -- Decide whether the real life price ticker should be enabled or not :)  
    coin = 'BTC', -- The coin, please make sure you find the actual name, for example: Bitcoin vs BTC, BTC would be correct
    currency = 'USD', -- For example USD, NOK, SEK, EUR, CAD and more here https://www.countries-ofthe-world.com/world-currencies.html
    tick_time = 2, -- Minutes (Minimum is 2 minutes) 20,160 Requests a month, Its recommended to get the free API key so the crypto script doesnt switch on and off if ratelimit is encountered
    Api_key = 'put_api_key_here', -- If you decide to get an api key for the API (https://min-api.cryptocompare.com/pricing) The free plan should be more than enough for 1 Fivem server
    Error_handle = { -- Error handle stuff, for more user friendly and readable errors, Don't touch.
        ['fsym is a required param.'] = 'Config error: Invalid / Missing coin name',
        ['tsyms is a required param.'] = 'Config error: Invalid / Missing currency',
        ['cccagg_or_exchange'] = 'Config error: Invalid currency / coin combination', -- For some reason api throws this error if either coin or currency is invalid
    },
}

3. Enable crypto application

Remove crypto application comments in qs-smartphone/config/apps.lua

    ["crypto"] = {
        custom = false,
        app = "crypto",
        color = "img/apps/crypto.png",
        tooltipText = "Binance",
        tooltipPos = "top",
        job = false,
        blockedjobs = {},
        slot = 41,
        creator = "Binance LTD",
        Alerts = 0,
        password = false,
        isGame = false,
        description = "A crypto exchange for all those diamondhands",
        score = "4.25", -- Options: 0, 0.25, 0.5, 0.75, 1, 1.25, 1.50, 1.75, 2, 2.25, 2.50, 2.75, 3, 3.25, 3.50, 3.75, 4, 4.25, 4.50, 4.75, 5
        rating = "316K Ratings",
        age = "18+",
        extraDescription = {
            {
                header = "BINANCE",
                head = "Cryptocurrency Exchange",
                image = "https://v2.cimg.co/news/75173/174150/adobestock-iryna-budanova-1-1.jpg",
                footer = "Binance: Buy Bitcoin!",
                textcolor = 'white'
            }
        }
    },

Last updated