Here you will have a guide how to create a new corner in our script Corner Selling.
Open the config file config.lua.
Then you need to find the line that starts Config.Corners = { or go to line 81.
You will see preconfigured corners in the area of some GTA Roleplay gangs such as GSF, Ballas, Vagos, Marabunta, Rust, Mandem, and Aztecas.
Now decide how you want to create your corner, with points that will make a shape or with the middle points of the zone, and decide on the radius.
In either of them, we are very recommend to start the script and change the settings line 15 (debugZones) to true.
That's will show you a debug of all of the zones that are in the script and will help you create the corner more easy.
Let me give you a example code for either of the zones (circle or poly)
Example - Circle
This is the easy one, You just need to select the zones, get a vector3 coords in the middle of the zones, decide the radius, and select the items that you want the players will be able to sell them.
{
['type'] = "circle", -- Make sure that on circle
["corner_gang_ter"] = 'ballas', -- Here you can choose if the zone is defined as gang zone, will be helpful in the future, leave it none if there is no define
['corner_name'] = 'Drugs Corner', -- Leave it like that
['corner_distance'] = 2.0, -- The distance required from the player to the NPC to be able to open the order
['corner_position'] = vector3(0.0, 0.0, 0.0), -- The middle coords of your zone
['radius'] = 15.0, -- Radius for Zone
['corner_items'] = {
{
item = 'cokebaggy', -- Item name (Make sure that in your inventory the image will named the same to be displayed if preview is enabled)
label = 'Coke Baggy', -- The display label of the item
perPrice = { -- The minimum and the maximum price of each one
min = 480,
max = 680,
},
qty = { -- The minimum and the maximum amount that NPC can request in an order
min = 2,
max = 6,
},
},
},
},
Example - Poly
Here things getting a little more complicated but you can do that, I believe you.
With poly you are able to select all of the zone corners to make the zones as you want, something that you need to take care of, the last coord and the first one is connected automatically, make sure that the coords are built in this way that the last coord will be the one that connects to the first one.
{
['type'] = "poly", -- Make sure that on circle
["corner_gang_ter"] = 'gsf', -- Here you can choose if the zone is defined as gang zone, will be helpful in the future, leave it none if there is no define
['corner_name'] = 'Drugs Corner', -- Leave it like that
['corner_distance'] = 2.0, -- The distance required from the player to the NPC to be able to open the order
['points'] = { -- All of the zone corners
vector3(0.0, 0.0, 0.0),
vector3(0.0, 0.0, 0.0),
vector3(0.0, 0.0, 0.0),
vector3(0.0, 0.0, 0.0),
}, -- the minimum and the maximum Z of the zone (just select -1 from the lowest Z and +4 for the height Z to make it work good)
['minZ'] = 4.0,
['maxZ'] = 8.0,
['corner_items'] = {
{
item = 'cokebaggy', -- Item name (Make sure that in your inventory the image will named the same to be displayed if preview is enabled)
label = 'Coke Baggy', -- The display label of the item
perPrice = { -- The minimum and the maximum price of each one
min = 480,
max = 680,
},
qty = { -- The minimum and the maximum amount that NPC can request in an order
min = 2,
max = 6,
},
},
},
},
Well, congrats you finished the guide on how you can create a new corner in our Corner Selling script.
If you still need help you can contact as on our discord server.