mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +00:00
Proper manifest info, disable blip by default, Swedish locate and cleanup
This commit is contained in:
@@ -1,15 +1,38 @@
|
||||
# fxserver-esx_atm
|
||||
FXServer ESX ATM
|
||||
# esx_atm
|
||||
|
||||
[INSTALLATION]
|
||||
## Download & Installation
|
||||
|
||||
1) CD in your resources/[esx] folder
|
||||
2) Clone the repository
|
||||
### Using [fvm](https://github.com/qlaffont/fvm-installer)
|
||||
```
|
||||
git clone https://github.com/FXServer-ESX/fxserver-esx_atm esx_atm
|
||||
fvm install --save --folder=esx esx-org/esx_atm
|
||||
```
|
||||
3) Add this in your server.cfg :
|
||||
|
||||
### Using Git
|
||||
```
|
||||
cd resources
|
||||
git clone https://github.com/ESX-Org/esx_atm [esx]/esx_atm
|
||||
```
|
||||
|
||||
### Manually
|
||||
- Download https://github.com/ESX-Org/esx_atm/archive/master.zip
|
||||
- Put it in the `[esx]` directory
|
||||
|
||||
## Installation
|
||||
- Import `esx_atm.sql` in your database
|
||||
- Add this to your `server.cfg`:
|
||||
|
||||
```
|
||||
start esx_atm
|
||||
```
|
||||
|
||||
# Legal
|
||||
### License
|
||||
esx_atm - atm script for ESX
|
||||
|
||||
Copyright (C) 2015-2018 Jérémie N'gadi
|
||||
|
||||
This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version.
|
||||
|
||||
This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details.
|
||||
|
||||
You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/.
|
||||
+13
-6
@@ -1,13 +1,17 @@
|
||||
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
|
||||
|
||||
description 'ESX Atm'
|
||||
|
||||
version '1.0.0'
|
||||
|
||||
server_scripts {
|
||||
|
||||
'@es_extended/locale.lua',
|
||||
'@es_extended/locale.lua',
|
||||
'locales/de.lua',
|
||||
'locales/br.lua',
|
||||
'locales/en.lua',
|
||||
'locales/fr.lua',
|
||||
'locales/es.lua',
|
||||
'locales/sv.lua',
|
||||
'config.lua',
|
||||
'server/esx_atm_sv.lua'
|
||||
}
|
||||
@@ -19,6 +23,7 @@ client_scripts {
|
||||
'locales/en.lua',
|
||||
'locales/fr.lua',
|
||||
'locales/es.lua',
|
||||
'locales/sv.lua',
|
||||
'config.lua',
|
||||
'client/esx_atm_cl.lua'
|
||||
}
|
||||
@@ -26,8 +31,10 @@ client_scripts {
|
||||
ui_page 'html/ui.html'
|
||||
|
||||
files {
|
||||
'html/ui.html',
|
||||
'html/pdown.ttf',
|
||||
'html/css/app.css',
|
||||
'html/scripts/app.js'
|
||||
'html/ui.html',
|
||||
'html/pdown.ttf',
|
||||
'html/css/app.css',
|
||||
'html/scripts/app.js'
|
||||
}
|
||||
|
||||
dependency 'es_extended'
|
||||
+37
-23
@@ -1,8 +1,20 @@
|
||||
local GUI = {}
|
||||
local hasAlreadyEnteredMarker = false
|
||||
local isInATMMarker = false
|
||||
local menuIsShowed = false
|
||||
local Keys = {
|
||||
["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57,
|
||||
["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177,
|
||||
["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18,
|
||||
["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182,
|
||||
["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81,
|
||||
["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70,
|
||||
["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178,
|
||||
["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173,
|
||||
["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118
|
||||
}
|
||||
|
||||
-- internal variables
|
||||
local GUI = {}
|
||||
local hasAlreadyEnteredMarker = false
|
||||
local isInATMMarker = false
|
||||
local menuIsShowed = false
|
||||
ESX = nil
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
@@ -22,7 +34,7 @@ AddEventHandler('esx_atm:closeATM', function()
|
||||
end)
|
||||
|
||||
RegisterNUICallback('escape', function(data, cb)
|
||||
TriggerEvent('esx_atm:closeATM')
|
||||
TriggerEvent('esx_atm:closeATM')
|
||||
cb('ok')
|
||||
end)
|
||||
|
||||
@@ -38,8 +50,10 @@ end)
|
||||
|
||||
-- Create blips
|
||||
Citizen.CreateThread(function()
|
||||
for i=1, #Config.ATMS, 1 do
|
||||
local blip = AddBlipForCoord(Config.ATMS[i].x, Config.ATMS[i].y, Config.ATMS[i].z - Config.ZDiff)
|
||||
if not Config.EnableBlips then return end
|
||||
|
||||
for i=1, #Config.ATMS, 1 do
|
||||
local blip = AddBlipForCoord(Config.ATMS[i].x, Config.ATMS[i].y, Config.ATMS[i].z - Config.ZDiff)
|
||||
SetBlipSprite (blip, Config.BlipSprite)
|
||||
SetBlipDisplay(blip, 4)
|
||||
SetBlipScale (blip, 0.9)
|
||||
@@ -48,14 +62,14 @@ Citizen.CreateThread(function()
|
||||
BeginTextCommandSetBlipName("STRING")
|
||||
AddTextComponentString("ATM")
|
||||
EndTextCommandSetBlipName(blip)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
-- Render markers
|
||||
Citizen.CreateThread(function()
|
||||
while true do
|
||||
Wait(0)
|
||||
local coords = GetEntityCoords(GetPlayerPed(-1))
|
||||
while true do
|
||||
Citizen.Wait(1)
|
||||
local coords = GetEntityCoords(GetPlayerPed(-1))
|
||||
for i=1, #Config.ATMS, 1 do
|
||||
if(GetDistanceBetweenCoords(coords, Config.ATMS[i].x, Config.ATMS[i].y, Config.ATMS[i].z, true) < Config.DrawDistance) then
|
||||
DrawMarker(Config.MarkerType, Config.ATMS[i].x, Config.ATMS[i].y, Config.ATMS[i].z - Config.ZDiff, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.ZoneSize.x, Config.ZoneSize.y, Config.ZoneSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false)
|
||||
@@ -66,8 +80,8 @@ end)
|
||||
|
||||
-- Activate menu when player is inside marker
|
||||
Citizen.CreateThread(function()
|
||||
while true do
|
||||
Wait(0)
|
||||
while true do
|
||||
Citizen.Wait(1)
|
||||
local coords = GetEntityCoords(GetPlayerPed(-1))
|
||||
isInATMMarker = false
|
||||
for i=1, #Config.ATMS, 1 do
|
||||
@@ -83,8 +97,8 @@ Citizen.CreateThread(function()
|
||||
end
|
||||
if not isInATMMarker and hasAlreadyEnteredMarker then
|
||||
hasAlreadyEnteredMarker = false
|
||||
SetNuiFocus(false)
|
||||
menuIsShowed = false
|
||||
SetNuiFocus(false)
|
||||
menuIsShowed = false
|
||||
SendNUIMessage({
|
||||
hideAll = true
|
||||
})
|
||||
@@ -95,8 +109,8 @@ end)
|
||||
-- Menu interactions
|
||||
Citizen.CreateThread(function()
|
||||
while true do
|
||||
Wait(0)
|
||||
if menuIsShowed then
|
||||
Citizen.Wait(1)
|
||||
if menuIsShowed then
|
||||
DisableControlAction(0, 1, true) -- LookLeftRight
|
||||
DisableControlAction(0, 2, true) -- LookUpDown
|
||||
DisableControlAction(0, 142, true) -- MeleeAttackAlternate
|
||||
@@ -106,11 +120,11 @@ Citizen.CreateThread(function()
|
||||
click = true
|
||||
})
|
||||
end
|
||||
else
|
||||
if IsControlJustReleased(0, 38) and isInATMMarker then
|
||||
menuIsShowed = true
|
||||
ESX.TriggerServerCallback('esx:getPlayerData', function(data)
|
||||
SendNUIMessage({
|
||||
else
|
||||
if IsControlJustReleased(0, Keys['E']) and isInATMMarker then
|
||||
menuIsShowed = true
|
||||
ESX.TriggerServerCallback('esx:getPlayerData', function(data)
|
||||
SendNUIMessage({
|
||||
showMenu = true,
|
||||
player = {
|
||||
money = data.money,
|
||||
@@ -121,6 +135,6 @@ Citizen.CreateThread(function()
|
||||
-- Open UI and display Native Cursor
|
||||
SetNuiFocus(true, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
@@ -7,6 +7,7 @@ Config.ZDiff = 2.0
|
||||
Config.BlipSprite = 431
|
||||
Config.Locale = 'fr'
|
||||
|
||||
Config.EnableBlips = false -- for some reason ATM blips are extremly buggy and will bug out the map
|
||||
Config.ATMS = {
|
||||
{ ['x'] = -386.733, ['y'] = 6045.953, ['z'] = 31.501},
|
||||
{ ['x'] = -110.753, ['y'] = 6467.703, ['z'] = 31.784},
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
Locales['br'] = {
|
||||
['invalid_amount'] = '~r~Quantidade inválida',
|
||||
['deposit_money'] = 'Você depósitou ~g~$',
|
||||
['withdraw_money'] = 'Você retirou ~g~$',
|
||||
['press_e_atm'] = 'Pressione ~INPUT_PICKUP~ para depósitos ou retiradas do ~g~ATM~s~.',
|
||||
['invalid_amount'] = '~r~Quantidade inválida',
|
||||
['deposit_money'] = 'Você depósitou ~g~$%s~s~',
|
||||
['withdraw_money'] = 'Você retirou ~g~$%s~s~',
|
||||
['press_e_atm'] = 'pressione ~INPUT_PICKUP~ para depósitos ou retiradas do ~g~ATM~s~.',
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
Locales['de'] = {
|
||||
['invalid_amount'] = '~r~ungültiger Betrag',
|
||||
['deposit_money'] = 'eingezahlt ~g~$',
|
||||
['withdraw_money'] = 'abgehoben ~g~$',
|
||||
['press_e_atm'] = 'Drücke ~INPUT_PICKUP~ um auf den ~g~ATM~s~ zuzugreifen.',
|
||||
['invalid_amount'] = '~r~Ungültiger Betrag',
|
||||
['deposit_money'] = 'eingezahlt ~g~$%s~s~',
|
||||
['withdraw_money'] = 'abgehoben ~g~$%s~s~',
|
||||
['press_e_atm'] = 'Drücke ~INPUT_PICKUP~ um auf den ~g~ATM~s~ zuzugreifen.',
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
Locales['en'] = {
|
||||
['invalid_amount'] = '~r~invalid amount',
|
||||
['deposit_money'] = 'you have deposited ~g~$',
|
||||
['withdraw_money'] = 'you have withdrawn ~g~$',
|
||||
['press_e_atm'] = 'press ~INPUT_PICKUP~ for deposit or withdrawal from ~g~ATM~s~.',
|
||||
['invalid_amount'] = '~r~That\'s an invalid amount of money~s~',
|
||||
['deposit_money'] = 'you have deposited ~g~$%s~s~',
|
||||
['withdraw_money'] = 'you have withdrawn ~g~$%s~s~',
|
||||
['press_e_atm'] = 'press ~INPUT_PICKUP~ for deposit or withdrawal from ~g~ATM~s~',
|
||||
}
|
||||
|
||||
+4
-6
@@ -1,8 +1,6 @@
|
||||
Locales['es'] = {
|
||||
['invalid_amount'] = '~r~cantidad no válida',
|
||||
['deposit_money'] = 'has depositado ~g~€',
|
||||
['withdraw_money'] = 'has retirado ~g~€',
|
||||
['press_e_atm'] = 'Presiona ~INPUT_PICKUP~ para depositar o retirar ~g~cash~s~.',
|
||||
['transf_money_ok'] = 'Transferencia correctamente ~g~€',
|
||||
['transf_money_error'] = '~r~ Error en la transferencia'
|
||||
['invalid_amount'] = '~r~Cantidad no válida',
|
||||
['deposit_money'] = 'has depositado ~g~€%s~s~',
|
||||
['withdraw_money'] = 'has retirado ~g~€%s~s~',
|
||||
['press_e_atm'] = 'presiona ~INPUT_PICKUP~ para depositar o retirar ~g~cash~s~.',
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
Locales['fr'] = {
|
||||
['invalid_amount'] = '~r~montant invalide',
|
||||
['deposit_money'] = 'vous avez déposé ~g~$',
|
||||
['withdraw_money'] = 'vous avez retiré ~g~$',
|
||||
['press_e_atm'] = 'appuyez sur ~INPUT_PICKUP~ pour déposer ou retirer du ~g~cash~s~.',
|
||||
['invalid_amount'] = '~r~Montant invalide~s~',
|
||||
['deposit_money'] = 'vous avez déposé ~g~$%s~s~',
|
||||
['withdraw_money'] = 'vous avez retiré ~g~$%s~s~',
|
||||
['press_e_atm'] = 'appuyez sur ~INPUT_PICKUP~ pour déposer ou retirer du ~g~cash~s~.',
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
Locales['sv'] = {
|
||||
['invalid_amount'] = '~r~Det är en ogiltig summa pengar~s~',
|
||||
['deposit_money'] = 'du satte in ~g~$%s~s~',
|
||||
['withdraw_money'] = 'du har tagit ut ~g~$%s~s~',
|
||||
['press_e_atm'] = 'tryck ~INPUT_PICKUP~ för att komma åt denna ~g~ATM~s~',
|
||||
}
|
||||
@@ -11,7 +11,7 @@ AddEventHandler('esx_atm:deposit', function(amount)
|
||||
else
|
||||
xPlayer.removeMoney(amount)
|
||||
xPlayer.addAccountMoney('bank', amount)
|
||||
TriggerClientEvent('esx:showNotification', _source, _U('deposit_money') .. amount .. '~s~.')
|
||||
TriggerClientEvent('esx:showNotification', _source, _U('deposit_money', amount))
|
||||
TriggerClientEvent('esx_atm:closeATM', _source)
|
||||
end
|
||||
end)
|
||||
@@ -29,7 +29,7 @@ AddEventHandler('esx_atm:withdraw', function(amount)
|
||||
else
|
||||
xPlayer.removeAccountMoney('bank', amount)
|
||||
xPlayer.addMoney(amount)
|
||||
TriggerClientEvent('esx:showNotification', _source, _U('withdraw_money') .. amount .. '~s~.')
|
||||
TriggerClientEvent('esx:showNotification', _source, _U('withdraw_money', amount))
|
||||
TriggerClientEvent('esx_atm:closeATM', _source)
|
||||
end
|
||||
end)
|
||||
Reference in New Issue
Block a user