Skip to content

Commit

Permalink
🎨 Run formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpredator committed Feb 1, 2024
1 parent e3a01f9 commit 1974f4a
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 70 deletions.
10 changes: 5 additions & 5 deletions server-data/resources/[maps]/iak_ammunation/fxmanifest.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
fx_version "bodacious"
games {'gta5'}
author 'Iakkoise'
fx_version("bodacious")
games({ "gta5" })
author("Iakkoise")

this_is_a_map 'yes'
version '0.0.4'
this_is_a_map("yes")
version("1.0.0")
8 changes: 4 additions & 4 deletions server-data/resources/[maps]/import/fxmanifest.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fx_version "adamant"
game 'gta5'
this_is_a_map "yes"
version '0.0.4'
fx_version("adamant")
game("gta5")
this_is_a_map("yes")
version("1.0.0")
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fx_version "adamant"
game 'gta5'
this_is_a_map "yes"
version '0.0.4'
fx_version("adamant")
game("gta5")
this_is_a_map("yes")
version("1.0.0")
41 changes: 22 additions & 19 deletions server-data/resources/[wasabi]/wasabi_oxshops/client/client.lua
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@
ESX = exports['es_extended']:getSharedObject()
ESX = exports["es_extended"]:getSharedObject()

RegisterNetEvent('esx:playerLoaded', function(xPlayer)
RegisterNetEvent("esx:playerLoaded", function(xPlayer)
ESX.PlayerData = xPlayer
ESX.PlayerLoaded = true
end)

RegisterNetEvent('esx:onPlayerLogout', function()
RegisterNetEvent("esx:onPlayerLogout", function()
table.wipe(ESX.PlayerData)
ESX.PlayerLoaded = false
end)

RegisterNetEvent('esx:setJob', function(job)
RegisterNetEvent("esx:setJob", function(job)
ESX.PlayerData.job = job
end)


RegisterNetEvent('wasabi_oxshops:setProductPrice')
AddEventHandler('wasabi_oxshops:setProductPrice', function(shop, slot)
local input = lib.inputDialog(Strings.sell_price, {Strings.amount_input})
RegisterNetEvent("wasabi_oxshops:setProductPrice")
AddEventHandler("wasabi_oxshops:setProductPrice", function(shop, slot)
local input = lib.inputDialog(Strings.sell_price, { Strings.amount_input })
local price
if not input then price = 0 end
if not input then
price = 0
end
price = tonumber(input[1])
if price < 0 then price = 0 end
TriggerEvent('ox_inventory:closeInventory')
TriggerServerEvent('wasabi_oxshops:setData', shop, slot, math.floor(price))
if price < 0 then
price = 0
end
TriggerEvent("ox_inventory:closeInventory")
TriggerServerEvent("wasabi_oxshops:setData", shop, slot, math.floor(price))
lib.notify({
title = Strings.success,
description = (Strings.item_stocked_desc):format(price),
type = 'success'
type = "success",
})
end)

local function createBlip(coords, sprite, color, text, scale)
local x,y,z = table.unpack(coords)
local x, y, z = table.unpack(coords)
local blip = AddBlipForCoord(x, y, z)
SetBlipSprite(blip, sprite)
SetBlipDisplay(blip, 4)
Expand All @@ -46,7 +49,7 @@ local function createBlip(coords, sprite, color, text, scale)
end

CreateThread(function()
for _,v in pairs(Config.Shops) do
for _, v in pairs(Config.Shops) do
if v.blip.enabled then
createBlip(v.blip.coords, v.blip.sprite, v.blip.color, v.blip.string, v.blip.scale)
end
Expand All @@ -58,7 +61,7 @@ CreateThread(function()
while true do
local sleep = 1500
local coords = GetEntityCoords(PlayerPedId())
for k,v in pairs(Config.Shops) do
for k, v in pairs(Config.Shops) do
local stashLoc = v.locations.stash.coords
local shopLoc = v.locations.shop.coords
local bossLoc
Expand All @@ -75,7 +78,7 @@ CreateThread(function()
end
sleep = 0
if IsControlJustReleased(0, 38) then
exports.ox_inventory:openInventory('stash', k)
exports.ox_inventory:openInventory("stash", k)
end
elseif distShop <= v.locations.shop.range then
if not textUI then
Expand All @@ -84,7 +87,7 @@ CreateThread(function()
end
sleep = 0
if IsControlJustReleased(0, 38) then
exports.ox_inventory:openInventory('shop', { type = k, id = 1 })
exports.ox_inventory:openInventory("shop", { type = k, id = 1 })
end
sleep = 0
elseif textUI then
Expand All @@ -94,4 +97,4 @@ CreateThread(function()
end
Wait(sleep)
end
end)
end)
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
Config = {}
Config.Shops = {
['ambulance'] = { -- Job name
label = 'Hospital Shop',
["ambulance"] = { -- Job name
label = "Hospital Shop",
blip = {
enabled = true,
coords = vec3(309.415375, -561.784607, 43.282104),
sprite = 61,
color = 8,
scale = 0.7,
string = 'ambulance'
string = "ambulance",
},
locations = {
stash = {
string = '[E] - Access Inventory',
string = "[E] - Access Inventory",
coords = vec3(309.415375, -561.784607, 43.282104),
range = 3.0
range = 3.0,
},
shop = {
string = '[E] - Access Shop',
string = "[E] - Access Shop",
coords = vec3(308.782410, -592.061523, 43.282104),
range = 4.0
}
}
range = 4.0,
},
},
}, -- Copy and paste this shop to create more

}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
Strings = {
sell_price = 'Sell Price',
amount_input = 'Amount',
inventory = 'Inventory',
success = 'Success',
item_stocked_desc = 'You stocked an item for $%s!',

}
sell_price = "Sell Price",
amount_input = "Amount",
inventory = "Inventory",
success = "Success",
item_stocked_desc = "You stocked an item for $%s!",
}
38 changes: 19 additions & 19 deletions server-data/resources/[wasabi]/wasabi_oxshops/fxmanifest.lua
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
fx_version 'cerulean'
game 'gta5'
lua54 'yes'
fx_version("cerulean")
game("gta5")
lua54("yes")

description 'Wasabi OX Inventory Player Owned Shops'
author 'wasabirobby#5110'
version '1.0.0'
description("Wasabi OX Inventory Player Owned Shops")
author("wasabirobby#5110")
version("1.0.0")

shared_scripts {
'@ox_lib/init.lua',
'configuration/*.lua'
}
shared_scripts({
"@ox_lib/init.lua",
"configuration/*.lua",
})

client_scripts {
'client/*.lua'
}
client_scripts({
"client/*.lua",
})

server_scripts {
'server/*.lua'
}
server_scripts({
"server/*.lua",
})

dependencies {
'ox_inventory'
}
dependencies({
"ox_inventory",
})
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ ESX = exports['es_extended']:getSharedObject()
local swapHooks, createHooks = {}, {}

CreateThread(function()
while ESX == nil do Wait() end
for k,_ in pairs(Config.Shops) do
TriggerEvent('esx_society:registerSociety', k, k, 'society_'..k, 'society_'..k, 'society_'..k, {type = 'public'})
end
Expand Down

0 comments on commit 1974f4a

Please sign in to comment.