forked from MysticRP/blanchisseur
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.lua
36 lines (30 loc) · 1.1 KB
/
server.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--[[
##################
# Oskarr #
# MysticRP #
# server.lua #
# 2017 #
##################
Edited by: redoper, 2018
--]]
ESX = nil
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
local tax = 0.80 -- 0.80 : 100000$ dirty = 80000$ // 0.80 : 100 000 dirty money = 80 000$ clean money
RegisterServerEvent("blanchisseur:BlanchirCash")
AddEventHandler("blanchisseur:BlanchirCash", function(amount)
local source = source
local xPlayer = ESX.GetPlayerFromId(source)
local money = xPlayer.getMoney()
local dirtyMoney = xPlayer.getAccount('black_money').money
local amount = amount
if (dirtyMoney <= 0) then
TriggerClientEvent("esx:showNotification", source, "~y~You do not have money to launder.")
else
local washedMoney = amount * tax
local total = money + washedMoney
local totald = dirtyMoney - amount
xPlayer.setMoney(total)
xPlayer.setAccountMoney('black_money', totald)
TriggerClientEvent("esx:showNotification", source, "You have laundered ~r~$".. tonumber(amount) .."~s~ dirty money.~s~ Now you have ~g~$".. tonumber(total) .."~w~ at your pocket.")
end
end)