Bitcoin Exchange 1.0.0

   (2 reviews)
Sign in to follow this  

1 Screenshot

About This File

pVQKIoY.png

This is a small script that allows players to buy/sell bitcoins.

 

Requirements

  • Currency API (define a currency named "cash" after installing)
  • node-fetch (after installing, go to packages/bitcoin folder, launch command prompt/powershell from shift+rightclick and write "npm install", should download it)

 

Installing

Drag & drop to your server files folder.

 

Config

The config.json file provides some options:

  • updateInterval - The time between BTC price updates, in milliseconds. Default value is 300000 aka 5 minutes.
  • markerColor - Color of the markers, [r, g, b, a] format.
  • markerRange - Range of the markers.
  • exchangeCoords - Positions where players can buy/sell bitcoins. Default values add 2 exchange locations: Lester's house and garment factory.

 

Commands

  • buybtc [amount]
  • sellbtc [amount]

Both commands need you to be inside a Bitcoin Exchange marker.

 

Notes

  • This script does not save data (bought bitcoins etc), saving should be handled by your gamemode since Currency API provides functions for that.
  • BTC price is provided by CoinDesk.
  • Currency API does not support floats so players can't buy less than 1 BTC.
  • Bogdanoff is watching
  • Like 1
  • Mask 1
  • Confused 1



User Feedback

Recommended Comments

How can i get another prices from the server?

How did you find the

"https://api.coindesk.com/v1/bpi/currentprice/USD.json" ?

Share this comment


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now