Updated 2.1.0

Updated everything to new format, N1K0 is about to work on some more stuff.
This commit is contained in:
Andyyy7666
2022-07-16 04:46:27 +02:00
parent e25da65776
commit 96f89d60ff
37 changed files with 924 additions and 854 deletions

View File

@@ -1,5 +1,6 @@
-- For support join my discord: https://discord.gg/Z9Mxu72zZ6
NDCore = exports["ND_Core"]:GetCoreObject()
local display = false
local nearModel = false
@@ -35,13 +36,13 @@ end
-- Hide/Show ui
function SetDisplay(bool)
local playerInfo = exports["ND_Core"]:getCharacterInfo()
local selectedCharacter = NDCore.functions:getSelectedCharacter()
display = bool
SetNuiFocus(bool, bool)
SendNUIMessage({
status = bool,
playerName = playerInfo.firstName .. " " .. playerInfo.lastName,
balance = "Account Balance: $" .. playerInfo.bank .. ".00",
playerName = selectedCharacter.firstName .. " " .. selectedCharacter.lastName,
balance = "Account Balance: $" .. selectedCharacter.bank .. ".00",
date = days[GetClockDayOfWeek() + 1],
time = getTime()
})
@@ -116,7 +117,7 @@ RegisterNUICallback("useATM", function(data)
})
return
end
TriggerServerEvent("ND_ATM:withdraw", data.amount)
TriggerServerEvent("ND_ATMs:withdraw", data.amount)
elseif action == "DEPOSIT" then
if data.amount == "" then
Citizen.Wait(1000)
@@ -125,17 +126,17 @@ RegisterNUICallback("useATM", function(data)
})
return
end
TriggerServerEvent("ND_ATM:deposit", data.amount)
TriggerServerEvent("ND_ATMs:deposit", data.amount)
end
end)
-- update the balance on the ui and confirm if the deposit/withdraw was successful.
RegisterNetEvent("ND_ATM:update")
AddEventHandler("ND_ATM:update", function(status)
RegisterNetEvent("ND_ATMs:update")
AddEventHandler("ND_ATMs:update", function(status)
Citizen.Wait(1000)
local playerInfo = exports["ND_Core"]:getCharacterInfo()
local selectedCharacter = NDCore.functions:getSelectedCharacter()
SendNUIMessage({
balance = "Account Balance: $" .. playerInfo.bank .. ".00",
balance = "Account Balance: $" .. selectedCharacter.bank .. ".00",
success = status
})
end)

View File

@@ -1,13 +1,16 @@
RegisterNetEvent("ND_ATM:withdraw")
AddEventHandler("ND_ATM:withdraw", function(amount)
NDCore = exports["ND_Core"]:GetCoreObject()
NDCore.functions:versionChecker("ND_ATMs", GetCurrentResourceName(), "https://github.com/Andyyy7666/ND_Framework", "https://raw.githubusercontent.com/Andyyy7666/ND_Framework/main/ND_ATMs/fxmanifest.lua")
RegisterNetEvent("ND_ATMs:withdraw")
AddEventHandler("ND_ATMs:withdraw", function(amount)
local player = source
local update = exports["ND_Core"]:withdrawMoney(amount, player)
TriggerClientEvent("ND_ATM:update", player, update)
local update = NDCore.functions:withdrawMoney(amount, player)
TriggerClientEvent("ND_ATMs:update", player, update)
end)
RegisterNetEvent("ND_ATM:deposit")
AddEventHandler("ND_ATM:deposit", function(amount)
RegisterNetEvent("ND_ATMs:deposit")
AddEventHandler("ND_ATMs:deposit", function(amount)
local player = source
local update = exports["ND_Core"]:depositMoney(amount, player)
TriggerClientEvent("ND_ATM:update", player, update)
local update = NDCore.functions:depositMoney(amount, player)
TriggerClientEvent("ND_ATMs:update", player, update)
end)