Skip to content

Adding warehouses

Benourson#9496 edited this page Jan 31, 2021 · 1 revision

Adding warehouses

This short tutorial will enable you to add warehouses to esx_illegalWarehouses.


Adding a warehouse

Step 1 : config.lua

  • Go to the root of the esx_illegalWarehouses folder and open config.lua
  • Scroll down until you see this array :
Config.Zones = {
	Storage1 = {
		Pos   = {x = 306.06, y = 2892.14, z = 42.57},
		Size  = {x = 1.5, y = 1.5, z = 2.0},
		Color = {r = 136, g = 243, b = 216},
		Name  = "Entrepôt 1",
		Type  = 1
	},
	Storage2 = {
		Pos   = {x = 180.01, y = 6392.76, z = 30.37},
		Size  = {x = 1.5, y = 1.5, z = 2.0},
		Color = {r = 136, g = 243, b = 216},
		Name  = "Entrepôt 2",
		Type  = 1
	},
	Storage3 = {
		Pos   = {x = -1605.75, y = -829.14, z = 9.06},
		Size  = {x = 1.5, y = 1.5, z = 2.0},
		Color = {r = 136, g = 243, b = 216},
		Name  = "Entrepôt 3",
		Type  = 1
	},
	Storage4 = {
		Pos   = {x = -721.61, y = -1511.79, z = 4.0},
		Size  = {x = 1.5, y = 1.5, z = 2.0},
		Color = {r = 136, g = 243, b = 216},
		Name  = "Entrepôt 4",
		Type  = 1
	},
	Storage5 = {
		Pos   = {x = 2903.34, y = 4503.26, z = 47.08},
		Size  = {x = 1.5, y = 1.5, z = 1.0},
		Color = {r = 136, g = 243, b = 216},
		Name  = "Entrepôt 5",
		Type  = 1
	 },

	 Storage6 = {
		Pos   = {x = 1078.83, y = -2334.90, z = 29.26},
		Size = {x = 1.5, y = 1.5, z = 1.0},
		Color = {r = 136, g = 243, b = 216},
		Name  = "Entrepôt 6",
		Type  = 1
	}
}

This array is composed of multiple arrays which are used by the script. The structure of each sub-array is as follows:

	 StorageName+number= {
		Pos   = {x = 1078.83, y = -2334.90, z = 29.26},
		Size = {x = 1.5, y = 1.5, z = 1.0},
		Color = {r = 136, g = 243, b = 216},
		Name  = "Entrepôt 6",
		Type  = 1
	}

In order to add a new job to the script, you must add after the last sub-arrays right curly bracket a comma then paste under it a new sub-array without the comma at the end of it.

Then change :

  • StorageName+number => set it to the storage name you want (for good practices: Storage7, Storage8 etc...)
  • Pos => set x, y and z to the x, y and z coordinates you want the marker to be
  • Size => set x, y and z to the size in each direction you want the marker to be
  • Color => set r (red), g (green) and b (blue) to the values between 0 and 255. To pick a colour and get those values you can use THIS
  • Name => set it to whatever you want it to be as long as it is between the double quotation marks
  • Type => set it to 1 if you want the marker to be displayed, 0 otherwise

If I wanted to add for example Storage 7 at the coordinates (450.5, 225.5, 75.05), the array would look like :

Config.Zones = {
	Storage1 = {
		Pos   = {x = 306.06, y = 2892.14, z = 42.57},
		Size  = {x = 1.5, y = 1.5, z = 2.0},
		Color = {r = 136, g = 243, b = 216},
		Name  = "Entrepôt 1",
		Type  = 1
	},
	Storage2 = {
		Pos   = {x = 180.01, y = 6392.76, z = 30.37},
		Size  = {x = 1.5, y = 1.5, z = 2.0},
		Color = {r = 136, g = 243, b = 216},
		Name  = "Entrepôt 2",
		Type  = 1
	},
	Storage3 = {
		Pos   = {x = -1605.75, y = -829.14, z = 9.06},
		Size  = {x = 1.5, y = 1.5, z = 2.0},
		Color = {r = 136, g = 243, b = 216},
		Name  = "Entrepôt 3",
		Type  = 1
	},
	Storage4 = {
		Pos   = {x = -721.61, y = -1511.79, z = 4.0},
		Size  = {x = 1.5, y = 1.5, z = 2.0},
		Color = {r = 136, g = 243, b = 216},
		Name  = "Entrepôt 4",
		Type  = 1
	},
	Storage5 = {
		Pos   = {x = 2903.34, y = 4503.26, z = 47.08},
		Size  = {x = 1.5, y = 1.5, z = 1.0},
		Color = {r = 136, g = 243, b = 216},
		Name  = "Entrepôt 5",
		Type  = 1
	 },

	 Storage6 = {
		Pos   = {x = 1078.83, y = -2334.90, z = 29.26},
		Size = {x = 1.5, y = 1.5, z = 1.0},
		Color = {r = 136, g = 243, b = 216},
		Name  = "Entrepôt 6",
		Type  = 1
	},
	 Storage7 = {
		Pos   = {x = 450.5, y = 225.5, z = 75.05},
		Size = {x = 1.5, y = 1.5, z = 1.0},
		Color = {r = 136, g = 243, b = 216},
		Name  = "Entrepôt 7",
		Type  = 1
	}
}

Step 2 : Database

  • Go to you database manager (most of the time phpmyadmin)
  • Navigate to the right database
  • Click on SQL on the top navigation bar of phpmyadmin, the SQL query page will open.
  • Modify the following SQL queries to your liking then paste them in the query zone in phpmyadmin and then click on run
INSERT INTO illegal_warehouses (warehouse, label)
 VALUES
 ('storagename', 'displayName');

INSERT INTO addon_inventory (name, label, shared)
 VALUES
 ('storagename', 'displayName', 1);

 INSERT INTO datastore (name, label, shared)
 VALUES
 ('storagename', 'displayName', 1);

Replace the following values :

  • storagename => Storagename+number defined in config.lua but lowercase
  • displayname => Set it to whatever you feel like

If I wanted to add Storage7, the queries would look like :

INSERT INTO illegal_warehouses (warehouse, label)
 VALUES
 ('storage7', 'Warehouse 7');

INSERT INTO addon_inventory (name, label, shared)
 VALUES
 ('storage7', 'Warehouse 7', 1);

 INSERT INTO datastore (name, label, shared)
 VALUES
 ('storage7', 'Warehouse 7', 1);

Last Step => restart the server and everything should work perfectly !