This script connects your Tip4serv.com store to your FiveM server. It checks if a player has made a donation on your Tip4Serv store and delivers the order (money, rank, vehicle, item...) by typing commands in the server console
Tip4serv adds a layer of security using HMAC authentication to communicate. It is a strong authentication method that is used by banks https://en.wikipedia.org/wiki/HMAC
- Open an account on Tip4serv.com.
- Fill in the requested information in MY SETTINGS
- Add a FiveM server in MY SERVERS and follow the instructions requested
You get this message in the console when the server has started: Server has been successfully connected
To check if the server is correctly connected type restart tip4serv
in your server console.
- Player make a donation on Tip4Serv store.
- The player receives his order in the game.
The player can also type /checkdonate
on the server chat to receive his order faster.
Before setting up your commands on Tip4serv.com, you should know that command work in your server's console (not ingame as an admin).
If your framework does not offer any console commands you will have to create them see bottom of page.
Here are some commands you can use in the products configuration.
When the player is connected on the FiveM server, his {fivem_live_id}
will be retrieved using the Steam ID
or Discord ID
that he will have entered during his purchase.
Advertise in server chat. (This command is part of Tip4serv script and works natively)
Examples:
t4s_announce [STORE] Thanks to {discord_username} for donating to the server on mystore.tip4serv.com
t4s_announce [STORE] Thanks to {steam_username} for donating to the server on mystore.tip4serv.com
ESX framework and es_extended are required
Give money to a player on his bank account or pocket money.
Example: giveaccountmoney {fivem_live_id} bank 5000
This command gives an inventory item to the user.
Example: giveitem {fivem_live_id} milk 1
This command gives a weapon to the user.
Example: giveweapon {fivem_live_id} WEAPON_STUNGUN 32
This command sets the group of the user.
Example: setgroup {fivem_live_id} vip
This command sets the users job and job grade.
Example: setjob {fivem_live_id} police 1
_givecar {fivem_live_id} [model] ESX Vehicle is required
This command give a vehicle to a player.
Use the console command, the prefix must be "_" :
Example: _givecar {fivem_live_id} t20
You have to set Config.enable_custom_command
to true
in config.lua
file.
This commands are located in this file: /server/commands.lua
.
Give money to a player on his bank account or pocket money.
Example: giveaccountmoney {fivem_live_id} bank 5000
This command set player gang and grade.
Example: setplayergang {fivem_live_id} ballas 1
This command set player job and grade.
Example: setplayerjob {fivem_live_id} police 1
This command set player permissions.
Example: setplayerpermission {fivem_live_id} vip
This command remove all player permissions.
Example: removeplayerpermission {fivem_live_id}
This command give an item to a player inventory
Example: giveinventoryitem {fivem_live_id} WEAPON_KNIFE 1
HH Vehextras is required (But you can use any script as long as it offers console commands)
This command give a vehicle to a player
Example: givevehicletoplayer {fivem_live_id} t20
You can also multiply the quantity choosen by the customer like this: {quantity*100}
Note: You must first activate the Allow quantity choice option in your product
Use this command on Tip4serv if you want to sell bundles of $100:
giveaccountmoney {fivem_live_id} bank {quantity*100}
This will run in your server console after a purchase if the player buys product 4 times:
giveaccountmoney 14 bank 400
Useful if you are creating subscriptions with expiration commands.
Example: if the player unsubscribes, his VIP group will be removed.
To ensure player data is fully loaded, commands with {fivem_live_id}
will only execute if the player has moved at least once since connecting to the server. This is to ensure that the player is not in the loading screen or in the character choice.
If you want to create commands make sure they are console compatible !
Use "RegisterCommand" method: https://docs.fivem.net/docs/scripting-manual/migrating-from-deprecated/creating-commands/
Follow the same example as giveaccountmoney line 10: https://github.com/Murgator/Tip4Serv/blob/master/tip4serv/server/commands.lua
Read the documentation
If you are using another framework or want to create custom commands contact us