Fivem Gang System (script)

Hello @yeganehha
I have problem with blips.lua, myGangID always returning as Nil, do you have any idea?

1 Like

are you create an gang and you are member of that ?
@NessieTV

1 Like

in which time of running server you get 7 ms time ?
@nukestar

That’s right, i’ve created and added myself as boss but in blips.lua, myGangID returns as nil and i can’t use “gang” command as boss.

1 Like

when you use “/gang”, what will happen?
can you send anydesk to me, that i check on your system ?

Dawsham Erfan GanG :nerd_face:

1 Like

can someone help me please i have done everything but can not use the / gangs command please help

the server told me gang resource not found

Hello thank you for your script
I encounter a problem when entering the vehicle in the gang pit, the option remains grayed out. The vehicle is indeed mine. Maybe this is because I am using esx_advancedvehicleshop and not esx_vehicleshop. Thanks for your help

1 Like

what is your core of server ( is ESX ) ?
are you sure, name of the folder rename from gang-0.0.0.1 to gang ?

go to fxserver console and enter

start gang

then send me the screen shot of console log

1 Like

please send owned_vehicles table in your Data Base.

if you want to update and redeveloped this part of the script, you edit function isOwnedvehicle and deleteOwnedvehicle in esxBaseFunction.lua

yeah thx i forgot to rename it XD

Here is my owned_vehicles table. I took a look at the lines shown yesterday but it seems to work for meowned_vehicles.sql (10.8 KB)

i think you forget change owner of vehicle!

  1. you should buy vehicle or get out your vehicle from garage
  2. you should change owner of that vehicle by change plate ( for this one, you should go to the gang impound and change owner)
  3. then this vehicle can use by all member of gang

This is what I did but the option to transfer ownership of the vehicle to the gang remains grayed out so I cannot click on it

do you have any error in client or server side ?
if you want i can remote on your pc and check that.

I have no errors, yes I am okay if you don’t mind please

i have an issue with gang vehicles. once added to the gang garage if you apply any upgrades they are not sticking ie vehicle returns to the state you added it to the gang garage. needs adding to update these in the database upon storing in the gang garage. also a way for gang boss to remove vehicles server side would be a great addition and save devs the time of removing them manually from the database if it is possible. great work on this script

2 Likes

You gave a very positive and constructive opinion. I will definitely implement the upgrade in the next updates and I will include the removal of the cars in the next update.

Thanks for your constructive comments

1 Like

i have fixed the issue of upgrades not sticking upon storing vehicle.
client vehicle.lua :

RageUI.Button( _U(‘store_in_garage’), ‘’ , {}, disabled, {

                onSelected = function()

                    if IsPedSittingInAnyVehicle(playerPed) then

                        SetVehicleProperties(vehicle, props)

                        local vehicle = GetVehiclePedIsIn(playerPed, false)

                        vehicleProperties = GetVehicleProperties(vehicle)

                        whileGoGarageMenu = false

                        for k,v in pairs (Vehicles) do

                            if v.plate == vehicleProperties.plate then

                                Vehicles[k].stored = true

                                break

                            end

                        end

                        DeleteEntity(vehicle)

                        TriggerServerEvent('Erfan:gang:setVehicleStatusIn', vehicleProperties, vehicleProperties.plate, true)

                        

                        canStoredInGarage = false

                    end

                end,

            });

            RageUI.Separator(_U('list_of_garage' ))

            for _key, Vehicle in pairs(Vehicles) do

                local vehicleProperties = json.decode(Vehicle.vehicle)

                local vehicleLabel = GetDisplayNameFromVehicleModel(vehicleProperties.model)

                vehicleLabel = GetLabelText(vehicleLabel)

                RageUI.Button( vehicleLabel , ''  , {}, Vehicle.stored , {

                    onSelected = function()

                        local coords = GetEntityCoords(PlayerPedId())

                        if IsAnyVehicleNearPoint(coords, 3) then

                            TriggerEvent('Erfan:gang:sendNotfication','[Gang System]', ''  , _U('not_empty_to_spawn') , 'CHAR_SOCIAL_CLUB' , 2 )

                        else

                            RageUI.Visible(gangGarageMenu, false)

                            whileGoGarageMenu = false

                            TriggerEvent('Erfan:gang:spawnVehicle', vehicleProperties)

                            TriggerServerEvent('Erfan:gang:setVehicleStatusOut', vehicleProperties.plate, false)

                        end

                    end,

                });

            end

server vehicle.lua :

RegisterServerEvent(‘Erfan:gang:setVehicleStatusOut’)

AddEventHandler(‘Erfan:gang:setVehicleStatusOut’, function( plate , status )

executeOnDB('UPDATE `gangs_vehicle` SET  `stored` = @status WHERE `plate` = @plate', {['@plate']     = plate , ['@status']   = status } , function(e)end)

end)

RegisterServerEvent(‘Erfan:gang:setVehicleStatusIn’)

AddEventHandler(‘Erfan:gang:setVehicleStatusIn’, function(vehicleProperties , plate , status )

executeOnDB('UPDATE `gangs_vehicle` SET `vehicle` = @vehicle, `stored` = @status WHERE `plate` = @plate', {['@vehicle'] = json.encode(vehicleProperties) ,['@plate']     = plate , ['@status']   = status } , function(e)end)

end)

2 Likes

vehicle.lua (19.1 KB) client side
vehicle.lua (7.8 KB) server side

1 Like