SQZ Scripts
Search…
sqz_Drugs
Script for planting, harvesting, processing and selling drugs. Easy !

Get it now !

Configuration

  1. 1.
    Put the script named sqz_drugs to your resources folder and ensure sqz_drugs to your server.cfg or any other start cfg file
  2. 2.
    Run the SQL provided file
  3. 3.
    Oviously configure your config by your likings 😜

Adding plantable drug

  1. 1.
    Take the part bellow and duplicate it and increase its index (the number in [] )
  2. 2.
    You need to put the items to the database, items are located in Items table
  3. 3.
    The 2 props can be changed as the plant grows -> It can change its prop after the process status
  4. 4.
    RewardItemCount is count of item you will receive if the status and quality are 100%
1
[1] = {
2
3
PlantLocation = {
4
Position = vector3(2852.8599,4631.1924,48.9308),
5
Radius = 150.0,
6
CanPlantAnyWhereInArea = true, -- If true, player can plant the defined item anyhwere in the area (especially for fields). If false, player can not plant anywhere, he must stay near ant of prop defined in the table bellow (and he will plant into that prop)
7
AllowedPropsToPlantIn = {
8
[GetHashKey("prop_table_03b")] = 0.4 -- List of props that you need to stay in front of them to plant in them, the number after "=" is x offset that the entity will be planted with (to prevent bugging in prop)
9
-- Here you can add other
10
-- And other
11
-- And way more others
12
},
13
},
14
15
CopsNumbers = {
16
Plant = 1,
17
Harvest = 1
18
},
19
20
Animations = {
21
Plant = {
22
AnimDict = "[email protected][email protected]@base", -- The animation dictionary that is used/shown when planting plant
23
AnimName = "base", -- The animation name that is used when planting a plant
24
Duration = 4000, -- Set to 0 to disable animations
25
blendInSpeed = 8.0,
26
blendOutSpeed = 8.0,
27
AnimFlag = 1,
28
MythicProggbarLabel = "Planting Weed"
29
},
30
Pickup = {
31
AnimDict = "[email protected]",
32
AnimName = "fixing_a_ped",
33
Duration = 4000, -- Set to 0 to disable animations
34
blendInSpeed = 8.0,
35
blendOutSpeed = 8.0,
36
AnimFlag = 1,
37
MythicProggbarLabel = "PickingUP Weed"
38
}
39
},
40
41
StatusAddNumber = 5, -- A number that is added to the plant Status on every cycle
42
WaterRemoveOnCycle = 50, -- The number of water is remove on every cycle (if the plant has lower number of WaterStatus, then the value is decreased by IfNotMoreThenWaterRemoveOnCycle)
43
IfNotMoreThenWaterRemoveOnCycle = 20, -- The number of water is removed when the plant WaterStatus is lower then "WaterRemoveOnCycle" (line above).
44
-- Also it is a value that the plant must have to pass the loop to fertilizer (if the plantWater is lower then the value above, the plant won't get any quality aldo it has a fertilizer)
45
Statuses = {
46
[1] = {
47
MinimalFertilizerStatus = 90, -- The plant fertilizer value that a plant must have to be affected by this value
48
SetFertilizerStatusTo = 60, -- The value that the fertilizer status is set to.
49
QualityPointsAdd = 5, -- The quality points that are added to the Plant Status
50
},
51
[2] = {
52
MinimalFertilizerStatus = 70, -- The plant fertilizer value that a plant must have to be affected by this value
53
SetFertilizerStatusTo = 40, -- The value that the fertilizer status is set to.
54
QualityPointsAdd = 4, -- The quality points that are added to the Plant Status
55
},
56
[3] = {
57
MinimalFertilizerStatus = 50, -- The plant fertilizer value that a plant must have to be affected by this value
58
SetFertilizerStatusTo = 10, -- The value that the fertilizer status is set to.
59
QualityPointsAdd = 3, -- The quality points that are added to the Plant Status
60
},
61
[4] = {
62
MinimalFertilizerStatus = 30, -- The plant fertilizer value that a plant must have to be affected by this value
63
SetFertilizerStatusTo = 10, -- The value that the fertilizer status is set to.
64
QualityPointsAdd = 2, -- The quality points that are added to the Plant Status
65
}
66
},
67
68
Items = {
69
70
PlantItemName = "weed_seed", -- Item need to plant a weed in current zone
71
PlantWaterItem = "water", -- Item need to water a weed in current zone
72
PlantFertilizeItem = "fertilizer", -- Item needed to fertilize a weed in current zone
73
RewardItemName = "weed", -- The name of a item you will get after harvesting a weed plant
74
RewardItemCount = 200, -- The Number of item a player will get after harvesting a plant with 100% status and 100% Quality
75
--QualityReduce = 1.05, -- *Explained bellow (removed for now, since it is not needed)
76
-- StatusReduce = 1.05 -- **Explained bellow (removed for now, since it is not needed)
77
78
},
79
80
Props = {
81
SmallProp = "prop_weed_02", -- The obejct name of the plant that will be crated after a plant is planted
82
BigProp = "prop_weed_01", -- The object name of the plant that the first (SmalProp) will be replaced for after it reaches the ChangePropsAfterStatus
83
ChangePropsAfterStatus = 50 -- The amount of status points from 100% that if a plant reaches then the plant prop (SmallProp) will be replaced to BigProp (Set it to -1 to never replace a prop for this location)
84
},
85
86
FertilizerAddAmount = 10.0, -- The number of fertilizer points that will be added on every cycle
87
WaterAddAmount = 10.0 -- The number of water points that will be added on every cycle
88
},
Copied!

Adding "classic" drug

  1. 1.
    The Config.Drugs.joint - joint - is the item name that must be in the database and is the main product
  2. 2.
    In the zones, there are 2 types: Collect/Process, you can add them as much as you want to, just change the table index, type is specified in the Action
  3. 3.
    Make sure you have all the items in your databases, maily the one in 1. step, GiveItem and the items from RequiredItems
1
Config.Drugs.joint = { -- Make sure that the drug name is in lower, otherwise it will not work
2
Zones = {
3
Collect = {
4
Location = vector3(1534.2247,3696.3442,34.5528), -- The location of pickup point
5
Size = {x = 1.0, y = 1.0, z = 1.0}, -- Size of the marker
6
Color = {r = 255, g = 255, b = 0}, -- Color of the marker
7
MotionText = "[E] Pickup", -- Text that will be show when coming near in the DrawText3D section (if Draw3DText Enabled)
8
Action = "Collect", -- Just for collecting leave it
9
Marker = 22, -- Marker Id
10
UseInovativeMarkers = false, -- If the help text should look "different", image in the forum
11
DrawInovativeMarkersRadius = 5.0 -- The distance a player can see the marker from
12
},
13
Process = {
14
Location = vector3(1534.2247,3696.3442,40.5528), -- The location for pickup points
15
Size = {x = 1.0, y = 1.0, z = 1.0}, -- Size of the marker
16
Color = {r = 255, g = 255, b = 0}, -- Color of the marker
17
MotionText = "[E] Process", -- The text name that will be drawn on the screen if Drwa3D Text enabled
18
Action = "Process", -- For Processing just leave it as it is
19
Marker = 22, -- The marker ID
20
UseInovativeMarkers = false, -- If the help text should look "different", image in the forum
21
DrawInovativeMarkersRadius = 5.0 -- The distance a player can see the marker from
22
},
23
},
24
25
Actions = {
26
Collect = {
27
MinCops = 1, -- The minimal count of cops that must be online to player can be able to collect a item
28
RequiredItems = { -- Bellow will be listed items a player will need for Collecting
29
{itemName = "water", count = 1, removeItem = false} -- itemName is the name from database, removeItem will remove the item from player inventory after fininished collecting
30
},
31
GiveItem = "weed", -- The item a player should get when he is done
32
GiveItemCount = 1, -- The count of a item a player should get when he is done
33
Animations = { -- Animation properties are listed bellow
34
AnimDict = "[email protected]", -- The animation dictionary for Collecting animation
35
AnimName = "fixing_a_ped", -- The animation name for Collectiong anitamtion
36
Duration = 4000, -- Set to 0 to disable animations
37
blendInSpeed = 8.0,
38
blendOutSpeed = 8.0,
39
AnimFlag = 1,
40
MythicProggbarLabel = "Harvesting Drug" -- The label which will be shown in the mythic progres bar
41
}
42
},
43
Process = {
44
MinCops = 1, -- Minimal cops from processing
45
RequiredItems = { -- Bellow you can list items a player will need for a processing
46
{itemName = "ocb", count = 1, removeItem = true} -- itemName is a name of the item in database and the removeItem is if a player should get remove this item
47
},
48
GiveItem = "joint", -- The item a player should get
49
GiveItemCount = 1, -- The amount of the item a player should get after finishing Proccesing
50
Animations = { -- Bellow there will be listed animations
51
AnimDict = "[email protected]", -- Animation Dictionary for processing
52
AnimName = "fixing_a_ped", -- Animation name from processing
53
Duration = 4000, -- Set to 0 to disable animations
54
blendInSpeed = 8.0,
55
blendOutSpeed = 8.0,
56
AnimFlag = 1,
57
MythicProggbarLabel = "Processing Drug" -- The label which should be displayed when processing
58
}
59
},
60
},
61
Effects = { -- Effects that current "drugs" should give
62
GiveHP = 1.0, -- Set to 0.0 to give no additinal HP
63
GiveArmour = 50.0, -- Set to 0.0 to not give armour
64
SetInfiniteStamina = true, -- If a player should get unlimited stamina when using current drug
65
SpeedMultiplier = 2.0, -- The speed multiplier that should be given to player when using this drug
66
OnUseScenario = "WORLD_HUMAN_SMOKING_POT", -- The screnario played after using a item (the scenarios can be found there: https://pastebin.com/6mrYTdQv)
67
MoveClipset = "[email protected]@VERYDRUNK", -- The MoveClipset that will be aplied to player after using a item https://docs.fivem.net/natives/?_0xAF8A94EDE7712BEF
68
MotionBlur = true, -- If a player should get a MotionBlur
69
SetPedDrunk = true, -- If a player should be set as a drunk
70
ClearTimeCycleModifier = true, -- IF the TimeCycleModifier should be reseted after the ResetAfter timeout is after
71
TimeCycleModifier = "spectator5", -- The TimeCycleModifier that will be used https://pastebin.com/kVPwMemE
72
ResetAfter = 5 -- Time in SECONDS when the stats should be reset
73
},
74
75
RemoveAfterUse = true -- Should be the drug removed on its use?
76
}
Copied!

Making drug sellable to NPC

With this part you will be able to type: /sellItem [itemName] [itemCount] and sell drugs to NPC. You can add as many drugs as you want to using the method bellow.
  1. 1.
    Duplicate the part bellow
  2. 2.
    Change the index, it is the name of the sold item (now it is marijuana )
  3. 3.
    Change all the properties of the item
1
marijuana = {
2
GiveBlack = true, -- If true, player will get "black_money" account
3
MinimalGiveMoney = 200, -- The minimal amount of money a player will receive after selling drugs
4
MaximalGiveMoney = 500, -- The maximal amount of money a player will receive after selling drugs
5
SellFromPoint = vector3(62.8466,-638.6946,44.2151), -- The center sell points where the distance will be counted from
6
Radius = 500.0, -- THe radiuse from a SellFromPoint player can sell items
7
RejectChance = 5, -- The chance that the ped will reject offer (100/RejectChance is the chance) (now it is 20%)
8
MinItemSell = 2, -- The minimal item count that will be removed from the player (if player does not have anough item, he will be charged 1 item)
9
MaxItemSell = 4, -- The maximal item count that a player can get removed (same as above)
10
ShouldCallPoliceAfterRejecting = true, -- If true then a police jobs will be called after rejecting
11
CallPoliceAfterRejectingChange = 3, -- The chance that a police jobs will be alterted after rejecting offer (100/CallPoliceAfterRejectingChange) (now it is 33%)
12
ShouldKillInTheseAreasAfterRejecting = true, -- If true than if a player is in these areas (areas where are ussualy no people) will be killed if he does not have a friend to sell with
13
-- (the ped will take out a gun and Stealth Kill the player (If the palyer is not stronger :D))
14
-- To not be killed in these areas there must an other player at maximal distance of 3 gta units away
15
KillAreas = {
16
[1] = { -- First area
17
Location = vector3(-45.442,-720.8846,44.2506), -- Location
18
Radius = 5.0 -- Radius
19
},
20
[2] = {
21
Location = vector3(2.0, 2.0, 2.0),
22
Radius = 4.0
23
}
24
-- Below you can add as much as you want but make sure it is a sequenced table otherwise it will broke
25
},
26
CanSellToAllPeds = true, -- If true then a player can sell items to all types of peds
27
PedPlayerCanSellTo = { -- If config above then a player can sell only to these types of peds
28
[GetHashKey("a_f_m_fatbla_01")] = true,
29
[GetHashKey("a_f_m_fatwhite_01")] = true,
30
-- Below you can add as much ped types as you want, but make sure it is a hash
31
},
32
SellAnimation = {
33
AnimDict = "mp_common", -- Animation directory for current animation
34
AnimName = "givetake1_a", -- The animatino name
35
Duration = 3000, -- Set to 0 to disable animations
36
blendInSpeed = 8.0,
37
blendOutSpeed = 8.0,
38
AnimFlag = 1,
39
MythicProggbarLabel = "Selling drug" -- The label which will be show in the progress bar
40
}
41
}
Copied!

Making drug sellable to "friends"

WIth this part you will be able to go to the phone cabin, choose how many drugs you wanna sell, then a friend will come for you and you will sell the drug for you -> the friend is NPC. You can add as much locations as you want to using the method bellow.
  1. 1.
    Add phone cabin to the config by duplicating the part bellow
  2. 2.
    Have all the drugs in the database
  3. 3.
    Set all the properties to your likings
1
{
2
-- Other
3
MinCops = 0, -- Minimal needed cops for starting the "mini-heist"
4
GiveBlack = true, -- If player should get dirty money, otherwise he will receive cash
5
AddBlipForFriend = true, -- IF a blip should be added for the NPC when it is spawned
6
CabinCoords = vector3(-262.5074,-765.576,32.6092), -- The position of the phone
7
SpawnPedCoords = vector3(-278.7723,-780.6352,31.5232), -- The coords when the ped souhld be spawned and deleted
8
PedModel = "a_m_m_eastsa_01", -- The model of a ped which will be spawned
9
Spawnheading = 50.0, -- The spawn heading of the ped
10
Items = {'phone', 'cokepack'}, -- The items allowed to be sold here
11
MaxSellCount = {10, 15}, -- Max item sold count for each item (first item must be first count here)
12
MinSellPrices = {10, 20}, -- Min price for currectly sold item (first item must be first number here)
13
MaxSellPrices = {15, 20}, -- Max price for each item (first item must be first number here)
14
-- Markers
15
Size = {x = 1.0, y = 1.0, z = 1.0}, -- Size of the marker
16
Color = {r = 255, g = 255, b = 0}, -- Color of the marker
17
MotionText = "[E] Call", -- The label which will be shown on the Draw3DText
18
Marker = 22, -- The marker ID
19
UseInovativeMarkers = true, -- If the help text should look "different", image in the forum
20
DrawInovativeMarkersRadius = 5.0, -- The distance a player can see the marker from
21
--Animations
22
SellAnimation = {
23
AnimDict = "mp_common", -- Animation directory for current animation
24
AnimName = "givetake1_a", -- The animatino name
25
Duration = 3000, -- Set to 0 to disable animations
26
blendInSpeed = 8.0,
27
blendOutSpeed = 8.0,
28
AnimFlag = 1,
29
UseMythicProggBar = true, -- Whatever to use mythic progress bar or not
30
MythicProggbarLabel = "Selling drug" -- The label which will be show in the progress bar
31
}
32
}
Copied!

Making drug sellable by delivering

With this part you will be able to sell drugs using car and delivering drugs (items) to check points. You can add as much locations as you want to using the method bellow.
  1. 1.
    Duplicate the part bellow
  2. 2.
    Add as many delivery locations as you want to
  3. 3.
    Configure all the properties as you want to
  4. 4.
    Make sure all the items are in the database
1
{
2
Locations = {
3
{
4
Pos = vector3(1293.5991,1384.7307,101.4545), -- First delivery location
5
used = false, -- Do not touch this, you do not need to :)
6
Min = 10, -- The minimal amount in math.random a player will deliver
7
Max = 20 -- The maximal amount in math.random a player will deliver
8
},
9
{
10
Pos = vector3(1201.006,1862.9187,77.0745), -- Second delivery location
11
used = false, -- Do not touch this, you do not need to :)
12
Min = 10, -- The minimal amount in math.random a player will deliver
13
Max = 20 -- The maximal amount in math.random a player will deliver
14
},
15
{
16
Pos = vector3(1110.6906,2098.6851,53.1546), -- Third delivery location
17
used = false, -- Do not touch this, you do not need to :)
18
Min = 10, -- The minimal amount in math.random a player will deliver
19
Max = 20 -- The maximal amount in math.random a player will deliver
20
}
21
},
22
Items = {'joint', 'water'}, -- The items allowed to be sold here
23
MaxSellCount = {50, 15}, -- Max item sold count for each item (first item must be first count here)
24
MinSellPrices = {10, 20}, -- Min price for currectly sold item (first item must be first number here)
25
MaxSellPrices = {15, 20}, -- Max price for each item (first item must be first number here)
26
CarSpawnLoc = vector3(1367.5193,1138.7201,113.759), -- The spawn and return location of the vehicle
27
CarSpawnHeading = 69.0, -- The heading of the spawned car
28
CarProps = { -- Bellow you can set the vehicle properties which will be aplied to the vehicle
29
plate = 'BURRITO',
30
color1 = 27
31
},
32
CarModel = "burrito", -- Model name of the car
33
PayForTruck = 100, -- The money a player will need to pay on the start (maybye for the car)
34
ReturnTruck = 100, -- The money a player will receive when he returns the vehicle
35
GiveBlack = true, -- If a player should get black money on delivery
36
-- Start location
37
MinCops = 1, -- Needed cops for start of the mission
38
StartLocation = vector3(1390.1125,1132.0562,114.3345), -- The location you will see the marker
39
-- Markers
40
Size = {x = 1.0, y = 1.0, z = 1.0}, -- Size of the marker
41
Color = {r = 255, g = 255, b = 0}, -- Color of the marker
42
MotionText = "[E] Call", -- The label which will be shown on the Draw3DText
43
Marker = 22, -- The marker ID
44
UseInovativeMarkers = true, -- If the help text should look "different", image in the forum
45
DrawInovativeMarkersRadius = 5.0, -- The distance a player can see the marker from
46
}
Copied!

