From 67eb36a30ae531d3a473aa254a1cf42562955a6f Mon Sep 17 00:00:00 2001 From: nojdh Date: Tue, 25 Jun 2019 22:46:19 +0200 Subject: [PATCH] Add files via upload --- StreetRaces/port_sv_ESX_version.lua | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 StreetRaces/port_sv_ESX_version.lua diff --git a/StreetRaces/port_sv_ESX_version.lua b/StreetRaces/port_sv_ESX_version.lua new file mode 100644 index 0000000..e324bd8 --- /dev/null +++ b/StreetRaces/port_sv_ESX_version.lua @@ -0,0 +1,31 @@ +ESX = nil +TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) + +-- Helper function for getting player money +function getMoney(source) + local xPlayer = ESX.GetPlayerFromId(source) + local getmoney = xPlayer.getMoney() + return getmoney +end + +-- Helper function for removing player money +function removeMoney(source, amount) + local xPlayer = ESX.GetPlayerFromId(source) + xPlayer.removeMoney(amount) +end + +-- Helper function for adding player money +function addMoney(source, amount) + local xPlayer = ESX.GetPlayerFromId(source) + xPlayer.addMoney(amount) +end + +-- Helper function for getting player name +function getName(source) + return GetPlayerName(source) +end + +-- Helper function for notifying players +function notifyPlayer(source, msg) + TriggerClientEvent('chatMessage', source, "[RACE]", {255,64,64}, msg) +end