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

sody_clubs

Player Clubs resource for FiveM > ESX

SodyFX presents: sody_clubs

A resource for FiveM and ESX. This resources adds an additional layer of society living, clubs! Clubs have a similar structure as ESX jobs. There is an owner who has access to the same basic Boss menu from society and can perform similar actions of the Boss menu. Clubs have multiple features as well and allow players to have day-jobs to go along with their club perks.

Requirements

  • ESX (the big one)
  • skinchanger (club changing room)
  • esx_skin (club changing room)
  • esx_property (club changing room)
  • esx_addonaccount (club bank)
  • esx_datastore (club storage)
  • esx_addoninventory (club storage)
  • eden_garage / esx_drp_garage (vehicle garage) OR esx_advancedgarage
  • pNotify

Clubs Features

  • Clubhouse storage (dirty money, items and weapons)
  • Clubhouse changing room (accesses esx_property saved outfits)
  • Private storage for definable ranks and above
  • Clubhouse garage for vehicle spawning
  • Automatic club payouts to members either out of club bank balance or generic payouts (similar to ESX Paychecks)

Club Owner Functions

  • Add money to a “club bank” balance
  • Add/promote/remove members
  • Adjust member pay rates

Club Treasurer Functions

  • Adding a rank named treasurer allows the person to deposit/withdraw club money as well as show current balance

How to add people to club
Use /setclub PlayerId ClubName ClubRank command as jobmaster/admin/superadmin or as club owner, recruit members via the Owner menu

Installation

  • Import sody_clubs.sql into your database to add club and club ranks tables (includes LMC club example)
  • Add additional clubs, club ranks, addon_account, addon_inventory and datastore (latter 3 need club_clubname, club_clubname_pub and club_clubname_priv names, see example) to database as needed. Adjust config.lua and add club position data as needed
  • If using an IPL/instance, you can utilize the Teleporter and GarageTeleporter options in the config.lua for teleport circles
  • Alter config.lua as needed for global options
  • Add this in your server.cfg :
start sody_clubs

The Thanks Yous

  • All developers of esx/fivem scripts for their knowledge and time!
  • Special thanks to the developers of ESX, skinchanger, esx_skin, esx_society, esx_property, esx_addonaccount, esx_addoninventory, esx_datastore, esx_doorlocks, esx_drp_garage and eden_garage for allowing me to dip into your goodness and make something out of it
  • Members of the Slick Top Gaming RP Community for their testing and tips

Misc
This is my first release and I have more to come. They are currently pretty specialized for my current server so I’m slowly making them more publicly viable for those with pure or near vanilla ESX servers.

GitHub: https://github.com/SodyFX/sody_clubs

----- Working with esx_doorlocks -----
In order to use sody_clubs with esx_doorlocks, esx_doorlocks needs to be adjusted to receive club data. To do this, edit the following files or if you’re using an unmodified esx_doorlocks, you can grab my fork here: GitHub - SodyFX/esx_doorlock: ESX door lock!

esx_doorlocks/server/main.lua:
Comment out Lines 25-28:

--if not IsAuthorized(xPlayer.job.name, Config.DoorList[doorID]) then
--	print(('esx_doorlock: %s was not authorized to open a locked door!'):format(xPlayer.identifier))
--	return
--end

This is done to avoid having to send club data to the server for every player. You can leave it in if you wish, but when club members try to open a door, it’ll show in your server console, up to you.

esx_doorlocks/client/main.lua:
Insert Line 2 - Add (after ESX = nil):

local PlayerClub, PlayerRankNum = nil, 0

Insert after line 21 (after esx_doorlock:getDoorInfo callback):

ESX.TriggerServerCallback('sody_clubs:getPlayerClub', function(playerdata)
	PlayerClub = playerdata.club
	PlayerRankNum = playerdata.club_rank
end)

Insert after Line 29 (after esx:setJob event)

RegisterNetEvent('sody_clubs:clubAdded')
AddEventHandler('sody_clubs:clubAdded', function(club)
	ESX.TriggerServerCallback('sody_clubs:getPlayerClub', function(playerdata)
		PlayerClub = playerdata.club
		PlayerRankNum = playerdata.club_rank
	end)
end)

RegisterNetEvent('sody_clubs:clubRemoved')
AddEventHandler('sody_clubs:clubRemoved', function()
	PlayerClub, PlayerRankNum = nil, 0
end)