Adding blackshops

Again you can add as many blackshops as you want to. Here you will be able
  1. 1.
    Duplicate the part bellow
  2. 2.
    Configure the shop items. If it is weapon and you wanna add it as xPlayer.addWeapon , make sure you set weapon = true
  3. 3.
    Make sure all the items are in the database.
1
{
2
Location = vector3(1390.0927,1162.0493,114.3345),
3
-- Markers
4
Size = {x = 1.0, y = 1.0, z = 1.0}, -- Size of the marker
5
Color = {r = 255, g = 255, b = 0}, -- Color of the marker
6
MotionText = "[E] Call", -- The label which will be shown on the Draw3DText
7
Marker = 22, -- The marker ID
8
UseInovativeMarkers = true, -- If the help text should look "different", image in the forum
9
DrawInovativeMarkersRadius = 5.0, -- The distance a player can see the marker from
10
-- Items
11
ShopItems = {
12
{item = 'joint', price = 550, label = 'Joint', weapon = false},
13
{item = 'weed_seed', price = 50, label = 'Weed Seed', weapon = false},
14
{item = 'WEAPON_ASSAULTRIFLE', price = 5000, label = 'Assault Rifle', weapon = true},
15
},
16
Ammo = 50, -- The number of ammo that the player will get when buying a weapon
17
PayInBlack = false, -- If enabled, the player will be able to pay only in black, otherwise he will pay using a cash or a bank (automatic, if does not have cash, bank will be used)
18
Blip = {
19
Use = true, -- If the shop should have a blip on the map
20
BlipLabel = "Illegal shop", -- Name of the blips on the map
21
BlipColour = 40, -- Colour of the blips on the map
22
BlipSprite = 51, -- Sprite of the blip on the map
23
BlipDisplay = 4, -- Blip display on the map
24
BlipScale = 1.0 -- Blip size on the map
25
}
26
}
Copied!

