i have created the example below because i see people are still asking for information regarding how the money system works
It will load the amount you have set in the database.
Add this to your own game mode or to the example game mode…
server.lua
AddEventHandler('es:playerLoaded', function(source)
-- Get the current amount for the player
TriggerEvent('es:getPlayerFromId', source, function(user)
-- Activate the money for the current player
user:setMoney((user.money))
-- Send the player some information regarding the money
TriggerClientEvent('chatMessage', source, "SYSTEM", {187, 235, 42}, "Your money amount is: $" .. tonumber(user.money))
end)
end)
16 Likes
Thank you so much, you rock!
1 Like
Finally! Thank you for making this.
1 Like
you need to add the code to your own game mode or the example_gamemode that is delivered with essential mode.
is it the same as adding a resource??
you will have to figure that out on your own
wow…Thanks for the help lol
nah just type F8 in the game and just add whats on top basically
i love u so much! i love u so much! i love u so much!
1 Like
can you show a exemple for the new essentialmode because the default one is in Euro and i dont know how to to activate the money receive !
1 Like
I changed the example for the new essentialmode version
i dont find the files in the new essentialmode to put your code, im not very good in coding btw i just begin -_-
Hello, I would like to know if it is possible to link this money system with the vehicle shop that was created on this forum? Because when I give myself the money and I buy a vehicle it does not take away the price of the vehicle bought thank you
Here is an updated vehicule shop that works with the money :
https://github.com/FiveM-Scripts/es_vehshop
Yeah i see this vehicule shop, but it work with wich system of money ? es_freeroam or a this system of money ? THX
it works only with es_freeroam since it handles the cmd /pv
So your system of money doesn’t work with vehicule shop ?
1 Like
@Thomas_Neyens Well that vehicle shop will remove the money from the database.
It will also store the vehicle you bought so that you can spawn it when you join the server again.