🪙 qb-crypto
導入
- このリソースは、プレイヤーがQbitを売買できるように、暗号通貨市場を管理します。また、「クリプトスティック」と呼ばれるアイテムも含まれており、指定された場所でQbitと交換できます。一部のジョブでは、このアイテムがランダム報酬として既に用意されています。
[!WARNING] このリソースはqb-phoneでのみ動作します。qb-phoneがないと、プレイヤーはqbitを売買できません。
プレビュー

構成
Crypto = {
Lower = 500, -- Lowest possible crypto worth
Upper = 5000, -- Highest possible crypto worth
History = { ["qbit"] = {}}, -- Stores crypto worth history for viewing
Worth = {["qbit"] = 1000}, -- Starting crypto worth (can add more)
Labels = {["qbit"] = "Qbit"}, -- Crypto type label (can add more)
Exchange = { -- Exchange point for cryptosticks
coords = vector3(1276.21, -1709.88, 54.57),
RebootInfo = {
state = false,
percentage = 0
},
},
-- For auto updating the value of qbit
Coin = 'qbit',
RefreshTimer = 10, -- In minutes, so every 10 minutes.
-- Crashes or luck
ChanceOfCrashOrLuck = 2, -- This is in % (1-100)
Crash = {20,80}, -- Min / Max
Luck = {20,45}, -- Min / Max
-- If not not Chance of crash or luck
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, -- Enable/disable real life crypto prices
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 stuff, for more user friendly and readable errors, Don't touch.
Error_handle = {
['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
},
}コマンド
- /setcryptoworth - 暗号タイプの価値を設定する管理者専用コマンド
- /checkcryptoworth - qbitの現在の価値を確認する
- /crypto - qbitの残高と価値を表示する
アイテム
- クリプトスティック - プレイヤーはこれを交換ポイントに持っていき、そこから暗号通貨を得ることができます。
Last updated on