check
This commit is contained in:
1 parent
c6d8556c12
commit
bcdf71b17a
21 files changed
+394
-403
No files matched your search
+43
-10
@@ -1,10 +1,43 @@
|
||||
|
||||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
|
||||
GlobalState.WeedPlant = Config.WeedPlant
|
||||
local weedPlant = {
|
||||
{ location = vector3(1049.63, -3202.12, -39.15), heading = 334.49, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1050.85, -3202.15, -39.15), heading = 329.56, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1052.01, -3202.22, -39.13), heading = 25.16, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1052.99, -3202.15, -39.15), heading = 21.52, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1053.08, -3201.11, -39.13), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1052.91, -3199.99, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1053.02, -3198.97, -39.11), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1051.95, -3198.93, -39.11), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1051.96, -3199.86, -39.12), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1051.93, -3201.17, -39.12), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1050.98, -3201.13, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1050.89, -3200.07, -39.12), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1050.89, -3198.95, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1049.72, -3198.95, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1049.98, -3200.1, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1049.82, -3201.01, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1053.07, -3194.51, -39.15), heading = 334.49, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1052.97, -3195.55, -39.15), heading = 329.56, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1052.82, -3196.58, -39.15), heading = 25.16, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1052.94, -3197.59, -39.15), heading = 21.52, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1051.92, -3197.54, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1051.88, -3196.61, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1051.82, -3195.52, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1051.95, -3194.38, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1050.88, -3194.31, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1050.78, -3195.29, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1050.76, -3196.49, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1050.77, -3197.62, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1049.64, -3197.61, -39.14), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1049.64, -3196.59, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1049.62, -3195.51, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
|
||||
{ location = vector3(1049.66, -3194.36, -39.15), heading = 202.97, model = "bkr_prop_weed_lrg_01b"},
|
||||
}
|
||||
GlobalState.WeedPlant = weedPlant
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
for _, v in pairs(Config.WeedPlant) do
|
||||
for _, v in pairs(weedPlant) do
|
||||
v.taken = false
|
||||
end
|
||||
end)
|
||||
@@ -12,23 +45,23 @@ end)
|
||||
function WeedCooldown(loc)
|
||||
CreateThread(function()
|
||||
Wait(Config.respawnTime * 1000)
|
||||
Config.WeedPlant[loc].taken = false
|
||||
GlobalState.WeedPlant = Config.WeedPlant
|
||||
weedPlant[loc].taken = false
|
||||
GlobalState.WeedPlant = weedPlant
|
||||
Wait(1000)
|
||||
TriggerClientEvent('weed:respawnCane', -1, loc)
|
||||
Log('Weed Plant Respawned At ' .. Config.WeedPlant[loc].location, 'weed')
|
||||
Log('Weed Plant Respawned At ' .. weedPlant[loc].location, 'weed')
|
||||
end)
|
||||
end
|
||||
|
||||
RegisterNetEvent("weed:pickupCane", function(loc)
|
||||
local src = source
|
||||
if not Config.WeedPlant[loc].taken then
|
||||
Config.WeedPlant[loc].taken = true
|
||||
GlobalState.WeedPlant = Config.WeedPlant
|
||||
if not weedPlant[loc].taken then
|
||||
weedPlant[loc].taken = true
|
||||
GlobalState.WeedPlant = weedPlant
|
||||
TriggerClientEvent("weed:removeCane", -1, loc)
|
||||
WeedCooldown(loc)
|
||||
AddItem(src, 'wetcannabis', 1)
|
||||
Log(GetName(source) .. ' Picked Weed With a distance of ' .. dist(source, Config.WeedPlant[loc].location) .. ' vectors', 'weed')
|
||||
Log(GetName(source) .. ' Picked Weed With a distance of ' .. dist(source, weedPlant[loc].location) .. ' vectors', 'weed')
|
||||
end
|
||||
end)
|
||||
--------------- events
|
||||
|
||||
Reference in new issue
Block a user