Skip to content

Commit

Permalink
Merge pull request #718 from bitpredator/dev
Browse files Browse the repository at this point in the history
chore:  🎨 Run formatter
  • Loading branch information
bitpredator authored Jun 11, 2024
2 parents e926a6f + 6c5eb45 commit 49a9d1a
Show file tree
Hide file tree
Showing 20 changed files with 1,331 additions and 1,375 deletions.
34 changes: 17 additions & 17 deletions server-data/resources/[bpt_addons]/bpt_addonaccount/fxmanifest.lua
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
fx_version 'adamant'
game 'gta5'
fx_version("adamant")
game("gta5")

author 'bitpredator'
description 'Allows resources to store account data, such as society funds'
lua54 'yes'
version '1.0.1'
author("bitpredator")
description("Allows resources to store account data, such as society funds")
lua54("yes")
version("1.0.1")

server_scripts {
'@es_extended/imports.lua',
'@oxmysql/lib/MySQL.lua',
'server/classes/addonaccount.lua',
'server/main.lua'
}
server_scripts({
"@es_extended/imports.lua",
"@oxmysql/lib/MySQL.lua",
"server/classes/addonaccount.lua",
"server/main.lua",
})

server_exports {
'GetSharedAccount',
'AddSharedAccount'
}
server_exports({
"GetSharedAccount",
"AddSharedAccount",
})

dependency 'es_extended'
dependency("es_extended")
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
function CreateAddonAccount(name, owner, money)
local self = {}

self.name = name
self.name = name
self.owner = owner
self.money = money

function self.addMoney(m)
self.money = self.money + m
self.save()
TriggerEvent('bpt_addonaccount:addMoney', self.name, m)
TriggerEvent("bpt_addonaccount:addMoney", self.name, m)
end

function self.removeMoney(m)
self.money = self.money - m
self.save()
TriggerEvent('bpt_addonaccount:removeMoney', self.name, m)
TriggerEvent("bpt_addonaccount:removeMoney", self.name, m)
end

function self.setMoney(m)
self.money = m
self.save()
TriggerEvent('bpt_addonaccount:setMoney', self.name, m)
TriggerEvent("bpt_addonaccount:setMoney", self.name, m)
end

function self.save()
if self.owner == nil then
MySQL.update('UPDATE addon_account_data SET money = ? WHERE account_name = ?', { self.money, self.name })
MySQL.update("UPDATE addon_account_data SET money = ? WHERE account_name = ?", { self.money, self.name })
else
MySQL.update('UPDATE addon_account_data SET money = ? WHERE account_name = ? AND owner = ?',
{ self.money, self.name, self.owner })
MySQL.update("UPDATE addon_account_data SET money = ? WHERE account_name = ? AND owner = ?", { self.money, self.name, self.owner })
end
TriggerClientEvent('bpt_addonaccount:setMoney', -1, self.name, self.money)
TriggerClientEvent("bpt_addonaccount:setMoney", -1, self.name, self.money)
end

return self
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
fx_version 'adamant'
fx_version("adamant")

game 'gta5'
game("gta5")

description 'Adds a way for resources to store items for players'
lua54 'yes'
description("Adds a way for resources to store items for players")
lua54("yes")

version '1.0.1'
version("1.0.1")

server_scripts {
'@es_extended/imports.lua',
'@oxmysql/lib/MySQL.lua',
'server/classes/addoninventory.lua',
'server/main.lua'
}
server_scripts({
"@es_extended/imports.lua",
"@oxmysql/lib/MySQL.lua",
"server/classes/addoninventory.lua",
"server/main.lua",
})

server_exports {
'GetSharedInventory',
'AddSharedInventory'
}
server_exports({
"GetSharedInventory",
"AddSharedInventory",
})

dependency 'es_extended'
dependency("es_extended")
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local self, name, owner, items = {}, {}, {}, {}
self.name = name
self.owner = owner
self.items = items
self.name = name
self.owner = owner
self.items = items

function CreateAddonInventory()
function self.addItem(name, count)
Expand Down Expand Up @@ -35,53 +35,45 @@ function CreateAddonInventory()
end

item = {
name = name,
name = name,
count = 0,
label = Items[name]
label = Items[name],
}

table.insert(self.items, item)

if self.owner == nil then
MySQL.update(
'INSERT INTO addon_inventory_items (inventory_name, name, count) VALUES (@inventory_name, @item_name, @count)',
{
['@inventory_name'] = self.name,
['@item_name'] = name,
['@count'] = 0
})
MySQL.update("INSERT INTO addon_inventory_items (inventory_name, name, count) VALUES (@inventory_name, @item_name, @count)", {
["@inventory_name"] = self.name,
["@item_name"] = name,
["@count"] = 0,
})
else
MySQL.update(
'INSERT INTO addon_inventory_items (inventory_name, name, count, owner) VALUES (@inventory_name, @item_name, @count, @owner)',
{
['@inventory_name'] = self.name,
['@item_name'] = name,
['@count'] = 0,
['@owner'] = self.owner
})
MySQL.update("INSERT INTO addon_inventory_items (inventory_name, name, count, owner) VALUES (@inventory_name, @item_name, @count, @owner)", {
["@inventory_name"] = self.name,
["@item_name"] = name,
["@count"] = 0,
["@owner"] = self.owner,
})
end

return item
end

