[RELEASE] sody_clubs - ESX Clubs/Gangs Society Add-on [DEPRECATED] [DISCONTINUED]

oopsies, thanks a lot for the quick reply! haha

I get this error with door lock script

Iā€™d have to see the doorlock config.lua, something isnā€™t correct with it.

ik theres a quite a few cities that uses esx_advnacedgarage if it is ever possible you do take consideration of adding suppot for it would be awesome :slight_smile:

Nice script! i just have some problems with the sql file getting sql error 1064
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'TABLE sody_clubs (
name varchar(50) NOT NULL,
label varchar(50) NOT ā€™ at line 1 */

USE `essentialmode`;

CREATE TABLE `sody_clubs` (
  `name` varchar(50) NOT NULL,
  `label` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE `sody_clubs_ranks` (
  `id` tinyint(5) NOT NULL,
  `club_name` varchar(50) NOT NULL,
  `club_rank` tinyint(5) NOT NULL,
  `club_rank_name` varchar(30) NOT NULL,
  `club_rank_label` varchar(50) NOT NULL,
  `pay` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

ALTER TABLE `users` ADD `club` VARCHAR(30) NULL, ADD `club_rank` TINYINT(5) NULL;

INSERT INTO `sody_clubs` (`name`, `label`) VALUES ('hsmc', 'Hells Santos');

INSERT INTO `sody_clubs_ranks` (`id`, `club_name`, `club_rank`, `club_rank_name`, `club_rank_label`, `pay`) VALUES
(NULL, 'hsmc', 0, 'biker', 'prospect', 0),
(NULL, 'hsmc', 1, 'saa', 'medlem', 0),
(NULL, 'hsmc', 2, 'vicepresident', 'sergeant', 0),
(NULL, 'hsmc', 3, 'treasurer', 'Vice Pres', 0),
(NULL, 'hsmc', 4, 'owner', 'President', 0);

-- hsmc EXAMPLE --
INSERT INTO `addon_account` (`name`, `label`, `shared`) VALUES
('club_hsmc_bank', 'hsmc', 1),
('club_hsmc_black', 'hsmc Black', 1),
('club_hsmc_priv', 'hsmc Priv', 1),
('club_hsmc_pub', 'hsmc Pub', 1);

INSERT INTO `addon_account_data` (`id`, `account_name`, `money`, `owner`) VALUES
(NULL, 'club_hsmc_pub', 0, NULL),
(NULL, 'club_hsmc_priv', 0, NULL),
(NULL, 'club_hsmc_black', 0, NULL),
(NULL, 'club_hsmc_bank', 0, NULL);

INSERT INTO `addon_inventory` (`name`, `label`, `shared`) VALUES
('club_hsmc_pub', 'hsmc Public', 1),
('club_hsmc_priv', 'hsmc Private', 1),
('club_hsmc', 'hsmc', 1);

INSERT INTO `datastore` (`name`, `label`, `shared`) VALUES
('club_hsmc', 'hsmc', 1),
('club_hsmc_priv', 'hsmc Priv', 1),
('club_hsmc_pub', 'hsmc Pub', 1);

Is your database name actually ā€˜essentialmodeā€™?

Iā€™d try to insert 1 section at a time to find out which one is actually the problem.

1 Like

Added support for esx_advancedgarage. Make sure to change ā€œConfig.GarageScriptā€ in the config.lua.

Updated a couple missing translation lines in the en locales as well.

ya i realized that it was the very first line :stuck_out_tongue: thanks anyway! Another question is it possible to make support for james-garage?

nice thanks sody for implementing that for use advanced garage users my guyā€¦ i do see that when i go into the vehicle stored list to choose what i want the list disappears after 5 seconds or so
so you gotta be fast to choose your cars or bikeā€¦ any reason why?

It sy

SCRIPT ERROR: @sody_clubs/server.lua:363: attempt to compare nil with number

handler (@esx_addoninventory/server/main.lua:87)
handler (@sody_clubs/server.lua:357)

When I try to get the item from the box, I am giving this error.

I already found the error, this being used ā€œlimitā€ has to be changed to ā€œweightā€ new att do es_extended

Any way to add like police menu?
To drag, cuff, search etc

anyone have a tip on how id go about doing a ā€œclub checkā€ instead of a job check? for example the club version of this Citizen.CreateThread(function()
while true do

	Wait(0)
	
	if ESX.PlayerData.job and ESX.PlayerData.job.name == 'police' or ESX.PlayerData.job.name == 'ambulance' then?

@SodyFX Iā€™m getting this error in my server console:

SCRIPT ERROR: @sody_clubs/server.lua:94: attempt to index a nil value (field '?')e[0m
e[93m> refe[0m (e[36m@sody_clubs/server.luae[0m:94)

While line 94 is:

	MySQL.Async.fetchAll('SELECT club, club_rank FROM users WHERE identifier=@identifier', {['@identifier'] = xPlayer.identifier}, function(result)
		if result[1].club then
			local playerrank = tostring(result[1].club_rank)
			local returntable = {
				club = result[1].club,
				club_rank = result[1].club_rank,
				club_rank_name = Clubs[result[1].club].ranks[playerrank].club_rank_name
			}
			cb(returntable)
		end
	end)
end)

Iā€™m not having the ā€œclub_rank_nameā€ in my users table; am I supposed to?

Easiest way currently is to use a Callback:

ESX.TriggerServerCallback(ā€˜sody_clubs:getPlayerClubā€™, function(playerdata)
PlayerClub = playerdata.club
PlayerRank = playerdata.club_rank_name
PlayerRankNum = playerdata.club_rank
end)

I hadnā€™t planned on such a feature so it doesnā€™t interfere with other jobs.

No, but it does need to be in your config.lua and the club name needs to match what is in your database.

Easiest fix (I believe, I havenā€™t had a chance to test yet) is to replace these lines:

sourceItem.limit ~= -1 and (sourceItem.count + count) > sourceItem.limit

With:

not xPlayer.canCarryItem(itemName, amount)

When I get a chance to test it fully Iā€™ll update the script, but just a warning, this is only for those who have updated to the most recent ESX with the weight update.

Is this still happening? Iā€™m not too sure offhand Iā€™d have to do more tests, this didnā€™t happen to me when I was coding for advanced garage.