mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-17 05:56:01 +01:00
Update main.lua
renamed getMoney server event to updateMoney and removed unnecessary for loop.
This commit is contained in:
@@ -157,15 +157,13 @@ AddEventHandler("addCash", function(amount, characterid)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
-- This is used to find out how much money the player has and use it in the client to show it on the ui.
|
-- This is used to find out how much money the player has and use it in the client to show it on the ui.
|
||||||
RegisterNetEvent("getMoney")
|
RegisterNetEvent("updateMoney")
|
||||||
AddEventHandler("getMoney", function(characterid)
|
AddEventHandler("updateMoney", function(characterid)
|
||||||
local player = source
|
local player = source
|
||||||
exports.oxmysql:query("SELECT cash, bank FROM characters WHERE license = ? AND character_id = ?", {GetPlayerIdentifierFromType("license", player), characterid}, function(result)
|
exports.oxmysql:query("SELECT cash, bank FROM characters WHERE license = ? AND character_id = ?", {GetPlayerIdentifierFromType("license", player), characterid}, function(result)
|
||||||
if result then
|
if result then
|
||||||
for i = 1, #result do
|
cash = result[1].cash
|
||||||
cash = result[i].cash
|
bank = result[1].bank
|
||||||
bank = result[i].bank
|
|
||||||
end
|
|
||||||
TriggerClientEvent("returnMoney", player, cash, bank)
|
TriggerClientEvent("returnMoney", player, cash, bank)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user