Adding simple sell points

This is for selling items just by clicking items in the menu, there is one simple animation, nothing "pog", you can sell items and weapons.
  1. 1.
    Duplicate the part bellow
  2. 2.
    Change the item properties, if it is weapon or not (if it is weapon, it is check if xPlayer.hasWeapon, not if xPlayer.getInventoryItem)
  3. 3.
    Set all the other parts to whatever you want to.
1
{
2
Location = vector3(-1101.5736,4940.8838,218.354),
3
-- Markers
4
Size = {x = 1.0, y = 1.0, z = 1.0}, -- Size of the marker
5
Color = {r = 255, g = 255, b = 0}, -- Color of the marker
6
MotionText = "[E] Open Selling Menu", -- The label which will be shown on the Draw3DText
7
Marker = 22, -- The marker ID
8
UseInovativeMarkers = true, -- If the help text should look "different", image in the forum
9
DrawInovativeMarkersRadius = 5.0, -- The distance a player can see the marker from
10
-- Items
11
SellItems = {
12
{item = 'joint', price = {min = 10, max = 50}, weapon = false},
13
{item = 'weed_seed', price = {min = 5, max = 10}, weapon = false},
14
{item = 'WEAPON_PISTOL', price = {min = 4000, max = 5000}, weapon = true},
15
},
16
PayInBlack = false, -- If enabled, the player will receive money in black money
17
MythicProggbarLabel = "Selling items", -- The label which will be show in the progress bar
18
Blip = {
19
Use = true, -- If the shop should have a blip on the map
20
BlipLabel = "Selling point of illegal things", -- Name of the blips on the map
21
BlipColour = 56, -- Colour of the blips on the map
22
BlipSprite = 521, -- Sprite of the blip on the map
23
BlipDisplay = 4, -- Blip display on the map
24
BlipScale = 1.0 -- Blip size on the map
25
}
26
}
Copied!

