finished locales EN
This commit is contained in:
1 parent
37f86bf50d
commit
683eaff7de
46 files changed
+965
-1049
No files matched your search
+38
-23
@@ -1,33 +1,48 @@
|
||||
local isActive = false
|
||||
local dealer = {}
|
||||
|
||||
RegisterNetEvent('md-drugs:client:opendealermenu', function()
|
||||
local rep = GetRep()
|
||||
makeMenu('dealermenu', rep)
|
||||
lib.showContext('dealermenu')
|
||||
end)
|
||||
|
||||
local function SpawnDealer()
|
||||
local getDealers = ps.callback('md-drugs:server:getDealers')
|
||||
for k,v in pairs(getDealers) do
|
||||
local Ped = "g_m_y_famdnf_01"
|
||||
lib.requestModel(Ped, Config.RequestModelTime)
|
||||
ps.requestModel(Ped, Config.RequestModelTime)
|
||||
local loc = json.decode(v.coords)
|
||||
dealer[k] = CreatePed(0, Ped,loc.x,loc.y, loc.z-1, loc.h, false, false)
|
||||
Freeze(dealer[k], true, loc.h)
|
||||
AddMultiModel(dealer[k], {
|
||||
{ icon = 'fas fa-user-secret', label = string.format(Lang.targets.Delivery.Deliver, v.name),
|
||||
action = function()
|
||||
local bool, item, amount, coords = ps.callback('md-drugs:server:GetDeliveryItem', false, k)
|
||||
if bool then
|
||||
Email(Lang.Delivery.emailn, Lang.Delivery.emailsub, string.format(Lang.Delivery.emailcon, amount, GetLabel(item)))
|
||||
TriggerEvent('md-drugs:client:setLocation', {bool = bool, item = item, amount = amount, coords = coords})
|
||||
end
|
||||
end,
|
||||
},
|
||||
{ icon = "fa-solid fa-store", label = string.format(Lang.targets.Delivery.open, v.name),
|
||||
action = function() TriggerEvent('md-drugs:client:opendealermenu') end,
|
||||
}}, dealer[k])
|
||||
ps.entityTarget(dealer[k], {
|
||||
{
|
||||
icon = 'fas fa-user-secret',
|
||||
label = ps.lang('Deliveries.targetGetDel'),
|
||||
action = function()
|
||||
local bool, item, amount, coords = ps.callback('md-drugs:server:GetDeliveryItem', false, k)
|
||||
if bool then
|
||||
TriggerEvent('md-drugs:client:setLocation', {bool = bool, item = item, amount = amount, coords = coords})
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
icon = "fa-solid fa-store",
|
||||
label = ps.lang('Deliveries.targetOpenShop'),
|
||||
action = function()
|
||||
local rep = GetRep()
|
||||
local items = ps.callback('md-drugs:server:dealerList')
|
||||
local options = {}
|
||||
for m, d in pairs (items) do
|
||||
if rep.dealerrep >= d.minrep then
|
||||
options[#options+1] = {
|
||||
title = ps.getLabel(d.name),
|
||||
description = '$' .. d.price,
|
||||
icon = ps.getImage(d.name),
|
||||
action = function()
|
||||
TriggerServerEvent('md-drugs:server:buyItemDealer', m)
|
||||
end,
|
||||
}
|
||||
end
|
||||
end
|
||||
ps.menu(ps.lang('Deliveries.shopHeader'), ps.lang('Deliveries.shopHeader'), options)
|
||||
end,
|
||||
}
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
@@ -46,11 +61,11 @@ RegisterNetEvent('md-drugs:client:setLocation', function(data)
|
||||
isActive = true
|
||||
local Buyer = CreatePed(0, "g_m_y_famdnf_01",coord.x, coord.y, coord.z-1, coord.w, false, false)
|
||||
Freeze(Buyer, true, coord.w)
|
||||
AddSingleModel(Buyer, {
|
||||
ps.entityTarget(Buyer, {
|
||||
icon = 'fas fa-user-secret',
|
||||
label = Lang.targets.Delivery.hand,
|
||||
label = ps.lang('Deliveries.targetHandOff'),
|
||||
action = function()
|
||||
if not progressbar(Lang.Delivery.pack, 4000, 'uncuff') then return end
|
||||
if not progressbar(ps.lang('Deliveries.delivering'), 4000, 'uncuff') then return end
|
||||
isActive = false
|
||||
DeletePed(Buyer)
|
||||
TriggerServerEvent('md-drugs:server:giveDeliveryItems', data.item, data.amount)
|
||||
|
||||
Reference in new issue
Block a user