Turfs
How to add a new turf ?
Last updated
How to add a new turf ?
Last updated
By default, there will be five turfs available for gangs to control. However, the script is designed to be flexible, allowing you to add as many additional turfs as you desire. This customizable feature ensures that the gameplay can be tailored to suit the specific needs and scale of your server.
Once a gang owns a turf, it will be colored with the gangs primary color and outlined with the gang secondary color as shown in the image below :
Here is an example on how to add a sixth turf : ( I have prepared an sql ready to use every time you want to add a turf)
INSERT INTO `gang_turfs` (`id`, `name`, `coordinates`, `color`, `fillColor`, `icon`, `gang`, `required`, `raid`, `time`) VALUES
(6, 'Turf Six', 'WE ADD THE COORDS HERE', '#ffff', '#ffffffc9', 'https://i.ibb.co/nQkq70y/blocked-icon-256x256-fxgkjvxb.png', NULL, 250, 0, NULL);
1- open newturf.sql
2- on the coordinates we will add the coords that will draw the turf on the ui :
2- 1 - open the gang ui and click on the terriotries page.
2-2 - on the map click on the edge of the polygone you want to draw and you the coords will be automatically copied.
[-96.16637701762679,-1591.049460012393]
2-3 -get the coords in a way to draw a polygone and paste them in the coords field in the sql. (follow the way other turfs are build)
[
[-96.16637701762679,-1591.049460012393],
[-45.16637701762678,-1546.549460012393],
[-103.41637701762679,-1512.299460012393],
[-109.16637701762679,-1513.299460012393],
[-124.16637701762679,-1514.049460012393],
[-121.66637701762679,-1530.799460012393],
[-122.66637701762679,-1541.799460012393],
[-124.42578125,-1548.796875],
[-114.92578125,-1561.296875],
[-104.67578125,-1584.046875],
[-99.42578125,-1591.296875]
]
3 - Once we have finished drawing the turf in the ui, we need to do it in the GTA.
3-1 - under config.lua add a new turf to Config.Turfs :
3-2 - The coords must be from the fivem, just create a polyzone correspanding to the same polyzone you created for turf 6 in the ui but this time in fivem using /vector2 or just get the x and y from the coords.
3-3 -Add the minZ and maxZ so all the turf is inside the polyzone.
3-4 - Add the allowed spray locations.
[6] = {
coords = {
vector2(131.68, -2029.12),
vector2(56.69, -2028.69),
vector2(-186.67, -1794.75),
vector2(-24.86, -1629.42),
vector2(253.29, -1859.93)
},
minZ = 5.0,
maxZ = 40.0,
debugPoly = true,
spray = { -- allowed spray locations
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),
}
},
On the sql of each turf there is a required amount of trust every gang must have to be able to spray on the turf. Once a gang got that amount of trust by selling the drugs, they will be able to raid the turf and spray on it to own it.
Spray is allowed only in spray locations, if the turf is already owned, the gang must inform the owner gang 24 hours before the raid.
The raid time is restricted in the config.lua !
Config.Turf = {
spray = 'spray', -- spray item name
clean = 'sprayc', -- spray cleaner item name
start = 22,
over = 7,
increase = 0.1, -- the amount the trust increases after each sell drug
decrease = 0.1, -- the amount the trust decreases after each sell drug from other gangs
penalty = 50, -- 50 points will be reduced from the raided gang points (just after raid ends)
color = '#ffff', -- default color after spray remove, (check sql in case you want to change the defaults aswell)
fillColor = '#ffffffc9', -- default color after spray remove, (check sql in case you want to change the defaults aswell)
icon = 'https://i.ibb.co/nQkq70y/blocked-icon-256x256-fxgkjvxb.png', -- default icon after spray remove, (check sql in case you want to change the defaults aswell)
}