ghmattibanking
Try #2. This time with source and license, there was a miscommunication making me believe that I needed to make it more difficult to edit the resource.
This topic is a low quality copy & pasta from the old one.
Features
- A fully operational cash / banking system that should be able to merge into any system you like.
- Shared Accounts between Users.
- Multiple Accounts for Users.
- More to come, eventually. Maybe.
Requirements
- A newer FXServer Version
- MariaDB 10.3.1 or newer or MySQL 5.7 / 8.x
Installation
- Download from GitHub
- Modify both the config.client.json and the server.client.json
- See some errors on the first startup, as the ghmattibanking has not created the tables yet.
Previews
Bindings (Server-Side Only)
These are for account and cash management. See the wiki on github for quick examples and more details.
sign in
exports.ghmattibanking:signIn(source, username)
: The username is the display name that ghmattibanking uses. The username does not have to be unique, but can be an Name of a character the user you wish to sign in uses or something like that. Easiest would be exports.ghmattibanking:signin(source, GetPlayerName(source))
reward
exports.ghmattibanking:reward(source, amount, [optional: origin, purpose])
This gives the source cash or transfers money to one of his bank accounts (prefering fleeca), depending on whether origin and purpose was specified or not.
pay
The same as reward
exports.ghmattibanking:reward(source, amount, callback, [optional: origin, purpose])
works the same way as reward, but has a callback that is passed true or false whether paying has succeeded or not.
Bindings (client-side)
These bindings are just for the display of cash to suit them to your system
displayDriverCallFeed
The event gets triggered every 1.5s with the current cash and total accounts balance [params: (cash, bank)
].
displayDriverCallPersistantShow
In the banking interface cash should be always displayed as seen in the previews. This event gets passed a true or false value whether it wants to permanently show cash or not.
Some Random Explanations and Rambling
You can post feature requests, but I will very likely update it as I see fit. Or maybe migrate it to MongoDB.
ghmattibanking features 3 banking interfaces (which are the same but with different styles) based on vuetify. I added most bank-buildings as banks as you can see from the maze-bank one and the maze-bank tower, mainly due to inscription.
Paletos Bank and the Pacific Standard Bank have been assigned to be Lombanks, because I did not feel like making two more interfaces.
All red atms are maze-bank atms, all purple/blue ones are Lombank ones, the others are used by Fleeca.
By default you cannot create accounts or edit them at Atms, only at banks, there is although a client-side option to avoid this behaviour.
The serverside option overdrawLimit
lets you set how much your users can go into negative before the queries will error out, thus failing transactions, withdrawls. Default is 0, and unless you know what you are doing, keep it at 0.
Accounts can currently not be overcharged over that limit, and then only by the user himself, I think. Not sure if pay allows overdrawing, as of writing this. Keep it at 0.
I will probably edit this topic a lot, because there is a lot of stuff I forgot and this is pretty unordered. Also be snailsome to each other and party on.
Known Issues
- Jerky Behaviour of the NUI sometimes. Skipping frames, sometimes not recieving the message to close, etc.
For Quick Testing
RegisterCommand('signin', function (src)
exports.ghmattibanking:signIn(src, GetPlayerName(src));
end);
to create a command to signIn. Hopefully this works in lua.