test test

This commit is contained in:
Mustache Dom committed 2024-10-23 16:04:09 -07:00
1 parent ca2a9205b0
commit fefd53857e
7 files changed
+109 -93

No files matched your search

+13 -21
View File
@@ -7,7 +7,7 @@ local function sellDrug(item, amount, price, targ)
PoliceCall(20)
targbusy = true
if IsPedInAnyVehicle(PlayerPedId(), true) then
Notify('STRANGER DANGER, I WONT GET IN THE CAR WITH YOU', 'error')
Notify(Lang.Cornerselling.inveh, 'error')
FreezeEntityPosition(targ, false)
ClearPedTasks(targ)
Wait(10000)
@@ -16,7 +16,7 @@ local function sellDrug(item, amount, price, targ)
sold = true
sell = false
return end
if not progressbar('Selling ' .. GetLabel(item) .. '!', 4000, 'uncuff') then return end
if not progressbar(string.format(Lang.Cornerselling.selling, GetLabel(item), price), 4000, 'uncuff') then return end
TriggerServerEvent('md-drugs:server:sellCornerDrugs', item, amount, price)
FreezeEntityPosition(targ, false)
ClearPedTasks(targ)
@@ -29,7 +29,7 @@ local function sellDrug(item, amount, price, targ)
local function deny(targ)
PoliceCall(20)
targbusy = true
if not progressbar('Telling This Dumbass To Leave!', 4000, 'argue5') then return end
if not progressbar(Lang.Cornerselling.deny, 4000, 'argue5') then return end
FreezeEntityPosition(targ, false)
ClearPedTasks(targ)
Wait(10000)
@@ -50,25 +50,17 @@ function Cornersell()
TaskStartScenarioInPlace(targ, "WORLD_HUMAN_STAND_IMPATIENT_UPRIGHT", 0, false)
FreezeEntityPosition(targ, true)
local item, amount, price = lib.callback.await('md-drugs:server:cornerselling:getAvailableDrugs', false)
if item == 'nothing' then Notify(' You Aint Got Shit', 'error') sell = false FreezeEntityPosition(targ, false) ClearPedTasks(targ) return false end
if item == 'nothing' then Notify(Lang.Cornerselling.nodrugs, 'error') sell = false FreezeEntityPosition(targ, false) ClearPedTasks(targ) return false end
local options = {
{ label = 'Sell ' .. amount .. ' Of ' .. GetLabel(item) .. ' For $' .. price .. '!', icon = "fas fa-eye",
action = function()
sellDrug(item, amount, price, targ)
end,
onSelect = function()
sellDrug(item, amount, price, targ)
end,
{ label = string.format(Lang.Targets.CornerSell.sell, amount, GetLabel(item), price), icon = "fas fa-eye",
action = function() sellDrug(item, amount, price, targ) end,
onSelect = function() sellDrug(item, amount, price, targ) end,
canInteract = function()
if not targbusy then return true end end,
},
{ label = 'Deny Price', icon = "fas fa-eye",
action = function()
deny(targ)
end,
onSelect = function()
deny(targ)
end,
{ label = Lang.targets.CornerSell.deny, icon = "fas fa-eye",
action = function() deny(targ) end,
onSelect = function() deny(targ) end,
canInteract = function()
if not targbusy then return true end end,
},
@@ -85,18 +77,18 @@ RegisterNetEvent('md-drugs:client:cornerselling', function()
local item, amount, price = lib.callback.await('md-drugs:server:cornerselling:getAvailableDrugs', false)
if item ~= 'nothing' then
if sell then
Notify('Lazy Ass Cant Even Sell Drugs', 'error')
Notify(Lang.Cornerselling.stop, 'error')
sell = false
else
sell = true
Notify('Go Make That Paper', 'success')
Notify(Lang.Cornerselling.start, 'success')
repeat
Wait(1000)
if not Cornersell() then end
until sell == false
end
else
Notify('You Cant Sell Air', 'error')
Notify(Lang.Cornerselling.nodrugs, 'error')
end
end)