diff --git a/__resource.lua b/__resource.lua
index 64f8f083..a143d696 100644
--- a/__resource.lua
+++ b/__resource.lua
@@ -2,7 +2,7 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
description 'ESX Atm'
-version '1.0.0'
+version '1.1.0'
server_scripts {
'@es_extended/locale.lua',
@@ -31,11 +31,11 @@ client_scripts {
ui_page 'html/ui.html'
files {
- 'html/ui.html',
+ 'html/ui.html',
'html/roboto.ttf',
'html/img/fleeca.png',
- 'html/css/app.css',
- 'html/scripts/app.js'
+ 'html/css/app.css',
+ 'html/scripts/app.js'
}
dependency 'es_extended'
\ No newline at end of file
diff --git a/client/main.lua b/client/main.lua
index abf512a7..f5153f44 100644
--- a/client/main.lua
+++ b/client/main.lua
@@ -60,7 +60,7 @@ Citizen.CreateThread(function()
SetBlipColour (blip, 2)
SetBlipAsShortRange(blip, true)
BeginTextCommandSetBlipName("STRING")
- AddTextComponentString("ATM")
+ AddTextComponentString(_U('atm'))
EndTextCommandSetBlipName(blip)
end
end)
@@ -121,7 +121,7 @@ Citizen.CreateThread(function()
ESX.TriggerServerCallback('esx:getPlayerData', function(data)
SendNUIMessage({
showMenu = true,
- player = {
+ player = {
money = data.money,
accounts = data.accounts
}
diff --git a/html/scripts/app.js b/html/scripts/app.js
index 2adc9f82..f05256bb 100644
--- a/html/scripts/app.js
+++ b/html/scripts/app.js
@@ -1,50 +1,43 @@
$(window).ready(function () {
- // NUI Callback
- window.addEventListener('message', function (event) {
- let data = event.data;
- if (data.showControls) {
- $('#container').show();
- $('#menu').hide();
- }
- if (data.showMenu) {
- $('#container').show();
- $('#menu').show();
- $('#deposit_amount').val(data.player.money);
- let bankAmount = 0;
- for (let i = 0; i < data.player.accounts.length; i++)
- if (data.player.accounts[i].name == 'bank')
- bankAmount = data.player.accounts[i].money;
- if (bankAmount >= 10000) {
- $('#withdraw_amount').val(10000);
- } else {
- $('#withdraw_amount').val(bankAmount);
- }
- }
+ // NUI Callback
+ window.addEventListener('message', function (event) {
+ let data = event.data;
- if (data.hideAll) {
- $('#container').hide();
- }
- });
+ if (data.showMenu) {
+ $('#container').fadeIn();
+ $('#menu').fadeIn();
+ $('#deposit_amount').val(data.player.money);
+ let bankAmount = 0;
+ for (let i = 0; i < data.player.accounts.length; i++) {
+ if (data.player.accounts[i].name == 'bank') {
+ bankAmount = data.player.accounts[i].money;
+ }
+ }
+ $('#withdraw_amount').val(bankAmount);
+ } else if (data.hideAll) {
+ $('#container').fadeOut();
+ }
+ });
- document.onkeyup = function (data) {
- if (data.which == 27) {
- $.post('http://esx_atm/escape', '{}');
- }
- };
+ document.onkeyup = function (data) {
+ if (data.which == 27) {
+ $.post('http://esx_atm/escape', '{}');
+ }
+ };
- $('#container').hide();
+ $('#container').hide();
- $('#deposit_btn').on('click', function () {
- $.post('http://esx_atm/deposit', JSON.stringify({
- amount: $('#deposit_amount').val()
- }));
- })
+ $('#deposit_btn').on('click', function () {
+ $.post('http://esx_atm/deposit', JSON.stringify({
+ amount: $('#deposit_amount').val()
+ }));
+ $('#deposit_amount').val(0);
+ })
- $('#withdraw_btn').on('click', function () {
- $.post('http://esx_atm/withdraw',
- JSON.stringify({
- amount: $('#withdraw_amount').val()
- })
- );
- });
+ $('#withdraw_btn').on('click', function () {
+ $.post('http://esx_atm/withdraw', JSON.stringify({
+ amount: $('#withdraw_amount').val()
+ }));
+ $('#withdraw_amount').val(0);
+ });
});
diff --git a/html/ui.html b/html/ui.html
index 15c4cb0c..fca7b0eb 100644
--- a/html/ui.html
+++ b/html/ui.html
@@ -23,12 +23,9 @@
-
-
-