Insert after Line 151 (inside IsAuthorized function, below job check but above return false

if doorID.authorizedClubs ~= nil then
	if PlayerClub ~= nil and PlayerRankNum ~= nil then
		for _,club in pairs(doorID.authorizedClubs) do
			if club == PlayerClub and doorID.authorizedClubRank[1] <= PlayerRankNum then
				return true
			end
		end
	end
end

esx_doorlocks/config.lua:
Add a new door like any other for esx_doorlocks except add authorizedClubs and authorizedClubRank as well. authorizedClubs is the club name from sody_clubs config and authorizedClubRank is the minimum rank in the club required to use the door. Here’s the LMC club example:

{
	objName = 'v_ilev_lostdoor',
	objCoords  = vector3(981.61, -102.57, 74.85),
	textCoords = vector3(981.72, -102.82, 75.85),
	authorizedJobs = {  },
	authorizedClubs = { 'lmc' },
	authorizedClubRank = { 0 },
	locked = true,
	distance = 12,
	size = 2
},

UPDATE FOR ESX 1.2

Fabio_Trindade was kind enough to update this script for ESX 1.2.

ENJOY!

21 Likes

Nice release.
For gang, possibility to bind, racketeer, force player to go in vehicle ?

cant open bank balance way ?

@a7mdobob
Club Treasurer Functions

  • Adding a rank named treasurer allows the person to deposit/withdraw club money as well as show current balance
1 Like

Nice idea man ty !

i add owner eposit/withdraw its ok but bank balance dnot work

Very nice release, but have you thinked about adding door locks (for MLO-s) as club members. Just like jobs :smiley: But thx dude

I adjusted the SQL script but if you’ve already added it in, in addon_account and addon_account_data adjust club_lmc to be club_lmc_bank. My apologies.

I do have this ability for another script actually, I could integrate it if enough people are interested.

5 Likes

it would be nice, if you integrate it :smiley:

@SodyFX Does this allow me to create 2 motorcycle clubs for instance Mayans MC, and Sons of Anarchy without for example the Mayans seeing the blips/markers for the Sons and vice versa? I’ve been using the Job System currently for the MC’s, but this doesn’t allow them to have a regular job.

1 Like

Yes they would be completely separated. I created this to solve that exact issue and I have multiple clubs working. You just need to duplicate the LMC example and put in all of the new coordinates that are needed, and create new addon accounts, etc in the database like in the example SQL import that comes with the script.

but still dont work

Are you seeing any errors in the F8 console or server log?

yes but if press pay manage

ment

Im intrestes for this dude :wink:

missing an example from the database of “sody_clubs” and “sody_clubs_ranks” please send a greeting example

1 Like

Thank you for catching that. I’ve updated the SQL file but here is the example. Anyone else having issues thus far thank you for sticking with me and make sure to import this into your database.

INSERT INTO `sody_clubs` (`name`, `label`) VALUES ('lmc', 'Lost Motorcycle Club');f

INSERT INTO `sody_clubs_ranks` (`id`, `club_name`, `club_rank`, `club_rank_name`, `club_rank_label`, `pay`) VALUES
(NULL, 'lmc', 0, 'biker', 'Biker', 1500),
(NULL, 'lmc', 1, 'saa', 'Sergeant at Arms', 2000),
(NULL, 'lmc', 2, 'vicepresident', 'Vice President', 2500),
(NULL, 'lmc', 3, 'treasurer', 'Treasurer', 2500),
(NULL, 'lmc', 4, 'owner', 'President', 1000);

Your club_ranks may not be set up correctly as it isn’t pulling the rank names/pay amounts. Make sure your sody_clubs_ranks looks similar the the example:

INSERT INTO `sody_clubs_ranks` (`id`, `club_name`, `club_rank`, `club_rank_name`, `club_rank_label`, `pay`) VALUES
(NULL, 'lmc', 0, 'biker', 'Biker', 1500),
(NULL, 'lmc', 1, 'saa', 'Sergeant at Arms', 2000),
(NULL, 'lmc', 2, 'vicepresident', 'Vice President', 2500),
(NULL, 'lmc', 3, 'treasurer', 'Treasurer', 2500),
(NULL, 'lmc', 4, 'owner', 'President', 1000);