function self.saveItem(name, count)
if self.owner == nil then
MySQL.update(
'UPDATE addon_inventory_items SET count = @count WHERE inventory_name = @inventory_name AND name = @item_name',
{
['@inventory_name'] = self.name,
['@item_name'] = name,
['@count'] = count
})
MySQL.update("UPDATE addon_inventory_items SET count = @count WHERE inventory_name = @inventory_name AND name = @item_name", {
["@inventory_name"] = self.name,
["@item_name"] = name,
["@count"] = count,
})
else
MySQL.update(
'UPDATE addon_inventory_items SET count = @count WHERE inventory_name = @inventory_name AND name = @item_name AND owner = @owner',
{
['@inventory_name'] = self.name,
['@item_name'] = name,
['@count'] = count,
['@owner'] = self.owner
})
MySQL.update("UPDATE addon_inventory_items SET count = @count WHERE inventory_name = @inventory_name AND name = @item_name AND owner = @owner", {
["@inventory_name"] = self.name,
["@item_name"] = name,
["@count"] = count,
["@owner"] = self.owner,
})
end
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Config = {}

Config.Locale = GetConvar('esx:locale', 'en')
Config.Locale = GetConvar("esx:locale", "en")
Config.MinPlayer = 10 --Set how many players need to be connect before whitelist start, 0-32
28 changes: 14 additions & 14 deletions server-data/resources/[bpt_addons]/bpt_allowlist/fxmanifest.lua
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
fx_version 'adamant'
fx_version("adamant")

game 'gta5'
game("gta5")

author 'bitpredator'
description 'Allowlist system that allows you to only allow specific people to access your server'
author("bitpredator")
description("Allowlist system that allows you to only allow specific people to access your server")

version '1.0.1'
version("1.0.1")

lua54 'yes'
server_only 'yes'
lua54("yes")
server_only("yes")

server_scripts {
'@es_extended/imports.lua',
'@es_extended/locale.lua',
'config.lua',
'locales/*.lua',
'server/main.lua'
}
server_scripts({
"@es_extended/imports.lua",
"@es_extended/locale.lua",
"config.lua",
"locales/*.lua",
"server/main.lua",
})
26 changes: 13 additions & 13 deletions server-data/resources/[bpt_addons]/bpt_allowlist/locales/en.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Locales['en'] = {
['allowlist_check'] = 'Checking if you are Allowlisted.',
['not_allowlisted'] = 'You Must be Allowlisted to join this server!',
['allowlist_empty'] = 'There Are no allowlists saved for this server.',
['license_missing'] = 'Error: Your Identifier is missing!',
['help_allowlist_add'] = 'add someone to the allowlist',
['help_allowlist_load'] = 'reload the allowlist',
['help_allowlist_remove'] = 'remove someone from the allowlist',
['error'] = 'There Was An Error, Please Contact the server owner!',
['already_allowlisted'] = 'The player is already allowlisted on this server!',
['license'] = 'license',
['help_license'] = 'the player license',
['identifier_not_allowlisted'] = 'Identifier is not Allowlisted on this server!',
Locales["en"] = {
["allowlist_check"] = "Checking if you are Allowlisted.",
["not_allowlisted"] = "You Must be Allowlisted to join this server!",
["allowlist_empty"] = "There Are no allowlists saved for this server.",
["license_missing"] = "Error: Your Identifier is missing!",
["help_allowlist_add"] = "add someone to the allowlist",
["help_allowlist_load"] = "reload the allowlist",
["help_allowlist_remove"] = "remove someone from the allowlist",
["error"] = "There Was An Error, Please Contact the server owner!",
["already_allowlisted"] = "The player is already allowlisted on this server!",
["license"] = "license",
["help_license"] = "the player license",
["identifier_not_allowlisted"] = "Identifier is not Allowlisted on this server!",
}
26 changes: 13 additions & 13 deletions server-data/resources/[bpt_addons]/bpt_allowlist/locales/it.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Locales['it'] = {
['allowlist_check'] = 'verifica Allowlist.',
['not_allowlisted'] = 'devi essere nella Allowlist per unirti a questo server!',
['allowlist_empty'] = 'non ci sono allowlist salvate per questo server.',
['license_missing'] = 'Errore: il tuo identificatore è mancante!',
['help_allowlist_add'] = 'aggiungi qualcuno alla allowlist',
['help_allowlist_load'] = 'ricarica la allowlist',
['help_allowlist_remove'] = 'rimuovi un utente dalla allowlist',
['error'] = 'É stato riscontrato un errore, contatta il proprietario del server!',
['already_allowlisted'] = 'Il giocatore è già allowlistato nel server',
['license'] = 'licenza',
['help_license'] = 'la licenza del giocatore',
['identifier_not_allowlisted'] = 'L\' identificativo non è allowlistato nel server',
Locales["it"] = {
["allowlist_check"] = "verifica Allowlist.",
["not_allowlisted"] = "devi essere nella Allowlist per unirti a questo server!",
["allowlist_empty"] = "non ci sono allowlist salvate per questo server.",
["license_missing"] = "Errore: il tuo identificatore è mancante!",
["help_allowlist_add"] = "aggiungi qualcuno alla allowlist",
["help_allowlist_load"] = "ricarica la allowlist",
["help_allowlist_remove"] = "rimuovi un utente dalla allowlist",
["error"] = "É stato riscontrato un errore, contatta il proprietario del server!",
["already_allowlisted"] = "Il giocatore è già allowlistato nel server",
["license"] = "licenza",
["help_license"] = "la licenza del giocatore",
["identifier_not_allowlisted"] = "L' identificativo non è allowlistato nel server",
}
Loading

0 comments on commit 49a9d1a

Please sign in to comment.