How do you go about adding another club? for example im looking into adding the vagos and other gangs to all run off of the same script
Copy the LMC section of the config.lua and create a 2nd one below it. Copy/paste the .sql file LMC parts and rename to the new club you make. Restart the server.
I checked everything and there was missing a comma. hahaha. now the problem is that the LMC owner’s chest does not show the menu and the other clubs don’t show the (owner’s) blip. What could be happening? follow the code below:
Config.Clubs = {
lmc = { -- Must match Database name
Garage = { -- Vehicle Garage
x = 0.0, y = 0.0, z = 73.35, h = 0.0
},
Perms = {
StorageRankMin = 1,
StorageRankMinPriv = 3
},
Zones = {
ChangingRoom = {
Pos = {x = 981.05, y = -97.98, z = 73.85},
Size = {x = 0.7, y = 0.7, z = 0.5},
Color = {r = 20, g = 250, b = 20},
Marker= 25,
Blip = false,
Name = _U('lockertitle'),
Type = "changingroom",
Hint = _U('changing_room'),
},
Storage1 = {
Pos = {x = 972.25, y = -98.99, z = 73.85},
Size = {x = 0.7, y = 0.7, z = 0.5},
Color = {r = 150, g = 5, b = 5},
Marker= 25,
Blip = false,
Name = _U('storage'),
Type = "storagepub", -- Public storage, available to all members
Hint = _U('storage_info'),
},
Storage2 = {
Pos = {x = 976.58, y = -103.58, z = 73.85},
Size = {x = 0.7, y = 0.7, z = 0.5},
Color = {r = 150, g = 5, b = 5},
Marker= 25,
Blip = false,
Name = _U('storage'),
Type = "storagepriv", -- Private Storage, requires StorageRankMin
Hint = _U('storage_info'),
},
Owner = { -- Owner menu location
Pos = {x = 986.60, y = -92.51, z = 73.85},
Size = {x = 0.7, y = 0.7, z = 0.5},
Color = {r = 113, g = 204, b = 81},
Marker= 25,
Blip = false,
Name = _U('lmcmenu'),
Type = "owner",
Hint = _U('lmcmenu_info'),
},
},
},
ballas = { -- Must match Database name
Garage = { -- Vehicle Garage
x = 0.0, y = 0.0, z = 73.35, h = 0.0
},
Perms = {
StorageRankMin = 1,
StorageRankMinPriv = 3
},
Zones = {
ChangingRoom = {
Pos = {x = 115.27, y = -1968.25, z = 20.40},
Size = {x = 0.7, y = 0.7, z = 0.5},
Color = {r = 20, g = 250, b = 20},
Marker= 25,
Blip = false,
Name = _U('lockertitle'),
Type = "changingroom",
Hint = _U('changing_room'),
},
Storage1 = {
Pos = {x = 105.87, y = -1978.76, z = 20.40},
Size = {x = 0.7, y = 0.7, z = 0.5},
Color = {r = 150, g = 5, b = 5},
Marker= 25,
Blip = false,
Name = _U('storage'),
Type = "storagepub", -- Public storage, available to all members
Hint = _U('storage_info'),
},
Storage2 = {
Pos = {x = 117.13, y = -1963.83, z = 20.40},
Size = {x = 0.7, y = 0.7, z = 0.5},
Color = {r = 150, g = 5, b = 5},
Marker= 25,
Blip = false,
Name = _U('storage'),
Type = "storagepriv", -- Private Storage, requires StorageRankMin
Hint = _U('storage_info'),
},
Owner = { -- Owner menu location
Pos = {x = 118.89, y = -1966.22, z = 20.40},
Size = {x = 0.7, y = 0.7, z = 0.5},
Color = {r = 113, g = 204, b = 81},
Marker= 25,
Blip = false,
Name = _U('ballasmenu'),
Type = "owner",
Hint = _U('ballasmenu_info'),
},
},
},
vagos = { -- Must match Database name
Garage = { -- Vehicle Garage
x = 0.0, y = 0.0, z = 73.35, h = 0.0
},
Perms = {
StorageRankMin = 1,
StorageRankMinPriv = 3
},
Zones = {
ChangingRoom = {
Pos = {x = 358.51, y = -2033.07, z = 22.20},
Size = {x = 0.7, y = 0.7, z = 0.5},
Color = {r = 20, g = 250, b = 20},
Marker= 25,
Blip = false,
Name = _U('lockertitle'),
Type = "changingroom",
Hint = _U('changing_room'),
},
Storage1 = {
Pos = {x = 343.41, y = -2020.79, z = 22.20},
Size = {x = 0.7, y = 0.7, z = 0.5},
Color = {r = 150, g = 5, b = 5},
Marker= 25,
Blip = false,
Name = _U('storage'),
Type = "storagepub", -- Public storage, available to all members
Hint = _U('storage_info'),
},
Storage2 = {
Pos = {x = 343.41, y = -2020.79, z = 22.20},
Size = {x = 0.7, y = 0.7, z = 0.5},
Color = {r = 150, g = 5, b = 5},
Marker= 25,
Blip = false,
Name = _U('storage'),
Type = "storagepriv", -- Private Storage, requires StorageRankMin
Hint = _U('storage_info'),
},
Owner = { -- Owner menu location
Pos = {x = 344.78, y = -2022.25, z = 21.39},
Size = {x = 0.7, y = 0.7, z = 0.5},
Color = {r = 113, g = 204, b = 81},
Marker= 25,
Blip = false,
Name = _U('vagosmenu'),
Type = "owner",
Hint = _U('vagosmenu_info'),
},
},
},
groove = { -- Must match Database name
Garage = { -- Vehicle Garage
x = 0.0, y = 0.0, z = 73.35, h = 0.0
},
Perms = {
StorageRankMin = 1,
StorageRankMinPriv = 3
},
Zones = {
ChangingRoom = {
Pos = {x = -141.52, y = -1608.89, z = 34.10},
Size = {x = 0.7, y = 0.7, z = 0.5},
Color = {r = 20, g = 250, b = 20},
Marker= 25,
Blip = false,
Name = _U('lockertitle'),
Type = "changingroom",
Hint = _U('changing_room'),
},
Storage1 = {
Pos = {x = -137.63, y = -1609.79, z = 34.10},
Size = {x = 0.7, y = 0.7, z = 0.5},
Color = {r = 150, g = 5, b = 5},
Marker= 25,
Blip = false,
Name = _U('storage'),
Type = "storagepub", -- Public storage, available to all members
Hint = _U('storage_info'),
},
Storage2 = {
Pos = {x = -155.48, y = -1604.10, z = 34.10},
Size = {x = 0.7, y = 0.7, z = 0.5},
Color = {r = 150, g = 5, b = 5},
Marker= 25,
Blip = false,
Name = _U('storage'),
Type = "storagepriv", -- Private Storage, requires StorageRankMin
Hint = _U('storage_info'),
},
Owner = { -- Owner menu location
Pos = {x = -157.72, y = -1603.25, z = 34.10},
Size = {x = 0.7, y = 0.7, z = 0.5},
Color = {r = 113, g = 204, b = 81},
Marker= 25,
Blip = false,
Name = _U('groovemenu'),
Type = "owner",
Hint = _U('groovemenu_info'),
},
},
},
}
As long as the job name (not the label) is “owner” and the coordinates are above the ground it should show up. Make sure to /setclub as well.
I like to always keep things up to date. So my saga with this incredible resource is not over yet. I use the updated es_extended and this has caused all the problems I mentioned so far. A lot has already been resolved, but the items have not been removed yet. So I ask for help from my forum colleagues. Follows the conversion of the server.lua file for the weight system I am trying to do. But I still can’t get the items out yet. Just sql error showing up at the prompt. Does anyone know what I’m doing wrong?
RegisterServerEvent('sody_clubs:getStockItem')
AddEventHandler('sody_clubs:getStockItem', function(type, itemName, count, clubname)
local _source = source
local xPlayer = nil
while xPlayer == nil do
xPlayer = ESX.GetPlayerFromId(_source)
Wait(10)
end
local clubfullname = "club_" .. clubname
if type == 'item_standard' then
TriggerEvent('esx_addoninventory:getSharedInventory', clubfullname, function(inventory)
local inventoryItem = inventory.getItem(item)
if count > 0 and inventoryItem.count >= count then
if xPlayer.canCarryItem(item, count) then
inventory.removeItem(item, count)
xPlayer.addInventoryItem(item, count)
xPlayer.showNotification(_U('have_withdrawn', count, inventoryItem.label))
else
xPlayer.showNotification(_U('player_cannot_hold'))
end
else
xPlayer.showNotification(_U('invalid_quantity'))
end
end)
I finally got it. The resource is now working perfectly with the current es_extended. Just replace the file “server.lua” with the one I’m posting here.
sody_clubs_server_lua.rar (3.8 KB)
Does anyone have this working with esx_jb_eden_garage2 ??
I’m getting an error for a Callback saying it doesn’t exist after I removed the resource. Nothing wrong with it, we just decided to not use it. Removed everything from the DB including the slot in the Users. Does this hook somewhere else that I am missing?
If you made changes to esx_doorlock you’ll need to undo those.
If it has a similar database structure as eden_garage it should work.
Ah, thank you!
Hello, is it possible to add AuthorizedWeapons to this. So you could buy weapons from the storage menu or from somewhere
Have you tried to integrate with esx_inventoryhud?
es_extended version
I used a snippet from a shop script that has worked effectivly when needing to restart the script on the fly or while the server is up:
ESX = nil
local hasSqlRun = false
TriggerEvent(‘esx:getSharedObject’, function(obj) ESX = obj end)
AddEventHandler(‘onMySQLReady’, function()
hasSqlRun = true
LoadClubs()
end)
– extremely useful when restarting script mid-game
Citizen.CreateThread(function()
Citizen.Wait(2000) -- hopefully enough for connection to the SQL server
if not hasSqlRun then
LoadClubs()
hasSqlRun = true
end
end)
function LoadClubs()
–AddEventHandler(‘onResourceStart’, function(resourceName) – For debugging to start/stop resources without server restart
Wait(2000) -- For debugging to start/stop resources without server restart
local result = MySQL.Sync.fetchAll('SELECT * FROM sody_clubs', {})
for i=1, #result, 1 do
Clubs[result[i].name] = result[i]
Clubs[result[i].name].ranks = {}
table.insert(ClubList, result[i].name)
ClubListFull[result[i].name] = result[i].label
end
local result2 = MySQL.Sync.fetchAll('SELECT * FROM sody_clubs_ranks', {})
for i=1, #result2, 1 do
Clubs[result2[i].club_name].ranks[tostring(result2[i].club_rank)] = result2[i]
end
TriggerClientEvent('sody_clubs:forceSync', -1)
nextReset = GetGameTimer() + Config.PayInterval
startClubPayCycle()
end
Sorry for the lack of responses all it’s been a crazy time lately as you all know.
I don’t have an “official” update for the es_extended latest release. I’m working on upgrading my own server and it’s taking some time to re-do a lot of my custom edits to ESX itself in the new version. @Aura_RP_BR was kind enough to make these edits and release his server.lua which looks correct to me. Everyone should be able to utilize this for the time being if you can’t wait for my slowness @Mintic
@Beowulf_50 I’m not familiar with this, is this through a certain script? Are we talking about the esx_weaponshop script? It should be possible to set up a quick “club check” before a purchase in any case.
@Seamus_McMasters I actually do want to do this, as I use inventoryhud myself. I will be working on this in the near future and will release an add-on for esx_inventoryhud. I created a duffle bag script which is integrated into it so I have a proper understanding on how to integrate sody_clubs now.
How hard is to add a UI labels ingame so ppl can see their Club and Rank? maybe through es extended?
Which UI? Very easy though, make a quick server call to the database to see which club they’re in. I don’t have a quick command built-in at the moment. Since people need to get the club name/ranks, I am going to build in an export command soon for clubs (like pNotify or Mythic notifications do basically).
The resmon for this resource is 0.6-1.9 MS which is pretty high for ESX server.
I found out the root cause of this. There is a line around 698 in client.lua. “ESX.Table.SizeOf(zones) > 0” which is causing the performance to a lot high.
I got 0.06 MS after removing that lines. Please look into it and we can save a lot of clients CPU usage
Detailed info :