Configs

client_edit
server_edit
config_c
config_s
locales
1
Citizen.CreateThread(function()
2
while ESX == nil do
3
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) -- Change this event in case you are yousing custom ESX events
4
Citizen.Wait(0)
5
end
6
7
while ESX.GetPlayerData().job == nil do
8
Citizen.Wait(10)
9
end
10
11
ESX.PlayerData = ESX.GetPlayerData()
12
13
end)
14
15
function debugMessage(message)
16
17
--print('^2[sqz_drugs]^0 '..message) -- Turned off by default
18
-- Lines used to print debug in case of errors, if you want to, you can remove the print using --print(...)
19
20
end
21
22
function showNotification(message)
23
24
ESX.ShowNotification(message)
25
26
-- Default GTA es_extended notifications, change it fou want to use if differently
27
28
end
29
30
RegisterNetEvent('sqz_drugs:drugUsedCustom')
31
AddEventHandler('sqz_drugs:drugUsedCustom', function(drugName)
32
33
-- This event is triggered on every use of drug (registered item (Config.Drugs))
34
-- drugName is name of the drug, can be used as a index of the Config.DrugsTable
35
-- You can call here whatever you want to
36
37
end)
38
39
RegisterNetEvent('sqz_drugs:drugSoldCustom')
40
AddEventHandler('sqz_drugs:drugSoldCustom', function(drugName, count)
41
42
-- This event is triggered on every successfull sell of drug (registered item (Config.Drugs))
43
-- drugName is name of the drug, can be used as a index of the Config.DrugsTable
44
-- You can call here whatever you want to
45
-- The count is obviously the count of drug sold
46
47
end)
48
49
function Draw3DText(x, y, z, text)
50
SetTextScale(0.35, 0.35)
51
SetTextFont(4)
52
SetTextProportional(1)
53
SetTextColour(255, 255, 255, 215)
54
SetTextEntry('STRING')
55
SetTextCentre(true)
56
AddTextComponentString(text)
57
SetDrawOrigin(x,y,z, 0)
58
DrawText(0.0, 0.0)
59
local factor = (string.len(text)) / 370
60
DrawRect(0.0, 0.0+0.0125, 0.015+ factor, 0.03, 0, 0, 0, 85)
61
ClearDrawOrigin()
62
end
Copied!
1
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) -- Change the event if you are using any other event for getting ESX (if you have changed events for example)
2
3
function debugMessage(message)
4
5
print('^2[sqz_drugs]^0 '..message)
6
7
-- These lines are used for simplied debug, you can remove the print line (--print(...))
8
9
end
10
11
function showNotification(playerId, message)
12
13
local xPlayer = ESX.GetPlayerFromId(playerId)
14
15
xPlayer.showNotification(message)
16
-- The notification is triggered when sending a notification to a player
17
-- Change it if you are using any custom notifications or using older es_extended
18
19
end
20
21
function CanCarryItem(playerId, item, count)
22
23
local xPlayer = ESX.GetPlayerFromId(playerId)
24
25
if xPlayer.canCarryItem(item, count) then
26
return true
27
else
28
return false
29
end
30
31
-- Edit in case you are using item limit system
32
33
end
34
35
RegisterNetEvent('sqz_drugs:SellCustomNotification')
36
AddEventHandler('sqz_drugs:SellCustomNotification', function(playerId, coords, type)
37
38
-- This event is triggered when you do not want to use predefined animations (for example if you are using any dispatch)
39
-- The playerId is ID of seller player
40
-- Coords is location when a player is selling
41
-- Type is type of illegal activity
42
--- 'itemSell' when player is selling drugs on the street
43
44
end)
45
46
RegisterNetEvent('sqz_drugs:sendDiscordNotification')
47
AddEventHandler('sqz_drugs:sendDiscordNotification', function(playerId, body, header)
48
49
if SConfig.WebHookDiscord then
50
if item_id then
51
item_id = item_id
52
else
53
item_id = 'none'
54
end
55
56
local connect = {
57
{
58
['color'] = 14177041,
59
['title'] = header,
60
['description'] = body,
61
['footer'] = {
62
['text'] = os.date('%Y/%m/%d %X'),
63
},
64
}
65
}
66
PerformHttpRequest(SConfig.WebHookDiscord, function(err, text, headers) end, 'POST', json.encode({embeds = connect}), { ['Content-Type'] = 'application/json' })
67
68
end
69
70
-- This is part used for sending Discord webhooks, you can edit it by your likings :)
71
72
end)
Copied!
1
Config = {}
2
3
Config.Locale = 'en' -- Language you want to use (defined in locales folder) [cs/en/es]
4
5
Config.MaxPlantedWeedPlants = -1 -- Maximal number of weed plants that a user can plant, set to -1 to give him unlimited plants
6
7
-- Save Plants Command
8
Config.SavePlantsCommand = "savePlants" -- Name of command that will save plantedEntities
9
Config.SaveCommandAllowedGroups = {
10
["superadmin"] = true,
11
["admin"] = true
12
-- You can add more groups that will be able to save plants using command to save plants
13
}
14
15
Config.MenuAlign = "right" -- ESX.Menu item align
16
17
Config.Materials = {
18
PlantOnEveryMaterial = false, -- If true, player will be able to plant everywhere (even on roads, etc. ...)
19
Allowed = { -- Player will be only allowed to plant on those materials if the option above is false
20
[1333033863] = true, -- Grass
21
[-1286696947] = true, -- Grass short
22
[-461750719] = true, -- Grass long
23
[-1833527165] = true, -- Hay
24
[1109728704] = true, -- Field
25
}
26
}
27
28
Config.customEvents = { -- Change events bellow to fit your event names
29
["mythic_progbar:client:progress"] = "mythic_progbar:client:progress",
30
["esx:playerLoaded"] = "esx:playerLoaded",
31
["esx:playerDropped"] = "esx:playerDropped",
32
["esx:setJob"] = "esx:setJob"
33
}
34
35
Config.PoliceJobs = { -- Define which jobs are counted as police jobs, to count active cops
36
["police"] = true,
37
["sheriff"] = true
38
-- Bellow you can add as much as you want to
39
}
40
41
42
Config.TimeToDeleteOldPlants = 604800 -- Time in seconds to delete the plant if is old
43
Config.Plantables = {
44
45
CycleTime = 1.2 * 60 * 60 * 1000, -- The time that the loop which checks the status of the plants run (now it is 1.2 hour - so every 1.2 it cheks and updates the status of the plant) (The plant should grow UP in 24 hours)
46
47
[1] = {
48
49
PlantLocation = {
50
Position = vector3(2852.8599,4631.1924,48.9308),
51
Radius = 150.0,
52
CanPlantAnyWhereInArea = true, -- If true, player can plant the defined item anyhwere in the area (especially for fields). If false, player can not plant anywhere, he must stay near ant of prop defined in the table bellow (and he will plant into that prop)
53
AllowedPropsToPlantIn = {
54
[GetHashKey("prop_table_03b")] = 0.4 -- List of props that you need to stay in front of them to plant in them, the number after "=" is x offset that the entity will be planted with (to prevent bugging in prop)
55
-- Here you can add other
56
-- And other
57
-- And way more others
58
},
59
},
60
61
CopsNumbers = {
62
Plant = 1,
63
Harvest = 1
64
},
65
66
Animations = {
67
Plant = {
68
AnimDict = "[email protected][email protected]@base", -- The animation dictionary that is used/shown when planting plant
69
AnimName = "base", -- The animation name that is used when planting a plant
70
Duration = 4000, -- Set to 0 to disable animations
71
AnimFlag = 1,
72
MythicProggbarLabel = "Planting Weed"
73
},
74
Pickup = {
75
AnimDict = "[email protected]",
76
AnimName = "fixing_a_ped",
77
Duration = 4000, -- Set to 0 to disable animations
78
AnimFlag = 1,
79
MythicProggbarLabel = "PickingUP Weed"
80
}
81
},
82
83
StatusAddNumber = 5, -- A number that is added to the plant Status on every cycle
84
WaterRemoveOnCycle = 50, -- The number of water is remove on every cycle (if the plant has lower number of WaterStatus, then the value is decreased by IfNotMoreThenWaterRemoveOnCycle)
85
IfNotMoreThenWaterRemoveOnCycle = 20, -- The number of water is removed when the plant WaterStatus is lower then "WaterRemoveOnCycle" (line above).
86
-- Also it is a value that the plant must have to pass the loop to fertilizer (if the plantWater is lower then the value above, the plant won't get any quality aldo it has a fertilizer)
87
Statuses = {
88
[1] = {
89
MinimalFertilizerStatus = 90, -- The plant fertilizer value that a plant must have to be affected by this value
90
SetFertilizerStatusTo = 60, -- The value that the fertilizer status is set to.
91
QualityPointsAdd = 5, -- The quality points that are added to the Plant Status
92
},
93
[2] = {
94
MinimalFertilizerStatus = 70, -- The plant fertilizer value that a plant must have to be affected by this value
95
SetFertilizerStatusTo = 40, -- The value that the fertilizer status is set to.
96
QualityPointsAdd = 4, -- The quality points that are added to the Plant Status
97
},
98
[3] = {
99
MinimalFertilizerStatus = 50, -- The plant fertilizer value that a plant must have to be affected by this value
100
SetFertilizerStatusTo = 10, -- The value that the fertilizer status is set to.
101
QualityPointsAdd = 3, -- The quality points that are added to the Plant Status
102
},
103
[4] = {
104
MinimalFertilizerStatus = 30, -- The plant fertilizer value that a plant must have to be affected by this value
105
SetFertilizerStatusTo = 10, -- The value that the fertilizer status is set to.
106
QualityPointsAdd = 2, -- The quality points that are added to the Plant Status
107
}
108
},
109
110
Items = {
111
112
PlantItemName = "weed_seed", -- Item need to plant a weed in current zone
113
PlantWaterItem = "water", -- Item need to water a weed in current zone
114
PlantFertilizeItem = "fertilizer", -- Item needed to fertilize a weed in current zone
115
RewardItemName = "weed", -- The name of a item you will get after harvesting a weed plant
116
RewardItemCount = 200, -- The Number of item a player will get after harvesting a plant with 100% status and 100% Quality
117
RequiredItemsPlant = { -- Bellow will be listed items a player will need for planting this drug
118
{itemName = "water", count = 1, removeItem = false} -- itemName is the name from database, removeItem will remove the item from player inventory while planting
119
},
120
RequiredItemsHarvest = { -- Bellow will be listed items a player will need for harvesting this drug
121
{itemName = "water", count = 1, removeItem = false} -- itemName is the name from database, removeItem will remove the item from player inventory while harvesting
122
},
123
},
124
125
Props = {
126
SmallProp = "prop_weed_02", -- The obejct name of the plant that will be crated after a plant is planted
127
BigProp = "prop_weed_01", -- The object name of the plant that the first (SmalProp) will be replaced for after it reaches the ChangePropsAfterStatus
128
ChangePropsAfterStatus = 50 -- The amount of status points from 100% that if a plant reaches then the plant prop (SmallProp) will be replaced to BigProp (Set it to -1 to never replace a prop for this location)
129
},
130
131
FertilizerAddAmount = 10.0, -- The number of fertilizer points that will be added on every cycle
132
WaterAddAmount = 10.0 -- The number of water points that will be added on every cycle
133
},
134
135
[2] = {
136
137
PlantLocation = {
138
Position = vector3(2040.8593,4908.0039,41.2919),
139
Radius = 250.0,
140
CanPlantAnyWhereInArea = true, -- If true, player can plant the defined item anyhwere in the area (especially for fields). If false, player can not plant anywhere, he must stay near ant of prop defined in the table bellow (and he will plant into that prop)
141
AllowedPropsToPlantIn = {
142
[GetHashKey("prop_table_03b")] = 0.4 -- List of props that you need to stay in front of them to plant in them, the number after "=" is x offset that the entity will be planted with (to prevent bugging in prop)
143
-- Here you can add other
144
-- And other
145
-- And way more others
146
}
147
},
148
149
CopsNumbers = {
150
Plant = 1,
151
Harvest = 1
152
},
153
154
Animations = {
155
Plant = {
157
AnimName = "base",
158
Duration = 4000, -- Set to 0 to disable animations
159
AnimFlag = 1,
160
MythicProggbarLabel = "Planting Weed"
161
},
162
Pickup = {
163
AnimDict = "[email protected]",
164
AnimName = "fixing_a_ped",
165
Duration = 4000, -- Set to 0 to disable animations
166
AnimFlag = 1,
167
MythicProggbarLabel = "PickingUP Weed"
168
}
169
},
170
171
StatusAddNumber = 5, -- A number that is added to the plant Status on every cycle
172
WaterRemoveOnCycle = 50, -- The number of water is remove on every cycle (if the plant has lower number of WaterStatus, then the value is decreased by IfNotMoreThenWaterRemoveOnCycle)
173
IfNotMoreThenWaterRemoveOnCycle = 20, -- The number of water is removed when the plant WaterStatus is lower then "WaterRemoveOnCycle" (line above).
174
-- Also it is a value that the plant must have to pass the loop to fertilizer (if the plantWater is lower then the value above, the plant won't get any quality aldo it has a fertilizer)
175
Statuses = {
176
[1] = {
177
MinimalFertilizerStatus = 90, -- The plant fertilizer value that a plant must have to be affected by this value
178
SetFertilizerStatusTo = 60, -- The value that the fertilizer status is set to.
179
QualityPointsAdd = 5, -- The quality points that are added to the Plant Status
180
},
181
[2] = {
182
MinimalFertilizerStatus = 70, -- The plant fertilizer value that a plant must have to be affected by this value
183
SetFertilizerStatusTo = 40, -- The value that the fertilizer status is set to.
184
QualityPointsAdd = 4, -- The quality points that are added to the Plant Status
185
},
186
[3] = {
187
MinimalFertilizerStatus = 50, -- The plant fertilizer value that a plant must have to be affected by this value
188
SetFertilizerStatusTo = 10, -- The value that the fertilizer status is set to.
189
QualityPointsAdd = 3, -- The quality points that are added to the Plant Status
190
},
191
[4] = {
192
MinimalFertilizerStatus = 30, -- The plant fertilizer value that a plant must have to be affected by this value
193
SetFertilizerStatusTo = 10, -- The value that the fertilizer status is set to.
194
QualityPointsAdd = 2, -- The quality points that are added to the Plant Status
195
}
196
},
197
198
Items = {
199
200
PlantItemName = "weed_seed", -- Item need to plant a weed in current zone
201
PlantWaterItem = "water", -- Item need to water a weed in current zone
202
PlantFertilizeItem = "fertilizer", -- Item needed to fertilize a weed in current zone
203
RewardItemName = "coke", -- The name of a item you will get after harvesting a weed plant
204
RewardItemCount = 200, -- The Number of item a player will get after harvesting a plant with 100% status and 100% Quality
205
RequiredItemsPlant = { -- Bellow will be listed items a player will need for planting this drug
206
{itemName = "water", count = 1, removeItem = true} -- itemName is the name from database, removeItem will remove the item from player inventory while planting
207
},
208
RequiredItemsHarvest = { -- Bellow will be listed items a player will need for harvesting this drug
209
{itemName = "water", count = 1, removeItem = false} -- itemName is the name from database, removeItem will remove the item from player inventory while harvesting
210
},
211
},
212
213
Props = {
214
SmallProp = "prop_weed_02", -- The obejct name of the plant that will be crated after a plant is planted
215
BigProp = "prop_weed_01", -- The object name of the plant that the first (SmalProp) will be replaced for after it reaches the ChangePropsAfterStatus
216
ChangePropsAfterStatus = 50 -- The amount of status points from 100% that if a plant reaches then the plant prop (SmallProp) will be replaced to BigProp (Set it to -1 to never replace a prop for this location)
217
},
218
219
FertilizerAddAmount = 10.0, -- The number of fertilizer points that will be added on every cycle
220
WaterAddAmount = 10.0 -- The number of water points that will be added on every cycle
221
}
222
-- Bellow you can add more location, the index must be pervious index + 1
223
}
224
225
226
Config.DrawMarkerDistance = 5.0 -- The distance, from which you will see the markers (for performance reasons it is good to keep it bigger then 3DTextDistance)
227
Config.Draw3DTextDistance = 2.0
228
Config.Drugs = {}
229
Config.HelpStringForPickup = "~INPUT_PICKUP~ Pickup"
230
Config.HelpStringForProcess = "~INPUT_PICKUP~ Process"
231
Config.Drugs.joint = { -- Make sure that the drug name is in lower, otherwise it will not work
232
Zones = {
233
Collect = {
234
Location = vector3(1534.2247,3696.3442,34.5528), -- The location of pickup point
235
Size = {x = 1.0, y = 1.0, z = 1.0}, -- Size of the marker
236
Color = {r = 255, g = 255, b = 0}, -- Color of the marker
237
MotionText = "[E] Pickup", -- Text that will be show when coming near in the DrawText3D section (if Draw3DText Enabled)
238
Action = "Collect", -- Just for collecting leave it
239
Marker = 22, -- Marker Id
240
UseInovativeMarkers = false, -- If the help text should look "different", image in the forum
241
DrawInovativeMarkersRadius = 5.0 -- The distance a player can see the marker from
242
},
243
Process = {
244
Location = vector3(1534.2247,3696.3442,40.5528), -- The location for pickup points
245
Size = {x = 1.0, y = 1.0, z = 1.0}, -- Size of the marker
246
Color = {r = 255, g = 255, b = 0}, -- Color of the marker
247
MotionText = "[E] Process", -- The text name that will be drawn on the screen if Drwa3D Text enabled
248
Action = "Process", -- For Processing just leave it as it is
249
Marker = 22, -- The marker ID
250
UseInovativeMarkers = false, -- If the help text should look "different", image in the forum
251
DrawInovativeMarkersRadius = 5.0 -- The distance a player can see the marker from
252
},
253
},
254
255
Actions = {
256
Collect = {
257
MinCops = 1, -- The minimal count of cops that must be online to player can be able to collect a item
258
RequiredItems = { -- Bellow will be listed items a player will need for Collecting
259
{itemName = "water", count = 1, removeItem = false} -- itemName is the name from database, removeItem will remove the item from player inventory after fininished collecting
260
},
261
GiveItem = "weed", -- The item a player should get when he is done
262
GiveItemCount = 1, -- The count of a item a player should get when he is done
263
Animations = { -- Animation properties are listed bellow
264
AnimDict = "[email protected]", -- The animation dictionary for Collecting animation
265
AnimName = "fixing_a_ped", -- The animation name for Collectiong anitamtion
266
Duration = 4000, -- Set to 0 to disable animations
267
AnimFlag = 1,
268
MythicProggbarLabel = "Harvesting Drug" -- The label which will be shown in the mythic progres bar
269
}
270
},
271
Process = {
272
MinCops = 1, -- Minimal cops from processing
273
RequiredItems = { -- Bellow you can list items a player will need for a processing
274
{itemName = "ocb", count = 1, removeItem = true} -- itemName is a name of the item in database and the removeItem is if a player should get remove this item
275
-- Also supports item called "money" and will use xPlayer.removeMoney, xPlayer.getMoney functions
276
},
277
GiveItem = "joint", -- The item a player should get
278
GiveItemCount = 1, -- The amount of the item a player should get after finishing Proccesing
279
Animations = { -- Bellow there will be listed animations
280
AnimDict = "[email protected]", -- Animation Dictionary for processing
281
AnimName = "fixing_a_ped", -- Animation name from processing
282
Duration = 4000, -- Set to 0 to disable animations
283
AnimFlag = 1,
284
MythicProggbarLabel = "Processing Drug" -- The label which should be displayed when processing
285
}
286
},
287
},
288
Effects = { -- Effects that current "drugs" should give
289
GiveHP = 1, -- Set to 0.0 to give no additinal HP
290
GiveArmour = 10, -- Set to 0.0 to not give armour
291
SetInfiniteStamina = true, -- If a player should get unlimited stamina when using current drug
292
SpeedMultiplier = 2.0, -- The speed multiplier that should be given to player when using this drug
293
OnUseScenario = "WORLD_HUMAN_SMOKING_POT", -- The screnario played after using a item (the scenarios can be found there: https://pastebin.com/6mrYTdQv)
294
MoveClipset = "[email protected]@VERYDRUNK", -- The MoveClipset that will be aplied to player after using a item https://docs.fivem.net/natives/?_0xAF8A94EDE7712BEF
295
MotionBlur = true, -- If a player should get a MotionBlur
296
SetPedDrunk = true, -- If a player should be set as a drunk
297
ClearTimeCycleModifier = true, -- IF the TimeCycleModifier should be reseted after the ResetAfter timeout is after
298
TimeCycleModifier = "spectator5", -- The TimeCycleModifier that will be used https://pastebin.com/kVPwMemE
299
ResetAfter = 5 -- Time in SECONDS when the stats should be reset
300
},
301
302
RemoveAfterUse = true -- Should be the drug removed on its use?
303
}
304