big update. i prob broke something, let me know in discord
This commit is contained in:
1 parent
009b0a4f4a
commit
028c5f771f
42 files changed
+2042
-3056
No files matched your search
+10
-25
@@ -21,43 +21,28 @@ function MescalineCooldown(loc)
|
||||
end
|
||||
|
||||
|
||||
|
||||
RegisterNetEvent("Mescaline:pickupCane")
|
||||
AddEventHandler("Mescaline:pickupCane", function(loc)
|
||||
local playerPed = GetPlayerPed(source)
|
||||
if CheckDist(source, playerPed, Config.Mescaline[loc].location) then 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
|
||||
TriggerClientEvent("Mescaline:removeCane", -1, loc)
|
||||
MescalineCooldown(loc)
|
||||
local Player = QBCore.Functions.GetPlayer(source)
|
||||
AddItem('cactusbulb', 1)
|
||||
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Picked Cactus Bulbs With a distance of ' .. dist(source, playerPed, Config.Mescaline[loc].location) .. ' vectors', 'mescaline')
|
||||
AddItem(source,'cactusbulb', 1)
|
||||
Log(GetName(source) .. ' Picked Cactus Bulbs With a distance of ' .. dist(source, Config.Mescaline[loc].location) .. ' vectors', 'mescaline')
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
|
||||
RegisterNetEvent("md-drugs:server:drymescaline")
|
||||
AddEventHandler("md-drugs:server:drymescaline", function()
|
||||
local src = source
|
||||
local Player = QBCore.Functions.GetPlayer(src)
|
||||
|
||||
if RemoveItem("cactusbulb", 1) then
|
||||
AddItem("driedmescaline", 1)
|
||||
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Dried Mescaline', 'mescaline')
|
||||
else
|
||||
Notifys(Lang.mescaline.nocactus, "error")
|
||||
end
|
||||
RegisterNetEvent("md-drugs:server:drymescaline", function()
|
||||
local src = source
|
||||
if not GetRecipe(src, 'mescaline', 'dry', 'dried') then return end
|
||||
Log(GetName(source) .. ' Dried Mescaline', 'mescaline')
|
||||
end)
|
||||
|
||||
QBCore.Functions.CreateUseableItem("driedmescaline", function(source, item)
|
||||
local src = source
|
||||
local Player = QBCore.Functions.GetPlayer(src)
|
||||
|
||||
if Player.Functions.RemoveItem("driedmescaline", 1) then
|
||||
if RemoveItem(src, "driedmescaline", 1) then
|
||||
TriggerClientEvent("md-drugs:client:takemescaline", src)
|
||||
Log(Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname .. ' Consumed Mescaline', 'consume')
|
||||
Log(GetName(source) .. ' Consumed Mescaline', 'consume')
|
||||
end
|
||||
end)
|
||||
Reference in new issue
Block a user