Coder Social home page Coder Social logo

iplocator / esx-illegal-warehouses Goto Github PK

View Code? Open in Web Editor NEW

This project forked from benoursonj/esx-illegal-warehouses

0.0 1.0 0.0 106 KB

Fivem script for es_extended. Enables the creation of warehouses that can be assigned to gangs/illegal organisations.

License: GNU General Public License v3.0

Lua 100.00%

esx-illegal-warehouses's Introduction

ESX Illegal Warehouses [esx_illegalWarehouses]

Illegal warehouses that can be rented to gangs, illegal organizations or even certain jobs and that can be lockpicked by police forces as long as they have lockpicks.

ESX Illegal Warehouses


[FEATURES]

  • Warehouses management from any menu via an export
    • View the current state of the warehouses : Warehouse Name | Jobname rented to | Gang Name rented to
    • Rent a warehouse
    • Reset the warehouse ownership
  • Private warehouses: each warehouse can only be opened by the gang/org/job it has been rented to
  • LSPD OPEN UP !! : each warehouse can be raided by the LSPD as long as they have lockpicks. When raiding a warehouse, a notification will be sent alerting every player of the raid but you will have to guess which warehouse is being raided !
  • Easily add or remove warehouses : Just add or remove the Warehouses from Config.lua, add or remove the needed info in the database and you are done !
  • Easily add or remove gangs, orgs, jobs : Just add or remove the jobs in Config.lua

[REQUIREMENTS]


[INSTALLATION]

  1. CD in your resources/[folderWhereYouWantTheScriptToBe]
  2. Clone the repository
git clone https://github.com/BenoursonJ/ESX-Illegal-Warehouses esx_illegalWarehouses
    • Warehouses and Inventories : Import illegalWarehouses_en.sql or illegalWarehouses_fr.sql according to your language in your database
  1. Add into a menu where you want to access the management panel from (example used is Mafia Job, full menu example at the end of this file):

exports["esx_illegalWarehouses"]:OpenWarehousesMenu()
  1. Add this in your server.cfg :
ensure esx_illegalWarehouses

[CONFIG.LUA EXPLAINED]

  • Config.DrawDistance | Maximum distance from which the markers can be seen

  • Config.Locale | Text language (currently supported: fr and en)

  • Config.PoliceCond | Percentage of failure (default: 75%)

  • Config.Policejob | Name of the job that is able to lockpick warehouses

  • Config.Zones | Array listing the warehouses, structure is as follow :

    • StorageName (ex: Storage1) | Marker name, must be the same than as defined in the DB
      • Position | Marker position
      • Marker Size | Marker size
      • Marker Color | Marker colour
      • Display Name | Marker Display Name
      • Type | Marker Type (0 = hidden | 1 = displayed)
  • Config.Gangs | List of gangs, organizations or jobs that can use the illegal warehouses system

    • Gangname (ex: ballas) | Gang name, must be the same as the one used to set a job (ex: /setjob 1 ballas 3)
      • Name | Display named that is used when a warehouse is rented. When opening the warehouses menu, you will see this variable and not the gangname

[TUTORIALS]

In need of info and troubleshooting tips ? Head to the Wiki => HERE


[MENU EXAMPLE]

function OpenCloakroomMenu()
  local elements = {
    {label = _U('citizen_wear'), value = 'citizen_wear'},
    {label = "Gestion Entrepôts", value = 'mafia_storagemanage'},
  }
  ESX.UI.Menu.CloseAll()
    ESX.UI.Menu.Open(
      'default', GetCurrentResourceName(), 'cloakroom',
      {
        title    = _U('cloakroom'),
        align    = 'top-left',
        elements = elements,
        },
        function(data, menu)
      menu.close()
      if data.current.value == 'mafia_storagemanage' and ((PlayerData.job ~= nil and PlayerData.job.name == 'mafia' and PlayerData.job.grade_name == 'boss') or (PlayerData.job2 ~= nil and PlayerData.job2.name == 'mafia' and PlayerData.job2.grade_name == 'boss')) then
        exports["esx_illegalWarehouses"]:OpenWarehousesMenu()
      else
        TriggerEvent('esx:showNotification', "Vous devez être Parrain pour ouvrir ce menu")
      end

      if data.current.value == 'citizen_wear' then
        ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
          local model = nil
          if skin.sex == 0 then
            model = GetHashKey("mp_m_freemode_01")
          else
            model = GetHashKey("mp_f_freemode_01")
          end
          RequestModel(model)
          while not HasModelLoaded(model) do
            RequestModel(model)
            Citizen.Wait(1)
          end
          SetPlayerModel(PlayerId(), model)
          SetModelAsNoLongerNeeded(model)
          TriggerEvent('skinchanger:loadSkin', skin)
          TriggerEvent('esx:restoreLoadout')
        end)
      end
   CurrentAction     = 'menu_cloakroom'
      CurrentActionMsg  = _U('open_cloackroom')
      CurrentActionData = {}
    end,
    function(data, menu)
      menu.close()
      CurrentAction     = 'menu_cloakroom'
      CurrentActionMsg  = _U('open_cloackroom')
      CurrentActionData = {}
    end)
end

Legal

License

esx_illegalWarehouses - Fivem script for es_extended. Enables the creation of warehouses that can be assigned to gangs/illegal organisations.

Copyright (C) 2021 Benourson#9496

This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version.

This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details.

You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/.

esx-illegal-warehouses's People

Contributors

benoursonj avatar guillerp8 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.