mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 18:28:52 +00:00
Rename resource to esx_weaponshop, closes #39
This commit is contained in:
@@ -1,33 +1,33 @@
|
||||
# esx_weashops
|
||||
# esx_weaponshop
|
||||
|
||||
## Download & Installation
|
||||
|
||||
### Using [fvm](https://github.com/qlaffont/fvm-installer)
|
||||
```
|
||||
fvm install --save --folder=esx esx-org/esx_weashops
|
||||
fvm install --save --folder=esx esx-org/esx_weaponshop
|
||||
```
|
||||
|
||||
### Using Git
|
||||
```
|
||||
cd resources
|
||||
git clone https://github.com/ESX-Org/esx_weashops.git [esx]/esx_weashops
|
||||
git clone https://github.com/ESX-Org/esx_weaponshop.git [esx]/esx_weaponshop
|
||||
```
|
||||
|
||||
### Manually
|
||||
- Download https://github.com/ESX-Org/esx_weashops/archive/master.zip
|
||||
- Download https://github.com/ESX-Org/esx_weaponshop/archive/master.zip
|
||||
- Put it in the `[esx]` directory
|
||||
|
||||
## Installation
|
||||
- Import `esx_weashops.sql` in your database
|
||||
- Import `esx_weaponshop.sql` in your database
|
||||
- Add this to your `server.cfg`:
|
||||
|
||||
```
|
||||
start esx_weashops
|
||||
start esx_weaponshop
|
||||
```
|
||||
|
||||
# Legal
|
||||
### License
|
||||
esx_weashops - Legal and illegal weapon shops
|
||||
esx_weaponshop - Legal and illegal weapon shops
|
||||
|
||||
Copyright (C) 2015-2018 Jérémie N'gadi
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
|
||||
|
||||
description 'ESX Weapon Shop'
|
||||
|
||||
version '1.0.2'
|
||||
version '1.1.0'
|
||||
|
||||
server_scripts {
|
||||
'@mysql-async/lib/MySQL.lua',
|
||||
|
||||
+9
-9
@@ -23,15 +23,15 @@ Citizen.CreateThread(function()
|
||||
Citizen.Wait(0)
|
||||
end
|
||||
|
||||
ESX.TriggerServerCallback('esx_weashop:getShop', function(shopItems)
|
||||
ESX.TriggerServerCallback('esx_weaponshop:getShop', function(shopItems)
|
||||
for k,v in pairs(shopItems) do
|
||||
Config.Zones[k].Items = v
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx_weashop:sendShop')
|
||||
AddEventHandler('esx_weashop:sendShop', function(shopItems)
|
||||
RegisterNetEvent('esx_weaponshop:sendShop')
|
||||
AddEventHandler('esx_weaponshop:sendShop', function(shopItems)
|
||||
for k,v in pairs(shopItems) do
|
||||
Config.Zones[k].Items = v
|
||||
end
|
||||
@@ -49,7 +49,7 @@ function OpenBuyLicenseMenu(zone)
|
||||
}
|
||||
}, function(data, menu)
|
||||
if data.current.value == 'yes' then
|
||||
ESX.TriggerServerCallback('esx_weashop:buyLicense', function(bought)
|
||||
ESX.TriggerServerCallback('esx_weaponshop:buyLicense', function(bought)
|
||||
if bought then
|
||||
menu.close()
|
||||
OpenShopMenu(zone)
|
||||
@@ -80,7 +80,7 @@ function OpenShopMenu(zone)
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
TriggerServerEvent('esx_weashop:buyItem', data.current.weaponName, zone)
|
||||
TriggerServerEvent('esx_weaponshop:buyItem', data.current.weaponName, zone)
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
|
||||
@@ -90,13 +90,13 @@ function OpenShopMenu(zone)
|
||||
end)
|
||||
end
|
||||
|
||||
AddEventHandler('esx_weashop:hasEnteredMarker', function(zone)
|
||||
AddEventHandler('esx_weaponshop:hasEnteredMarker', function(zone)
|
||||
CurrentAction = 'shop_menu'
|
||||
CurrentActionMsg = _U('shop_menu')
|
||||
CurrentActionData = { zone = zone }
|
||||
end)
|
||||
|
||||
AddEventHandler('esx_weashop:hasExitedMarker', function(zone)
|
||||
AddEventHandler('esx_weaponshop:hasExitedMarker', function(zone)
|
||||
CurrentAction = nil
|
||||
ESX.UI.Menu.CloseAll()
|
||||
end)
|
||||
@@ -160,12 +160,12 @@ Citizen.CreateThread(function()
|
||||
end
|
||||
if isInMarker and not HasAlreadyEnteredMarker then
|
||||
HasAlreadyEnteredMarker = true
|
||||
TriggerEvent('esx_weashop:hasEnteredMarker', currentZone)
|
||||
TriggerEvent('esx_weaponshop:hasEnteredMarker', currentZone)
|
||||
end
|
||||
|
||||
if not isInMarker and HasAlreadyEnteredMarker then
|
||||
HasAlreadyEnteredMarker = false
|
||||
TriggerEvent('esx_weashop:hasExitedMarker', LastZone)
|
||||
TriggerEvent('esx_weaponshop:hasExitedMarker', LastZone)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
+5
-5
@@ -18,16 +18,16 @@ MySQL.ready(function()
|
||||
})
|
||||
end
|
||||
|
||||
TriggerClientEvent('esx_weashop:sendShop', -1, shopItems)
|
||||
TriggerClientEvent('esx_weaponshop:sendShop', -1, shopItems)
|
||||
end)
|
||||
|
||||
end)
|
||||
|
||||
ESX.RegisterServerCallback('esx_weashop:getShop', function(source, cb)
|
||||
ESX.RegisterServerCallback('esx_weaponshop:getShop', function(source, cb)
|
||||
cb(shopItems)
|
||||
end)
|
||||
|
||||
ESX.RegisterServerCallback('esx_weashop:buyLicense', function(source, cb)
|
||||
ESX.RegisterServerCallback('esx_weaponshop:buyLicense', function(source, cb)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
|
||||
if xPlayer.getMoney() >= Config.LicensePrice then
|
||||
@@ -42,8 +42,8 @@ ESX.RegisterServerCallback('esx_weashop:buyLicense', function(source, cb)
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterServerEvent('esx_weashop:buyItem')
|
||||
AddEventHandler('esx_weashop:buyItem', function(weaponName, zone)
|
||||
RegisterServerEvent('esx_weaponshop:buyItem')
|
||||
AddEventHandler('esx_weaponshop:buyItem', function(weaponName, zone)
|
||||
local _source = source
|
||||
local xPlayer = ESX.GetPlayerFromId(_source)
|
||||
local price = GetPrice(weaponName, zone)
|
||||
|
||||
Reference in New Issue
Block a user