Installation
1. Dependencies
Make sure these are installed and started before vns-bitcoin:
- Your framework:
qb-core,qbx_coreores_extended - ox_lib
- oxmysql
- vns-core - free and open source, downloaded separately from your Keymaster/cfx Portal (it is not inside the script zip and updates on its own)
- mhacking - the hacking minigame. It is listed as a dependency in
fxmanifest.lua, so the script won't start without it. To use a different minigame, see Using another hacking minigame.
vns-core detects your framework and inventory automatically and registers the laptop as a usable item. The script has no framework settings of its own and doesn't use the database.
2. Resource
Copy the vns-bitcoin folder into your resources and start it after its dependencies:
ensure qb-core # or qbx_core / es_extended
ensure ox_lib
ensure oxmysql
ensure vns-core
ensure mhacking
ensure vns-bitcoin
Ensure order
vns-coremust be ensured after ox_lib, oxmysql (database), your framework, inventory, target system and your other server scripts such as housing, garages and phone.vns-bitcoinmust be ensured aftervns-core.
If vns-core starts too early, VNS scripts can't use your database, items, money or other systems. See Installing vns-core.
3. Items
Add these items to your inventory. The names must match Config.DBItems and Config.BrokenLaptop:
| Item name | Used for |
|---|---|
bitcoin |
Reward and shop currency (Config.DBItems.bitcoin). |
druglaptop |
Usable item that starts the hack (Config.DBItems.device). It is not consumed by a normal hack. |
brokenlaptop |
What the laptop turns into when it breaks (Config.BrokenLaptop.name). |
Every entry in Config.Items (the shop stock) must exist as an item too - by default tint_green, tint_orange, grip, suppressor, mag and bulletproof. Replace them with items your server actually has.
4. Using another hacking minigame
Both hacking rounds go through StartHackMinigame(level, time, callback) in client/client_open.lua. Replace its body with your own minigame and call callback(true) on success or callback(false) on failure. level and time come from Config.mHack. If you remove mhacking completely, also remove 'mhacking' from the dependencies block in fxmanifest.lua.
5. First start
- Start the server and use a
druglaptop- the connecting bar and the first mhacking round should appear. - Walk to the shop marker (default
-1052.04, -232.23, 43.02) and press E to check the menu opens with prices.
Encrypted variant
config.lua, locales/*.lua, client/client_open.lua and server/server_open.lua stay editable in the Encrypted variant - everything on this page and the Configuration page can be changed in both variants.
Updating from the previous version
- vns-core is now required, and the script now runs on QBCore and QBox as well as ESX.
- Removed options:
Config.ESX,Config.OLDESXandConfig.ProgressBars. The@es_extended/imports.luamanifest line is gone. - progressBars is no longer used. The connecting bar is shown through vns-core; you can remove the
progressBarsresource if nothing else needs it. - ESX menu replaced. The shop is now an ox_lib context menu;
esx_menu_defaultis no longer needed. - mhacking is still required, but can now be swapped through the
StartHackMinigamehook. - Rewards and prices are validated server-side. Bitcoins are only paid for a hack session the server started by the laptop being used, and the shop always charges the server's price.
- Weapons from the shop are now given as inventory items through vns-core.
- Notifications moved to
client/client_open.lua/server/server_open.lua.