PaymentMethod is a FiveM resource that allows players to select a payment method for each purchase. This script provides an export function, requestPaymentMethod, which enables developers to easily integrate customizable payment options into their FiveM servers.
Web Template: https://github.com/ardelan869/fivem-frontend-boilerplates
web/providers/LocaleProvider.tsx: https://github.com/overextended/ox_lib/blob/master/web/src/providers/LocaleProvider.tsx, licensed under GNU Lesser General Public License v3.0.
- Allow players to choose between different payment methods (And cancel).
- Supports both in-game cash and bank account as payment methods.
- Easy integration with existing scripts.
- Download the resource:
- Download the newest release from GitHub.
- Add to your FiveM server:
- Place the
paymentmethodfolder into your server'sresourcesdirectory.
- Update
server.cfg:
- Add the following line to your
server.cfgto ensure the resource starts when your server does:ensure paymentmethod
You can use the requestPaymentMethod export in your scripts to prompt the player for a payment method. Here's how it works:
local paymentMethod = exports.paymentmethod:requestPaymentMethod(300)
if not paymentMethod then return print('Payment was canceled!') end
print(paymentMethod) -- Either 'money' or 'bank'
TriggerServerEvent('yourEvent:buyItems', paymentMethod, ...)