check
This commit is contained in:
1 parent
c6d8556c12
commit
bcdf71b17a
21 files changed
+394
-403
No files matched your search
+29
-11
@@ -1,8 +1,26 @@
|
||||
local QBCore = exports['qb-core']:GetCoreObject()
|
||||
GlobalState.Mescaline = Config.Mescaline
|
||||
|
||||
local m = {
|
||||
{ location = vector3(2598.73, 4207.89, 41.02), heading = 334.49, model = "prop_cactus_03"},
|
||||
{ location = vector3(2601.46, 4199.34, 40.62), heading = 329.56, model = "prop_cactus_03"},
|
||||
{ location = vector3(2611.63, 4194.18, 41.18), heading = 25.16, model = "prop_cactus_03"},
|
||||
{ location = vector3(2620.18, 4202.69, 41.5), heading = 21.52, model = "prop_cactus_03"},
|
||||
{ location = vector3(2624.26, 4211.75, 42.34), heading = 334.49, model = "prop_cactus_03"},
|
||||
{ location = vector3(2635.21, 4207.5, 42.49), heading = 329.56, model = "prop_cactus_03"},
|
||||
{ location = vector3(2644.97, 4193.51, 42.11), heading = 25.16, model = "prop_cactus_03"},
|
||||
{ location = vector3(2654.21, 4195.31, 41.23), heading = 21.52, model = "prop_cactus_03"},
|
||||
{ location = vector3(2653.32, 4206.49, 41.62), heading = 334.49, model = "prop_cactus_03"},
|
||||
{ location = vector3(2647.45, 4213.94, 42.49), heading = 329.56, model = "prop_cactus_03"},
|
||||
{ location = vector3(2636.3, 4218.49, 43.03), heading = 25.16, model = "prop_cactus_03"},
|
||||
{ location = vector3(2627.37, 4223.2, 42.88), heading = 21.52, model = "prop_cactus_03"},
|
||||
{ location = vector3(2617.86, 4230.38, 42.63), heading = 21.52, model = "prop_cactus_03"},
|
||||
{ location = vector3(2609.8, 4222.12, 41.19), heading = 21.52, model = "prop_cactus_03"},
|
||||
{ location = vector3(2602.96, 4194.05, 41.01), heading = 21.52, model = "prop_cactus_03"},
|
||||
{ location = vector3(2614.39, 4188.3, 41.68), heading = 21.52, model = "prop_cactus_03"},
|
||||
{ location = vector3(2623.82, 4189.97, 41.44), heading = 21.52, model = "prop_cactus_03"},
|
||||
}
|
||||
Citizen.CreateThread(function()
|
||||
for _, v in pairs(Config.Mescaline) do
|
||||
for _, v in pairs(m) do
|
||||
v.taken = false
|
||||
end
|
||||
end)
|
||||
@@ -10,29 +28,29 @@ end)
|
||||
function MescalineCooldown(loc)
|
||||
CreateThread(function()
|
||||
Wait(Config.respawnTime * 1000)
|
||||
Config.Mescaline[loc].taken = false
|
||||
GlobalState.Mescaline = Config.Mescaline
|
||||
Wait(1000)
|
||||
m[loc].taken = false
|
||||
GlobalState.Mescaline = m
|
||||
TriggerClientEvent('Mescaline:respawnCane', -1, loc)
|
||||
Log('Cactus Respawned At ' .. Config.Mescaline[loc].location, 'mescaline')
|
||||
Log('Cactus Respawned At ' ..m[loc].location, 'mescaline')
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
RegisterNetEvent("Mescaline:pickupCane", function(loc)
|
||||
if CheckDist(source, Config.Mescaline[loc].location) then return end
|
||||
if not Config.Mescaline[loc].taken then
|
||||
Config.Mescaline[loc].taken = true
|
||||
GlobalState.Mescaline = Config.Mescaline
|
||||
if CheckDist(source, m[loc].location) then return end
|
||||
if not m[loc].taken then
|
||||
m[loc].taken = true
|
||||
GlobalState.Mescaline = m
|
||||
TriggerClientEvent("Mescaline:removeCane", -1, loc)
|
||||
MescalineCooldown(loc)
|
||||
AddItem(source,'cactusbulb', 1)
|
||||
Log(GetName(source) .. ' Picked Cactus Bulbs With a distance of ' .. dist(source, Config.Mescaline[loc].location) .. ' vectors', 'mescaline')
|
||||
Log(GetName(source) .. ' Picked Cactus Bulbs With a distance of ' .. dist(source, m[loc].location) .. ' vectors', 'mescaline')
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent("md-drugs:server:drymescaline", function()
|
||||
local src = source
|
||||
if not checkLoc(src, 'singleSpot', 'DryOut') then return end
|
||||
if not GetRecipe(src, 'mescaline', 'dry', 'dried') then return end
|
||||
Log(GetName(source) .. ' Dried Mescaline', 'mescaline')
|
||||
end)
|
||||
|
||||
Reference in new issue
Block a user