GithubHelp home page GithubHelp logo

rf_atm's Introduction

rF_ATM

rF_ATM is a FiveM resource that brings the original GTA V ATM to FiveM servers.

As this resource is not linked to a framework, you may have to alter the database values on the server file to match your framework.

Dependencies

  • mysql-async

Usage

To use this on your server it is likely that you will have to adjust the config, or for alternate database structures, adjust the server file itself. The server file should be self explanatory as the events are explained below. It is also possible to delete my server file and simply handle these events in your own framework.
ATM Locations need not be defined by the server owner because the script will recognize ATMs from object hashes that I have provided. ATM hashes may be added or deleted in the client file.

Database Structure

This resource will attempt to access a database table containing an identifying element for users (like a steamid or discordid) and then access their bank and cash values. If these values are not stored in the same row in a table, you will have to edit the SQL queries. Additionally, this resource needs a table that can hold transaction data. I have provided an .sql file in this resource to help define both tables necessary, however the provided user table will not work unless connected to your server's framework.

At this time, there is no translation support other than going through the client file and changing text.

Events

rF_ATM:Transaction - Client to Server - Params(rF_TransactionAmount, rF_IsWithdrawal)

Sent each time a player makes a client side transaction on an ATM.

  1. Verifies that the transaction is possible given the player's current bank and cash values.
  2. Updates database table to reflect new bank and cash values for the player.
  3. Creates a database entry for the transaction.
  4. Sends the player's client an event (rF_ATM:TransactionSuccess) to signal that the transaction was successful and to update the player's ATM values (bank, cash, transaction).

rF_ATM:StartATM - Client to Server - Params()

Sent when the client script initializes.

  1. Fetches bank, cash and transaction values from the database.
  2. Sends the player's client two events (rF_ATM:SetMoney, rF_ATM:SetMoney) to initialize the client's ATM values (bank, cash, transaction).

rF_ATM:TransactionSuccess - Server to Client - Params(rF_BankAmount, rF_CashAmount, rF_TransactionJSON)

Sent when the server verifies a transaction.

  1. Sets rF_PlayerBank and rF_PlayerCash to reflect the values from the server.
  2. Adds the given transaction to the transactions table, rF_Transactions.

rf_atm's People

Contributors

neirbonhoj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.