- hush hush
This commit is contained in:
1 parent
4fdef3cf30
commit
a86a342f4d
17 files changed
+252
-432
No files matched your search
@@ -1,47 +1,4 @@
|
||||
local Mescaline = {}
|
||||
|
||||
local function pick(loc)
|
||||
if not progressbar(Lang.mescaline.pick, 4000, 'uncuff') then return end
|
||||
TriggerServerEvent("Mescaline:pickupCane", loc)
|
||||
end
|
||||
|
||||
RegisterNetEvent('Mescaline:respawnCane', function(loc)
|
||||
local v = GlobalState.Mescaline[loc]
|
||||
local hash = GetHashKey(v.model)
|
||||
if not Mescaline[loc] then
|
||||
Mescaline[loc] = CreateObject(hash, v.location, false, true, true)
|
||||
Freeze(Mescaline[loc], true, v.heading)
|
||||
AddSingleModel(Mescaline[loc], {icon = "fa-solid fa-seedling",label = Lang.targets.mescaline.pick, action = function() pick(loc) end}, loc )
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent('Mescaline:removeCane', function(loc)
|
||||
if DoesEntityExist(Mescaline[loc]) then DeleteEntity(Mescaline[loc]) end
|
||||
Mescaline[loc] = nil
|
||||
end)
|
||||
|
||||
RegisterNetEvent("Mescaline:init", function()
|
||||
for k, v in pairs (GlobalState.Mescaline) do
|
||||
local hash = GetHashKey(v.model)
|
||||
if not HasModelLoaded(hash) then LoadModel(hash) end
|
||||
if not v.taken then
|
||||
Mescaline[k] = CreateObject(hash, v.location.x, v.location.y, v.location.z, false, true, true)
|
||||
Freeze(Mescaline[k], true, v.heading)
|
||||
AddSingleModel(Mescaline[k], {icon = "fa-solid fa-seedling",label = Lang.targets.mescaline.pick,action = function() pick(k) end}, k)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
AddEventHandler('onResourceStop', function(resourceName)
|
||||
if GetCurrentResourceName() == resourceName then
|
||||
SetModelAsNoLongerNeeded(GetHashKey('prop_cactus_03'))
|
||||
for k, v in pairs(Mescaline) do
|
||||
if DoesEntityExist(v) then
|
||||
DeleteEntity(v) SetEntityAsNoLongerNeeded(v)
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent("md-drugs:client:drymescaline", function()
|
||||
if not ItemCheck('cactusbulb') then return end
|
||||
|
||||
Reference in new issue
Block a user