mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-28 17:01:14 +00:00
Merge branch 'develop' into locale-update
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
patreon: esx
|
||||
ko_fi: esxframework
|
||||
custom: https://esx-framework.tebex.io
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
AddEventHandler('esx:getSharedObject', function(cb)
|
||||
local Invoke = GetInvokingResource()
|
||||
print(('[^3WARNING^7] ^5%s^7 used ^5esx:getSharedObject^7, this method is deprecated and should not be used! Refer to ^5https://docs.esx-framework.org/tutorials/sharedevent^7 for more info!'):format(Invoke))
|
||||
cb(ESX)
|
||||
end)
|
||||
|
||||
exports('getSharedObject', function()
|
||||
return ESX
|
||||
end)
|
||||
|
||||
@@ -1088,22 +1088,26 @@ end
|
||||
|
||||
function ESX.ShowInventory()
|
||||
local playerPed = ESX.PlayerData.ped
|
||||
local elements, currentWeight = {}, 0
|
||||
local elements = {
|
||||
{unselectable = true, icon = 'fas fa-box', title = 'Player Inventory'}
|
||||
}
|
||||
local currentWeight = 0
|
||||
|
||||
for i=1, #(ESX.PlayerData.accounts) do
|
||||
if ESX.PlayerData.accounts[i].money > 0 then
|
||||
local formattedMoney = TranslateCap('locale_currency', ESX.Math.GroupDigits(ESX.PlayerData.accounts[i].money))
|
||||
local canDrop = ESX.PlayerData.accounts[i].name ~= 'bank'
|
||||
|
||||
table.insert(elements, {
|
||||
label = ('%s: <span style="color:green;">%s</span>'):format(ESX.PlayerData.accounts[i].label, formattedMoney),
|
||||
elements[#elements+1] = {
|
||||
icon = 'fas fa-money-bill-wave',
|
||||
title = ('%s: <span style="color:green;">%s</span>'):format(ESX.PlayerData.accounts[i].label, formattedMoney),
|
||||
count = ESX.PlayerData.accounts[i].money,
|
||||
type = 'item_account',
|
||||
value = ESX.PlayerData.accounts[i].name,
|
||||
usable = false,
|
||||
rare = false,
|
||||
canRemove = canDrop
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1111,15 +1115,16 @@ function ESX.ShowInventory()
|
||||
if v.count > 0 then
|
||||
currentWeight = currentWeight + (v.weight * v.count)
|
||||
|
||||
table.insert(elements, {
|
||||
label = ('%s x%s'):format(v.label, v.count),
|
||||
elements[#elements+1] = {
|
||||
icon = 'fas fa-box',
|
||||
title = ('%s x%s'):format(v.label, v.count),
|
||||
count = v.count,
|
||||
type = 'item_standard',
|
||||
value = v.name,
|
||||
usable = v.usable,
|
||||
rare = v.rare,
|
||||
canRemove = v.canRemove
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1135,8 +1140,9 @@ function ESX.ShowInventory()
|
||||
label = v.label
|
||||
end
|
||||
|
||||
table.insert(elements, {
|
||||
label = label,
|
||||
elements[#elements+1] = {
|
||||
icon = 'fas fa-gun',
|
||||
title = label,
|
||||
count = 1,
|
||||
type = 'item_weapon',
|
||||
value = v.name,
|
||||
@@ -1145,76 +1151,80 @@ function ESX.ShowInventory()
|
||||
ammo = ammo,
|
||||
canGiveAmmo = (v.ammo ~= nil),
|
||||
canRemove = true
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
ESX.UI.Menu.CloseAll()
|
||||
elements[#elements+1] = {
|
||||
unselectable = true,
|
||||
icon = "fas fa-weight",
|
||||
title = "Current Weight: "..currentWeight
|
||||
}
|
||||
|
||||
ESX.CloseContext()
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'inventory', {
|
||||
title = TranslateCap('inventory', currentWeight, ESX.PlayerData.maxWeight),
|
||||
align = 'bottom-right',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
menu.close()
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local player, distance = ESX.Game.GetClosestPlayer()
|
||||
elements = {}
|
||||
|
||||
if data.current.usable then
|
||||
table.insert(elements, {
|
||||
label = TranslateCap('use'),
|
||||
elements2 = {}
|
||||
|
||||
if element.usable then
|
||||
elements2[#elements2+1] = {
|
||||
icon = "fas fa-utensils",
|
||||
title = TranslateCap('use'),
|
||||
action = 'use',
|
||||
type = data.current.type,
|
||||
value = data.current.value
|
||||
})
|
||||
type = element.type,
|
||||
value = element.value
|
||||
}
|
||||
end
|
||||
|
||||
if data.current.canRemove then
|
||||
if element.canRemove then
|
||||
if player ~= -1 and distance <= 3.0 then
|
||||
table.insert(elements, {
|
||||
label = TranslateCap('give'),
|
||||
elements2[#elements2+1] = {
|
||||
icon = "fas fa-hands",
|
||||
title = TranslateCap('give'),
|
||||
action = 'give',
|
||||
type = data.current.type,
|
||||
value = data.current.value
|
||||
})
|
||||
type = element.type,
|
||||
value = element.value
|
||||
}
|
||||
end
|
||||
|
||||
table.insert(elements, {
|
||||
label = TranslateCap('remove'),
|
||||
elements2[#elements2+1] = {
|
||||
icon = "fas fa-trash",
|
||||
title = TranslateCap('remove'),
|
||||
action = 'remove',
|
||||
type = data.current.type,
|
||||
value = data.current.value
|
||||
})
|
||||
type = element.type,
|
||||
value = element.value
|
||||
}
|
||||
end
|
||||
|
||||
if data.current.type == 'item_weapon' and data.current.canGiveAmmo and data.current.ammo > 0 and player ~= -1 and
|
||||
distance <= 3.0 then
|
||||
table.insert(elements, {
|
||||
label = TranslateCap('giveammo'),
|
||||
if element.type == 'item_weapon' and element.canGiveAmmo and element.ammo > 0 and player ~= -1 and distance <= 3.0 then
|
||||
elements2[#elements2+1] = {
|
||||
icon = "fas fa-gun",
|
||||
title = TranslateCap('giveammo'),
|
||||
action = 'give_ammo',
|
||||
type = data.current.type,
|
||||
value = data.current.value
|
||||
})
|
||||
type = element.type,
|
||||
value = element.value
|
||||
}
|
||||
end
|
||||
|
||||
table.insert(elements, {
|
||||
label = TranslateCap('return'),
|
||||
elements2[#elements2+1] = {
|
||||
icon = "fas fa-arrow-left",
|
||||
title = TranslateCap('return'),
|
||||
action = 'return'
|
||||
})
|
||||
}
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'inventory_item', {
|
||||
title = data.current.label,
|
||||
align = 'bottom-right',
|
||||
elements = elements
|
||||
}, function(data1, menu1)
|
||||
local item, type = data1.current.value, data1.current.type
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local item, type = element2.value, element2.type
|
||||
|
||||
if data1.current.action == 'give' then
|
||||
if element2.action == "give" then
|
||||
local playersNearby = ESX.Game.GetPlayersInArea(GetEntityCoords(playerPed), 3.0)
|
||||
|
||||
if #playersNearby > 0 then
|
||||
local players = {}
|
||||
elements = {}
|
||||
elements3 = {
|
||||
{unselectable = true, icon = "fas fa-users", title = "Nearby Players"}
|
||||
}
|
||||
|
||||
for k, playerNearby in ipairs(playersNearby) do
|
||||
players[GetPlayerServerId(playerNearby)] = true
|
||||
@@ -1222,19 +1232,15 @@ function ESX.ShowInventory()
|
||||
|
||||
ESX.TriggerServerCallback('esx:getPlayerNames', function(returnedPlayers)
|
||||
for playerId, playerName in pairs(returnedPlayers) do
|
||||
table.insert(elements, {
|
||||
label = playerName,
|
||||
elements3[#elements3+1] = {
|
||||
icon = "fas fa-user",
|
||||
title = playerName,
|
||||
playerId = playerId
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'give_item_to', {
|
||||
title = TranslateCap('give_to'),
|
||||
align = 'bottom-right',
|
||||
elements = elements
|
||||
}, function(data2, menu2)
|
||||
local selectedPlayer, selectedPlayerId = GetPlayerFromServerId(data2.current.playerId),
|
||||
data2.current.playerId
|
||||
ESX.OpenContext("right", elements3, function(menu3,element3)
|
||||
local selectedPlayer, selectedPlayerId = GetPlayerFromServerId(element3.playerId), element3.playerId
|
||||
playersNearby = ESX.Game.GetPlayersInArea(GetEntityCoords(playerPed), 3.0)
|
||||
playersNearby = ESX.Table.Set(playersNearby)
|
||||
|
||||
@@ -1244,62 +1250,58 @@ function ESX.ShowInventory()
|
||||
if IsPedOnFoot(selectedPlayerPed) and not IsPedFalling(selectedPlayerPed) then
|
||||
if type == 'item_weapon' then
|
||||
TriggerServerEvent('esx:giveInventoryItem', selectedPlayerId, type, item, nil)
|
||||
menu2.close()
|
||||
menu1.close()
|
||||
ESX.CloseContext()
|
||||
else
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(),
|
||||
'inventory_item_count_give', {
|
||||
title = TranslateCap('amount')
|
||||
}, function(data3, menu3)
|
||||
local quantity = tonumber(data3.value)
|
||||
local elementsG = {
|
||||
{unselectable = true, icon = "fas fa-trash", title = element.title},
|
||||
{icon = "fas fa-tally", title = "Amount.", input = true, inputType = "number", inputPlaceholder = "Amount to give..", inputMin = 1, inputMax = 1000},
|
||||
{icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
|
||||
}
|
||||
|
||||
if quantity and quantity > 0 and data.current.count >= quantity then
|
||||
TriggerServerEvent('esx:giveInventoryItem', selectedPlayerId, type,
|
||||
item, quantity)
|
||||
menu3.close()
|
||||
menu2.close()
|
||||
menu1.close()
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('amount_invalid'))
|
||||
end
|
||||
end, function(data3, menu3)
|
||||
menu3.close()
|
||||
end)
|
||||
ESX.OpenContext("right", elementsG, function(menuG,elementG)
|
||||
local quantity = tonumber(menuG.eles[2].inputValue)
|
||||
|
||||
if quantity and quantity > 0 and element.count >= quantity then
|
||||
TriggerServerEvent('esx:giveInventoryItem', selectedPlayerId, type, item, quantity)
|
||||
ESX.CloseContext()
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('amount_invalid'))
|
||||
end
|
||||
end)
|
||||
end
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('in_vehicle'))
|
||||
end
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('players_nearby'))
|
||||
menu2.close()
|
||||
ESX.CloseContext()
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end, players)
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('players_nearby'))
|
||||
end
|
||||
elseif data1.current.action == 'remove' then
|
||||
elseif element2.action == "remove" then
|
||||
if IsPedOnFoot(playerPed) and not IsPedFalling(playerPed) then
|
||||
local dict, anim = 'weapons@first_person@aim_rng@generic@projectile@sticky_bomb@', 'plant_floor'
|
||||
ESX.Streaming.RequestAnimDict(dict)
|
||||
|
||||
if type == 'item_weapon' then
|
||||
menu1.close()
|
||||
ESX.CloseContext()
|
||||
TaskPlayAnim(playerPed, dict, anim, 8.0, 1.0, 1000, 16, 0.0, false, false, false)
|
||||
RemoveAnimDict(dict)
|
||||
Wait(1000)
|
||||
TriggerServerEvent('esx:removeInventoryItem', type, item)
|
||||
else
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'inventory_item_count_remove', {
|
||||
title = TranslateCap('amount')
|
||||
}, function(data2, menu2)
|
||||
local quantity = tonumber(data2.value)
|
||||
local elementsR = {
|
||||
{unselectable = true, icon = "fas fa-trash", title = element.title},
|
||||
{icon = "fas fa-tally", title = "Amount.", input = true, inputType = "number", inputPlaceholder = "Amount to remove..", inputMin = 1, inputMax = 1000},
|
||||
{icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
|
||||
}
|
||||
|
||||
if quantity and quantity > 0 and data.current.count >= quantity then
|
||||
menu2.close()
|
||||
menu1.close()
|
||||
ESX.OpenContext("right", elementsR, function(menuR,elementR)
|
||||
local quantity = tonumber(menuR.eles[2].inputValue)
|
||||
|
||||
if quantity and quantity > 0 and element.count >= quantity then
|
||||
ESX.CloseContext()
|
||||
TaskPlayAnim(playerPed, dict, anim, 8.0, 1.0, 1000, 16, 0.0, false, false, false)
|
||||
RemoveAnimDict(dict)
|
||||
Wait(1000)
|
||||
@@ -1307,17 +1309,16 @@ function ESX.ShowInventory()
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('amount_invalid'))
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end
|
||||
end
|
||||
elseif data1.current.action == 'use' then
|
||||
elseif element2.action == "use" then
|
||||
ESX.CloseContext()
|
||||
TriggerServerEvent('esx:useItem', item)
|
||||
elseif data1.current.action == 'return' then
|
||||
ESX.UI.Menu.CloseAll()
|
||||
elseif element2.action == "return" then
|
||||
ESX.CloseContext()
|
||||
ESX.ShowInventory()
|
||||
elseif data1.current.action == 'give_ammo' then
|
||||
elseif element2.action == "give_ammo" then
|
||||
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
|
||||
local closestPed = GetPlayerPed(closestPlayer)
|
||||
local pedAmmo = GetAmmoInPedWeapon(playerPed, joaat(item))
|
||||
@@ -1325,25 +1326,25 @@ function ESX.ShowInventory()
|
||||
if IsPedOnFoot(closestPed) and not IsPedFalling(closestPed) then
|
||||
if closestPlayer ~= -1 and closestDistance < 3.0 then
|
||||
if pedAmmo > 0 then
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'inventory_item_count_give', {
|
||||
title = TranslateCap('amountammo')
|
||||
}, function(data2, menu2)
|
||||
local quantity = tonumber(data2.value)
|
||||
local elementsGA = {
|
||||
{unselectable = true, icon = "fas fa-trash", title = element.title},
|
||||
{icon = "fas fa-tally", title = "Amount.", input = true, inputType = "number", inputPlaceholder = "Amount to give..", inputMin = 1, inputMax = 1000},
|
||||
{icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elementsGA, function(menuGA,elementGA)
|
||||
local quantity = tonumber(menuGA.eles[2].inputValue)
|
||||
|
||||
if quantity and quantity > 0 then
|
||||
if pedAmmo >= quantity then
|
||||
TriggerServerEvent('esx:giveInventoryItem', GetPlayerServerId(closestPlayer),
|
||||
'item_ammo', item, quantity)
|
||||
menu2.close()
|
||||
menu1.close()
|
||||
TriggerServerEvent('esx:giveInventoryItem', GetPlayerServerId(closestPlayer), 'item_ammo', item, quantity)
|
||||
ESX.CloseContext()
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('noammo'))
|
||||
end
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('amount_invalid'))
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('noammo'))
|
||||
@@ -1355,12 +1356,7 @@ function ESX.ShowInventory()
|
||||
ESX.ShowNotification(TranslateCap('in_vehicle'))
|
||||
end
|
||||
end
|
||||
end, function(data1, menu1)
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.ShowInventory()
|
||||
end)
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
@@ -250,9 +250,7 @@ if not Config.OxInventory then
|
||||
ESX.UI.ShowInventoryItemNotification(true, item, count)
|
||||
end
|
||||
|
||||
if ESX.UI.Menu.IsOpen('default', 'es_extended', 'inventory') then
|
||||
ESX.ShowInventory()
|
||||
end
|
||||
ESX.ShowInventory()
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx:removeInventoryItem')
|
||||
@@ -269,9 +267,7 @@ if not Config.OxInventory then
|
||||
ESX.UI.ShowInventoryItemNotification(false, item, count)
|
||||
end
|
||||
|
||||
if ESX.UI.Menu.IsOpen('default', 'es_extended', 'inventory') then
|
||||
ESX.ShowInventory()
|
||||
end
|
||||
ESX.ShowInventory()
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx:addWeapon')
|
||||
@@ -438,32 +434,11 @@ function StartServerSyncLoops()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
-- sync current player coords with server
|
||||
CreateThread(function()
|
||||
local previousCoords = vector3(ESX.PlayerData.coords.x, ESX.PlayerData.coords.y, ESX.PlayerData.coords.z)
|
||||
|
||||
while ESX.PlayerLoaded do
|
||||
local playerPed = PlayerPedId()
|
||||
if ESX.PlayerData.ped ~= playerPed then ESX.SetPlayerData('ped', playerPed) end
|
||||
|
||||
if DoesEntityExist(ESX.PlayerData.ped) then
|
||||
local playerCoords = GetEntityCoords(ESX.PlayerData.ped)
|
||||
local distance = #(playerCoords - previousCoords)
|
||||
|
||||
if distance > 1 then
|
||||
previousCoords = playerCoords
|
||||
TriggerServerEvent('esx:updateCoords')
|
||||
end
|
||||
end
|
||||
Wait(1500)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
if not Config.OxInventory and Config.EnableDefaultInventory then
|
||||
RegisterCommand('showinv', function()
|
||||
if not ESX.PlayerData.dead and not ESX.UI.Menu.IsOpen('default', 'es_extended', 'inventory') then
|
||||
if not ESX.PlayerData.dead then
|
||||
ESX.ShowInventory()
|
||||
end
|
||||
end)
|
||||
@@ -700,8 +675,12 @@ AddEventHandler("esx:freezePlayer", function(input)
|
||||
end)
|
||||
|
||||
RegisterNetEvent("esx:GetVehicleType", function(Model, Request)
|
||||
if not IsModelInCdimage(Model) then
|
||||
return TriggerServerEvent("esx:ReturnVehicleType", false, Request)
|
||||
end
|
||||
|
||||
if Model == `submersible` or Model == `submersible2` then
|
||||
return TriggerServerEvent("esx:ReturnVehicleType", "submarine", Request)
|
||||
return TriggerServerEvent("esx:ReturnVehicleType", "submarine", Request)
|
||||
end
|
||||
|
||||
local VehicleType = GetVehicleClassFromName(Model)
|
||||
@@ -718,7 +697,6 @@ RegisterNetEvent("esx:GetVehicleType", function(Model, Request)
|
||||
TriggerServerEvent("esx:ReturnVehicleType", types[VehicleType] or "automobile", Request)
|
||||
end)
|
||||
|
||||
|
||||
local DoNotUse = {
|
||||
'essentialmode',
|
||||
'es_admin2',
|
||||
|
||||
+338
-207
@@ -1,228 +1,359 @@
|
||||
Locales['cs'] = {
|
||||
-- Inventory
|
||||
['inventory'] = 'inventář %s / %s',
|
||||
['use'] = 'použít',
|
||||
['give'] = 'dát',
|
||||
['remove'] = 'zahodit',
|
||||
['return'] = 'zpět',
|
||||
['give_to'] = 'dát',
|
||||
['amount'] = 'množství',
|
||||
['giveammo'] = 'dát munici',
|
||||
['amountammo'] = 'množství munice',
|
||||
['noammo'] = 'nemáte dostatek munice!',
|
||||
['gave_item'] = 'dali jste %sx %s %s',
|
||||
['received_item'] = 'obdrželi jste %sx %s od %s',
|
||||
['gave_weapon'] = 'dal jsi %s hráči %s',
|
||||
['gave_weapon_ammo'] = 'dal jsi ~o~%sx %s za %s to %s',
|
||||
['gave_weapon_withammo'] = 'dal jwi %s s ~o~%sx %s to %s',
|
||||
['gave_weapon_hasalready'] = '%s již má %s',
|
||||
['gave_weapon_noweapon'] = '%s nemá tuhle zbraň',
|
||||
['received_weapon'] = 'obdrzel jsi %s od %s',
|
||||
['received_weapon_ammo'] = 'obdrzel jsi ~o~%sx %s za tvůj %s od %s',
|
||||
['received_weapon_withammo'] = 'obdzel jsi %s s ~o~%sx %s od %s',
|
||||
['received_weapon_hasalready'] = '%s se pokusil ti dat %s, ale jiz tento predmet jednou mas',
|
||||
['received_weapon_noweapon'] = '%s se pokusil ti dat naboje pro %s, ale tuhle zbran nemas',
|
||||
['gave_account_money'] = 'dali jste $%s (%s) %s',
|
||||
['received_account_money'] = 'obdrželi jste $%s (%s) od %s',
|
||||
['amount_invalid'] = 'neplatné množství',
|
||||
['players_nearby'] = 'žádní hráči poblíž',
|
||||
['ex_inv_lim'] = 'akce není možná, překročen limit inventáře pro %s',
|
||||
['imp_invalid_quantity'] = 'akce není možná, neplatný počet',
|
||||
['imp_invalid_amount'] = 'akce není možná, neplatné množství',
|
||||
['threw_standard'] = 'vyhodil jsi %sx %s',
|
||||
['threw_account'] = 'vyhodil jsi $%s %s',
|
||||
['threw_weapon'] = 'vzhodil jsi %s',
|
||||
['threw_weapon_ammo'] = 'vyhodil jsi %s s ~o~%sx %s',
|
||||
['threw_weapon_already'] = 'jiz stejnou zbraan mas',
|
||||
['threw_cannot_pickup'] = 'tohle nemuzes sebrat, protoze tvuj inventar je plny',
|
||||
['threw_pickup_prompt'] = 'stiskni E po zvednuti',
|
||||
['inventory'] = 'Inventář ( Váha %s / %s )',
|
||||
['use'] = 'Použít',
|
||||
['give'] = 'Darovat',
|
||||
['remove'] = 'Odhodit',
|
||||
['return'] = 'Vrátit',
|
||||
['give_to'] = 'Darováno',
|
||||
['amount'] = 'Počet',
|
||||
['giveammo'] = 'Podat náboje',
|
||||
['amountammo'] = 'Počet nábojů',
|
||||
['noammo'] = 'Nedostatek!',
|
||||
['gave_item'] = 'Daroval %sx %s pro %s',
|
||||
['received_item'] = 'Získáno %sx %s od %s',
|
||||
['gave_weapon'] = 'Předání %s pro %s',
|
||||
['gave_weapon_ammo'] = 'Darování ~o~%sx %s do %s pro %s',
|
||||
['gave_weapon_withammo'] = 'Darování %s s ~o~%sx %s pro %s',
|
||||
['gave_weapon_hasalready'] = '%s již vlastní %s',
|
||||
['gave_weapon_noweapon'] = '%s nemá tuto zbraň',
|
||||
['received_weapon'] = 'Obdrženo %s od %s',
|
||||
['received_weapon_ammo'] = 'Obdrženo ~o~%sx %s pro zbraň %s od %s',
|
||||
['received_weapon_withammo'] = 'Obdrženo %s s ~o~%sx %s od %s',
|
||||
['received_weapon_hasalready'] = '%s se snažil darovat %s, ale již tuto zbraň máš',
|
||||
['received_weapon_noweapon'] = '%s se snažil ti dát náboje %s, ale nemáš potřebnou zbrań',
|
||||
['gave_account_money'] = 'Darováno $%s (%s) pro %s',
|
||||
['received_account_money'] = 'Získáno $%s (%s) od %s',
|
||||
['amount_invalid'] = 'Špatné množství',
|
||||
['players_nearby'] = 'Žádný hráč není poblíž',
|
||||
['ex_inv_lim'] = 'Nelze sebrat,protože máš plné kapsy %s',
|
||||
['imp_invalid_quantity'] = 'Neplatné množství',
|
||||
['imp_invalid_amount'] = 'Nelze provést, neplatné množství',
|
||||
['threw_standard'] = 'Zahozeno %sx %s',
|
||||
['threw_account'] = 'Zahozeno $%s %s',
|
||||
['threw_weapon'] = 'Zahozeno %s',
|
||||
['threw_weapon_ammo'] = 'Zahozeno %s s ~o~%sx %s',
|
||||
['threw_weapon_already'] = 'Již vlastníš tuto zbraň',
|
||||
['threw_cannot_pickup'] = 'Kapsy máš plné, nemůžeš sebrat!',
|
||||
['threw_pickup_prompt'] = 'Zmáčkni E pro sebrání!',
|
||||
|
||||
-- Key mapping
|
||||
['keymap_showinventory'] = 'zobrazit inventar',
|
||||
['keymap_showinventory'] = 'Otevřít inventář',
|
||||
|
||||
-- Salary related
|
||||
['received_salary'] = 'obdrželi jste výplatu: $%s',
|
||||
['received_help'] = 'obdrželi jste sociální dávku: $%s',
|
||||
['company_nomoney'] = 'společnost u které jste zaměstananí nemá peníze na váš plat',
|
||||
['received_paycheck'] = 'obdržena výplata',
|
||||
['bank'] = 'bankovní účet',
|
||||
['account_bank'] = 'banka',
|
||||
['account_black_money'] = 'spinave penize',
|
||||
['account_money'] = 'kapesne',
|
||||
['received_salary'] = 'Obdržel jsi: $%s',
|
||||
['received_help'] = 'Obdržel jsi svůj podíl: $%s',
|
||||
['company_nomoney'] = 'Firma kde pracujete je příliš chudá, aby vám zaplatila',
|
||||
['received_paycheck'] = 'Obdržena platba',
|
||||
['bank'] = 'Banka',
|
||||
['account_bank'] = 'V bance',
|
||||
['account_black_money'] = 'Špináve peníze',
|
||||
['account_money'] = 'V kapse',
|
||||
|
||||
['act_imp'] = 'akce není možná',
|
||||
['in_vehicle'] = 'nemůže nic dát osobě ve vozidle',
|
||||
['act_imp'] = 'Nelze provést',
|
||||
['in_vehicle'] = 'Nelze provést, hráč je v autě',
|
||||
|
||||
-- Commands
|
||||
['command_car'] = 'spawn an vehicle',
|
||||
['command_car_car'] = 'vehicle spawn name or hash',
|
||||
['command_cardel'] = 'delete vehicle in proximity',
|
||||
['command_cardel_radius'] = 'optional, delete every vehicle within the specified radius',
|
||||
['command_clear'] = 'clear chat',
|
||||
['command_clearall'] = 'clear chat for all players',
|
||||
['command_clearinventory'] = 'clear player inventory',
|
||||
['command_clearloadout'] = 'clear a player loadout',
|
||||
['command_giveaccountmoney'] = 'give account money',
|
||||
['command_giveaccountmoney_account'] = 'valid account name',
|
||||
['command_giveaccountmoney_amount'] = 'amount to add',
|
||||
['command_giveaccountmoney_invalid'] = 'invalid account name',
|
||||
['command_giveitem'] = 'give an item to a player',
|
||||
['command_giveitem_item'] = 'item name',
|
||||
['command_giveitem_count'] = 'item count',
|
||||
['command_giveweapon'] = 'give a weapon to a player',
|
||||
['command_giveweapon_weapon'] = 'weapon name',
|
||||
['command_giveweapon_ammo'] = 'ammo count',
|
||||
['command_giveweapon_hasalready'] = 'player already has that weapon',
|
||||
['command_giveweaponcomponent'] = 'give weapon component',
|
||||
['command_giveweaponcomponent_component'] = 'component name',
|
||||
['command_giveweaponcomponent_invalid'] = 'invalid weapon component',
|
||||
['command_giveweaponcomponent_hasalready'] = 'player already has that weapon component',
|
||||
['command_giveweaponcomponent_missingweapon'] = 'player does not have that weapon',
|
||||
['command_save'] = 'save a player to database',
|
||||
['command_saveall'] = 'save all players to database',
|
||||
['command_setaccountmoney'] = 'set account money for a player',
|
||||
['command_setaccountmoney_amount'] = 'amount of money to set',
|
||||
['command_setcoords'] = 'teleport to coordinates',
|
||||
['command_setcoords_x'] = 'x axis',
|
||||
['command_setcoords_y'] = 'y axis',
|
||||
['command_setcoords_z'] = 'z axis',
|
||||
['command_setjob'] = 'set job for a player',
|
||||
['command_setjob_job'] = 'job name',
|
||||
['command_setjob_grade'] = 'job grade',
|
||||
['command_setjob_invalid'] = 'the job, grade or both are invalid',
|
||||
['command_setgroup'] = 'set player group',
|
||||
['command_setgroup_group'] = 'group name',
|
||||
['commanderror_argumentmismatch'] = 'argument count mismatch (passed %s, wanted %s)',
|
||||
['commanderror_argumentmismatch_number'] = 'argument #%s type mismatch (passed string, wanted number)',
|
||||
['commanderror_invaliditem'] = 'invalid item name',
|
||||
['commanderror_invalidweapon'] = 'invalid weapon',
|
||||
['commanderror_console'] = 'that command can not be run from console',
|
||||
['commanderror_invalidcommand'] = '/%s is not an valid command!',
|
||||
['commanderror_invalidplayerid'] = 'there is no player online matching that server id',
|
||||
['commandgeneric_playerid'] = 'player id',
|
||||
['command_giveammo_noweapon_found'] = '%s does not have that weapon',
|
||||
['command_giveammo_weapon'] = 'Weapon name',
|
||||
['command_giveammo_ammo'] = 'Ammo Quantity',
|
||||
['command_bring'] = 'Přivolat si hráče k sobě',
|
||||
['command_car'] = 'Spawnout vozidlo',
|
||||
['command_car_car'] = 'Zadej jméno vozidla nebo spawnname',
|
||||
['command_cardel'] = 'Odstranění vozidla v okolí',
|
||||
['command_cardel_radius'] = 'Odstranění vozidla v určeném dosahu',
|
||||
['command_clear'] = 'Vymazat text v chatu',
|
||||
['command_clearall'] = 'Vymazat chet pro všechny hráče',
|
||||
['command_clearinventory'] = 'Vymazat všechny věci z invetáře hráče',
|
||||
['command_clearloadout'] = 'Vymazat všechny zbraně z inventáře hráče',
|
||||
['command_freeze'] = 'Zmrazit hráče',
|
||||
['command_unfreeze'] = 'Odmrazit hráče',
|
||||
['command_giveaccountmoney'] = 'Poslat peníze na účet ',
|
||||
['command_giveaccountmoney_account'] = 'Převést peníze na účet',
|
||||
['command_giveaccountmoney_amount'] = 'Částka k poslání',
|
||||
['command_giveaccountmoney_invalid'] = 'Neplátné jméno',
|
||||
['command_giveitem'] = 'Darovat věc hráči',
|
||||
['command_giveitem_item'] = 'Název věci',
|
||||
['command_giveitem_count'] = 'Množství',
|
||||
['command_giveweapon'] = 'Dát zbraň hráči',
|
||||
['command_giveweapon_weapon'] = 'Název zbraně',
|
||||
['command_giveweapon_ammo'] = 'Množství náboje',
|
||||
['command_giveweapon_hasalready'] = 'Hráč již má tuto zbraň',
|
||||
['command_giveweaponcomponent'] = 'Darovat přídavek na zbraň',
|
||||
['command_giveweaponcomponent_component'] = 'Název zbraně',
|
||||
['command_giveweaponcomponent_invalid'] = 'Špatné jméno přídavku',
|
||||
['command_giveweaponcomponent_hasalready'] = 'Hráč již má tento přídavek',
|
||||
['command_giveweaponcomponent_missingweapon'] = 'Hráč nemá tuto zbrań',
|
||||
['command_goto'] = 'Teleportování sebe k hráči',
|
||||
['command_kill'] = 'Zabití hráče',
|
||||
['command_save'] = 'Uložení dat hráče',
|
||||
['command_saveall'] = 'Uložení veškerých dat hráče',
|
||||
['command_setaccountmoney'] = 'Nastavení určeného počtu peněz',
|
||||
['command_setaccountmoney_amount'] = 'Počet peněz',
|
||||
['command_setcoords'] = 'Teleportování na určené souřadnice',
|
||||
['command_setcoords_x'] = 'Hodnota X',
|
||||
['command_setcoords_y'] = 'Hodnota Y',
|
||||
['command_setcoords_z'] = 'Hodnota Z',
|
||||
['command_setjob'] = 'Nastavit práci hráči',
|
||||
['command_setjob_job'] = 'Název práce',
|
||||
['command_setjob_grade'] = 'Pozice ve firmě',
|
||||
['command_setjob_invalid'] = 'Špatné zadání práce,hodnosti nebo i obou hodnot',
|
||||
['command_setgroup'] = 'Nastavení práv hráči',
|
||||
['command_setgroup_group'] = 'Název skupiny',
|
||||
['commanderror_argumentmismatch'] = 'Chybný počet hodnot (správně %s, potřebných %s)',
|
||||
['commanderror_argumentmismatch_number'] = 'Chybně zadaná hodnot #%s (správně, špatně)',
|
||||
['commanderror_invaliditem'] = 'Špatný předmět',
|
||||
['commanderror_invalidweapon'] = 'Špatná zbraň',
|
||||
['commanderror_console'] = 'příkaz nelze být zpracován v konzoli',
|
||||
['commanderror_invalidcommand'] = 'Špatný příakz - /%s',
|
||||
['commanderror_invalidplayerid'] = 'Hráč není dostupný',
|
||||
['commandgeneric_playerid'] = 'Id hráče',
|
||||
['command_giveammo_noweapon_found'] = '%s nemá tuto zbraň',
|
||||
['command_giveammo_weapon'] = 'Název zbraně',
|
||||
['command_giveammo_ammo'] = 'Počet nábojů',
|
||||
|
||||
-- Locale settings
|
||||
['locale_digit_grouping_symbol'] = ' ',
|
||||
['locale_currency'] = '$%s',
|
||||
['locale_digit_grouping_symbol'] = ',',
|
||||
['locale_currency'] = '£%s',
|
||||
|
||||
-- Weapons
|
||||
['weapon_knife'] = 'nuz',
|
||||
['weapon_nightstick'] = 'policejni obusek',
|
||||
['weapon_hammer'] = 'kladivo',
|
||||
['weapon_bat'] = 'basseballka',
|
||||
['weapon_golfclub'] = 'gollfova hul',
|
||||
['weapon_crowbar'] = 'pacidlo',
|
||||
['weapon_pistol'] = 'pistole',
|
||||
['weapon_combatpistol'] = 'utocna pistole',
|
||||
['weapon_appistol'] = 'ap pistole',
|
||||
['weapon_pistol50'] = 'pistole .50',
|
||||
['weapon_microsmg'] = 'micro smg',
|
||||
['weapon_smg'] = 'smg',
|
||||
['weapon_assaultsmg'] = 'utocne smg',
|
||||
['weapon_assaultrifle'] = 'utocna puska',
|
||||
['weapon_carbinerifle'] = 'carbine puska',
|
||||
['weapon_advancedrifle'] = 'pokrocily puska',
|
||||
['weapon_mg'] = 'mg',
|
||||
['weapon_combatmg'] = 'utocne mg',
|
||||
['weapon_pumpshotgun'] = 'pumpovana brokovnice',
|
||||
['weapon_sawnoffshotgun'] = 'upilovana brokovnice',
|
||||
['weapon_assaultshotgun'] = 'utocna brokovnice',
|
||||
['weapon_bullpupshotgun'] = 'bullpup brokovnice',
|
||||
['weapon_stungun'] = 'tazer',
|
||||
['weapon_sniperrifle'] = 'sniperka',
|
||||
['weapon_heavysniper'] = 'tezka sniperka',
|
||||
['weapon_grenadelauncher'] = 'launcher granatu',
|
||||
['weapon_rpg'] = 'raketomet',
|
||||
['weapon_minigun'] = 'minigun',
|
||||
['weapon_grenade'] = 'granat',
|
||||
['weapon_stickybomb'] = 'lepkava bomba',
|
||||
['weapon_smokegrenade'] = 'kourovy granat',
|
||||
['weapon_bzgas'] = 'bz gas',
|
||||
['weapon_molotov'] = 'molotov koktejl',
|
||||
['weapon_fireextinguisher'] = 'hasicak',
|
||||
['weapon_petrolcan'] = 'kanystr',
|
||||
['weapon_ball'] = 'koule',
|
||||
['weapon_snspistol'] = 'sns pistole',
|
||||
['weapon_bottle'] = 'lahev',
|
||||
['weapon_gusenberg'] = 'gusenberguv zametac',
|
||||
['weapon_specialcarbine'] = 'specialni karabina',
|
||||
['weapon_heavypistol'] = 'tezka pistole',
|
||||
['weapon_bullpuprifle'] = 'bullpup puska',
|
||||
['weapon_dagger'] = 'dyka',
|
||||
['weapon_vintagepistol'] = 'velmi stara pistole',
|
||||
['weapon_firework'] = 'ohnostroj',
|
||||
['weapon_musket'] = 'musketa',
|
||||
['weapon_heavyshotgun'] = 'tezka brokovnice',
|
||||
['weapon_marksmanrifle'] = 'puska strelce',
|
||||
['weapon_hominglauncher'] = 'navadeci launcher',
|
||||
['weapon_proxmine'] = 'mina na blizko',
|
||||
['weapon_snowball'] = 'snehova koule',
|
||||
['weapon_flaregun'] = 'svetlice',
|
||||
['weapon_combatpdw'] = 'utocne pdw',
|
||||
['weapon_marksmanpistol'] = 'pistole strelce',
|
||||
['weapon_knuckle'] = 'knuckledusters',
|
||||
['weapon_hatchet'] = 'sekerka',
|
||||
['weapon_railgun'] = 'vlakovy launcher',
|
||||
['weapon_machete'] = 'maceta',
|
||||
['weapon_machinepistol'] = 'kulomet',
|
||||
['weapon_switchblade'] = 'vystrelovaci nuz',
|
||||
['weapon_revolver'] = 'tezky revolver',
|
||||
['weapon_dbshotgun'] = 'dvouhlavnova brokovnice',
|
||||
['weapon_compactrifle'] = 'kompaktni puska',
|
||||
['weapon_autoshotgun'] = 'automaticka brokovnice',
|
||||
['weapon_battleaxe'] = 'bojova sekera',
|
||||
['weapon_compactlauncher'] = 'kompaktni launcher',
|
||||
['weapon_minismg'] = 'mini smg',
|
||||
['weapon_pipebomb'] = 'dymkova bomba',
|
||||
['weapon_poolcue'] = 'kulecnikove tago',
|
||||
['weapon_wrench'] = 'klic na trubky',
|
||||
['weapon_flashlight'] = 'baterka',
|
||||
['gadget_parachute'] = 'padak',
|
||||
['weapon_flare'] = 'svetlice',
|
||||
['weapon_doubleaction'] = 'dvojhlavnovy revolver',
|
||||
|
||||
-- Melee
|
||||
['weapon_dagger'] = 'Dýka',
|
||||
['weapon_bat'] = 'Baseballová pálka',
|
||||
['weapon_battleaxe'] = 'Bitevní sekera',
|
||||
['weapon_bottle'] = 'Rozbitá lahve',
|
||||
['weapon_crowbar'] = 'Páčidlo',
|
||||
['weapon_flashlight'] = 'Baterka',
|
||||
['weapon_golfclub'] = 'Golfová hůl',
|
||||
['weapon_hammer'] = 'Kladivo',
|
||||
['weapon_hatchet'] = 'Sekera',
|
||||
['weapon_knife'] = 'Nůž',
|
||||
['weapon_knuckle'] = 'Boxer',
|
||||
['weapon_machete'] = 'Mačeta',
|
||||
['weapon_nightstick'] = 'Policejní obušek',
|
||||
['weapon_wrench'] = 'Francouzský klíč',
|
||||
['weapon_poolcue'] = 'Kulečníkové tágo',
|
||||
['weapon_stone_hatchet'] = 'Kamenná sekera',
|
||||
['weapon_switchblade'] = 'Vystřelovací nůž',
|
||||
|
||||
-- Handguns
|
||||
['weapon_appistol'] = 'AP pistol',
|
||||
['weapon_ceramicpistol'] = 'Ceramic pistol',
|
||||
['weapon_combatpistol'] = 'Combat pistol',
|
||||
['weapon_doubleaction'] = 'Double-Action Revolver',
|
||||
['weapon_navyrevolver'] = 'Navy Revolver',
|
||||
['weapon_flaregun'] = 'Flaregun',
|
||||
['weapon_gadgetpistol'] = 'Gadget Pistol',
|
||||
['weapon_heavypistol'] = 'Heavy Pistol',
|
||||
['weapon_revolver'] = 'Heavy Revolver',
|
||||
['weapon_revolver_mk2'] = 'Heavy Revolver MK2',
|
||||
['weapon_marksmanpistol'] = 'Marksman Pistol',
|
||||
['weapon_pistol'] = 'Pistol',
|
||||
['weapon_pistol_mk2'] = 'Pistol MK2',
|
||||
['weapon_pistol50'] = 'Pistol .50',
|
||||
['weapon_snspistol'] = 'SNS Pistol',
|
||||
['weapon_snspistol_mk2'] = 'SNS Pistol MK2',
|
||||
['weapon_stungun'] = 'Taser',
|
||||
['weapon_raypistol'] = 'Up-N-Atomizer',
|
||||
['weapon_vintagepistol'] = 'Vintage Pistol',
|
||||
|
||||
-- Shotguns
|
||||
['weapon_assaultshotgun'] = 'Assault Shotgun',
|
||||
['weapon_autoshotgun'] = 'Auto Shotgun',
|
||||
['weapon_bullpupshotgun'] = 'Bullpup Shotgun',
|
||||
['weapon_combatshotgun'] = 'Combat Shotgun',
|
||||
['weapon_dbshotgun'] = 'Double Barrel Shotgun',
|
||||
['weapon_heavyshotgun'] = 'Heavy Shotgun',
|
||||
['weapon_musket'] = 'Musket',
|
||||
['weapon_pumpshotgun'] = 'Pump Shotgun',
|
||||
['weapon_pumpshotgun_mk2'] = 'Pump Shotgun MK2',
|
||||
['weapon_sawnoffshotgun'] = 'Sawed Off Shotgun',
|
||||
|
||||
-- SMG & LMG
|
||||
['weapon_assaultsmg'] = 'Assault SMG',
|
||||
['weapon_combatmg'] = 'Combat MG',
|
||||
['weapon_combatmg_mk2'] = 'Combat MG MK2',
|
||||
['weapon_combatpdw'] = 'Combat PDW',
|
||||
['weapon_gusenberg'] = 'Gusenberg Sweeper',
|
||||
['weapon_machinepistol'] = 'Machine Pistol',
|
||||
['weapon_mg'] = 'MG',
|
||||
['weapon_microsmg'] = 'Micro SMG',
|
||||
['weapon_minismg'] = 'Mini SMG',
|
||||
['weapon_smg'] = 'SMG',
|
||||
['weapon_smg_mk2'] = 'SMG MK2',
|
||||
['weapon_raycarbine'] = 'Unholy Hellbringer',
|
||||
|
||||
-- Rifles
|
||||
['weapon_advancedrifle'] = 'Advanced Rifle',
|
||||
['weapon_assaultrifle'] = 'Assault Rifle',
|
||||
['weapon_assaultrifle_mk2'] = 'Assault Rifle MK2',
|
||||
['weapon_bullpuprifle'] = 'Bullpup Rifle',
|
||||
['weapon_bullpuprifle_mk2'] = 'Bullpup Rifle MK2',
|
||||
['weapon_carbinerifle'] = 'Carbine Rifle',
|
||||
['weapon_carbinerifle_mk2'] = 'Carbine Rifle MK2',
|
||||
['weapon_compactrifle'] = 'Compact Rifle',
|
||||
['weapon_militaryrifle'] = 'Military Rifle',
|
||||
['weapon_specialcarbine'] = 'Special Carbine',
|
||||
['weapon_specialcarbine_mk2'] = 'Special Carbine MK2',
|
||||
|
||||
-- Sniper
|
||||
['weapon_heavysniper'] = 'Heavy Sniper',
|
||||
['weapon_heavysniper_mk2'] = 'Heavy Sniper MK2',
|
||||
['weapon_marksmanrifle'] = 'Marksman Rifle',
|
||||
['weapon_marksmanrifle_mk2'] = 'Marksman Rifle MK2',
|
||||
['weapon_sniperrifle'] = 'Sniper Rifle',
|
||||
|
||||
-- Heavy / Launchers
|
||||
['weapon_compactlauncher'] = 'Compact Launcher',
|
||||
['weapon_firework'] = 'Firework Launcher',
|
||||
['weapon_grenadelauncher'] = 'Grenade Launcher',
|
||||
['weapon_hominglauncher'] = 'Homing Launcher',
|
||||
['weapon_minigun'] = 'Minigun',
|
||||
['weapon_railgun'] = 'Railgun',
|
||||
['weapon_rpg'] = 'Rocket Launcher',
|
||||
['weapon_rayminigun'] = 'Widowmaker',
|
||||
|
||||
-- Criminal Enterprises DLC
|
||||
['weapon_metaldetector'] = 'Detektor kovu',
|
||||
['weapon_precisionrifle'] = 'Precision Rifle',
|
||||
['weapon_tactilerifle'] = 'Service Carbine',
|
||||
|
||||
-- Thrown
|
||||
['weapon_ball'] = 'Míček',
|
||||
['weapon_bzgas'] = 'Smrtící slzný plyn',
|
||||
['weapon_flare'] = 'Světlice',
|
||||
['weapon_grenade'] = 'Granát',
|
||||
['weapon_petrolcan'] = 'Kanistr',
|
||||
['weapon_hazardcan'] = 'Hazardous Jerrycan',
|
||||
['weapon_molotov'] = 'Molotův koktejl',
|
||||
['weapon_proxmine'] = 'Pohybová mina',
|
||||
['weapon_pipebomb'] = 'Trubková bomba',
|
||||
['weapon_snowball'] = 'Sněhová koule',
|
||||
['weapon_stickybomb'] = 'C4',
|
||||
['weapon_smokegrenade'] = 'Slzný plyn',
|
||||
|
||||
-- Special
|
||||
['weapon_fireextinguisher'] = 'Hasící přístroj',
|
||||
['weapon_digiscanner'] = 'Skener',
|
||||
['weapon_garbagebag'] = 'Odpadkový pytel',
|
||||
['weapon_handcuffs'] = 'Pouta',
|
||||
['gadget_nightvision'] = 'Noční vidění',
|
||||
['gadget_parachute'] = 'Padák',
|
||||
|
||||
-- Weapon Components
|
||||
['component_clip_default'] = 'zakladni rukojet',
|
||||
['component_clip_extended'] = 'prodloucena rukojet',
|
||||
['component_knuckle_base'] = 'base Model',
|
||||
['component_knuckle_pimp'] = 'the Pimp',
|
||||
['component_knuckle_ballas'] = 'the Ballas',
|
||||
['component_knuckle_dollar'] = 'the Hustler',
|
||||
['component_knuckle_diamond'] = 'the Rock',
|
||||
['component_knuckle_hate'] = 'the Hater',
|
||||
['component_knuckle_love'] = 'the Lover',
|
||||
['component_knuckle_player'] = 'the Player',
|
||||
['component_knuckle_king'] = 'the King',
|
||||
['component_knuckle_vagos'] = 'the Vagos',
|
||||
|
||||
['component_luxary_finish'] = 'luxary Weapon Finish',
|
||||
|
||||
['component_handle_default'] = 'default Handle',
|
||||
['component_handle_vip'] = 'vIP Handle',
|
||||
['component_handle_bodyguard'] = 'bodyguard Handle',
|
||||
|
||||
['component_vip_finish'] = 'vIP Finish',
|
||||
['component_bodyguard_finish'] = 'bodyguard Finish',
|
||||
|
||||
['component_camo_finish'] = 'digital Camo',
|
||||
['component_camo_finish2'] = 'brushstroke Camo',
|
||||
['component_camo_finish3'] = 'woodland Camo',
|
||||
['component_camo_finish4'] = 'skull Camo',
|
||||
['component_camo_finish5'] = 'sessanta Nove Camo',
|
||||
['component_camo_finish6'] = 'perseus Camo',
|
||||
['component_camo_finish7'] = 'leopard Camo',
|
||||
['component_camo_finish8'] = 'zebra Camo',
|
||||
['component_camo_finish9'] = 'geometric Camo',
|
||||
['component_camo_finish10'] = 'boom Camo',
|
||||
['component_camo_finish11'] = 'patriotic Camo',
|
||||
|
||||
['component_camo_slide_finish'] = 'digital Slide Camo',
|
||||
['component_camo_slide_finish2'] = 'brushstroke Slide Camo',
|
||||
['component_camo_slide_finish3'] = 'woodland Slide Camo',
|
||||
['component_camo_slide_finish4'] = 'skull Slide Camo',
|
||||
['component_camo_slide_finish5'] = 'sessanta Nove Slide Camo',
|
||||
['component_camo_slide_finish6'] = 'perseus Slide Camo',
|
||||
['component_camo_slide_finish7'] = 'leopard Slide Camo',
|
||||
['component_camo_slide_finish8'] = 'zebra Slide Camo',
|
||||
['component_camo_slide_finish9'] = 'geometric Slide Camo',
|
||||
['component_camo_slide_finish10'] = 'boom Slide Camo',
|
||||
['component_camo_slide_finish11'] = 'patriotic Slide Camo',
|
||||
|
||||
['component_clip_default'] = 'default Magazine',
|
||||
['component_clip_extended'] = 'extended Magazine',
|
||||
['component_clip_drum'] = 'drum Magazine',
|
||||
['component_clip_box'] = 'krabice s naboji',
|
||||
['component_flashlight'] = 'baterka',
|
||||
['component_scope'] = 'zamerovac',
|
||||
['component_scope_advanced'] = 'pokrocily zamerovac',
|
||||
['component_suppressor'] = 'tlumic',
|
||||
['component_grip'] = 'rukojet',
|
||||
['component_luxary_finish'] = 'luxusni vzhled zbrane',
|
||||
['component_clip_box'] = 'box Magazine',
|
||||
|
||||
['component_scope_holo'] = 'holographic Scope',
|
||||
['component_scope_small'] = 'small Scope',
|
||||
['component_scope_medium'] = 'medium Scope',
|
||||
['component_scope_large'] = 'large Scope',
|
||||
['component_scope'] = 'mounted Scope',
|
||||
['component_scope_advanced'] = 'advanced Scope',
|
||||
['component_ironsights'] = 'ironsights',
|
||||
|
||||
['component_suppressor'] = 'suppressor',
|
||||
['component_compensator'] = 'compensator',
|
||||
|
||||
['component_muzzle_flat'] = 'flat Muzzle Brake',
|
||||
['component_muzzle_tactical'] = 'tactical Muzzle Brake',
|
||||
['component_muzzle_fat'] = 'fat-End Muzzle Brake',
|
||||
['component_muzzle_precision'] = 'precision Muzzle Brake',
|
||||
['component_muzzle_heavy'] = 'heavy Duty Muzzle Brake',
|
||||
['component_muzzle_slanted'] = 'slanted Muzzle Brake',
|
||||
['component_muzzle_split'] = 'split-End Muzzle Brake',
|
||||
['component_muzzle_squared'] = 'squared Muzzle Brake',
|
||||
|
||||
['component_flashlight'] = 'flashlight',
|
||||
['component_grip'] = 'grip',
|
||||
|
||||
['component_barrel_default'] = 'default Barrel',
|
||||
['component_barrel_heavy'] = 'heavy Barrel',
|
||||
|
||||
['component_ammo_tracer'] = 'tracer Ammo',
|
||||
['component_ammo_incendiary'] = 'incendiary Ammo',
|
||||
['component_ammo_hollowpoint'] = 'hollowpoint Ammo',
|
||||
['component_ammo_fmj'] = 'fMJ Ammo',
|
||||
['component_ammo_armor'] = 'armor Piercing Ammo',
|
||||
['component_ammo_explosive'] = 'armor Piercing Incendiary Ammo',
|
||||
|
||||
['component_shells_default'] = 'default Shells',
|
||||
['component_shells_incendiary'] = 'dragons Breath Shells',
|
||||
['component_shells_armor'] = 'steel Buckshot Shells',
|
||||
['component_shells_hollowpoint'] = 'flechette Shells',
|
||||
['component_shells_explosive'] = 'explosive Slug Shells',
|
||||
|
||||
-- Weapon Ammo
|
||||
['ammo_rounds'] = 'naboj(e)',
|
||||
['ammo_shells'] = 'patrona(y)',
|
||||
['ammo_charge'] = 'naboj(e)',
|
||||
['ammo_petrol'] = 'galonu paliva',
|
||||
['ammo_firework'] = 'ohnostroj(e)',
|
||||
['ammo_rockets'] = 'raketa(y)',
|
||||
['ammo_grenadelauncher'] = 'granat(y)',
|
||||
['ammo_grenade'] = 'granat(y)',
|
||||
['ammo_stickybomb'] = 'bomba(y)',
|
||||
['ammo_pipebomb'] = 'bomba(y)',
|
||||
['ammo_smokebomb'] = 'bomba(y)',
|
||||
['ammo_molotov'] = 'koktejl(y)',
|
||||
['ammo_proxmine'] = 'mina(y)',
|
||||
['ammo_bzgas'] = 'kanystr(y)',
|
||||
['ammo_ball'] = 'koule',
|
||||
['ammo_snowball'] = 'snehova(e) koule',
|
||||
['ammo_flare'] = 'svetlice',
|
||||
['ammo_flaregun'] = 'svetlice',
|
||||
['ammo_rounds'] = 'round(s)',
|
||||
['ammo_shells'] = 'shell(s)',
|
||||
['ammo_charge'] = 'charge',
|
||||
['ammo_petrol'] = 'gallons of fuel',
|
||||
['ammo_firework'] = 'firework(s)',
|
||||
['ammo_rockets'] = 'rocket(s)',
|
||||
['ammo_grenadelauncher'] = 'grenade(s)',
|
||||
['ammo_grenade'] = 'grenade(s)',
|
||||
['ammo_stickybomb'] = 'bomb(s)',
|
||||
['ammo_pipebomb'] = 'bomb(s)',
|
||||
['ammo_smokebomb'] = 'bomb(s)',
|
||||
['ammo_molotov'] = 'cocktail(s)',
|
||||
['ammo_proxmine'] = 'mine(s)',
|
||||
['ammo_bzgas'] = 'can(s)',
|
||||
['ammo_ball'] = 'ball(s)',
|
||||
['ammo_snowball'] = 'snowball(s)',
|
||||
['ammo_flare'] = 'flare(s)',
|
||||
['ammo_flaregun'] = 'flare(s)',
|
||||
|
||||
-- Weapon Tints
|
||||
['tint_default'] = 'zakladni skin',
|
||||
['tint_green'] = 'zeleny skin',
|
||||
['tint_gold'] = 'zlaty skin',
|
||||
['tint_pink'] = 'ruzovy skin',
|
||||
['tint_army'] = 'armadni skin',
|
||||
['tint_lspd'] = 'modry skin',
|
||||
['tint_orange'] = 'oranzovy skin',
|
||||
['tint_platinum'] = 'platinovy skin',
|
||||
['tint_default'] = 'default skin',
|
||||
['tint_green'] = 'green skin',
|
||||
['tint_gold'] = 'gold skin',
|
||||
['tint_pink'] = 'pink skin',
|
||||
['tint_army'] = 'army skin',
|
||||
['tint_lspd'] = 'blue skin',
|
||||
['tint_orange'] = 'orange skin',
|
||||
['tint_platinum'] = 'platinum skin',
|
||||
}
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
local SetTimeout = SetTimeout
|
||||
local GetPlayerPed = GetPlayerPed
|
||||
local DoesEntityExist = DoesEntityExist
|
||||
local GetEntityCoords = GetEntityCoords
|
||||
local GetEntityHeading = GetEntityHeading
|
||||
|
||||
function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, weight, job, loadout, name, coords)
|
||||
local targetOverrides = Config.PlayerFunctionOverride and Core.PlayerFunctionOverrides[Config.PlayerFunctionOverride] or {}
|
||||
|
||||
@@ -31,7 +37,6 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
|
||||
end
|
||||
|
||||
function self.setCoords(coords)
|
||||
self.updateCoords(coords)
|
||||
local Ped = GetPlayerPed(self.source)
|
||||
local vector = type(coords) == "vector4" and coords or type(coords) == "vector3" and vector4(coords, 0.0) or
|
||||
vec(coords.x, coords.y, coords.z, coords.heading or 0.0)
|
||||
@@ -40,10 +45,23 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
|
||||
end
|
||||
|
||||
function self.updateCoords()
|
||||
local Ped = GetPlayerPed(self.source)
|
||||
local coords = GetEntityCoords(Ped)
|
||||
local heading = GetEntityHeading(Ped)
|
||||
self.coords = {x = ESX.Math.Round(coords.x, 1), y = ESX.Math.Round(coords.y, 1), z = ESX.Math.Round(coords.z, 1), heading = ESX.Math.Round(heading or 0.0, 1)}
|
||||
SetTimeout(1000,function()
|
||||
local Ped = GetPlayerPed(self.source)
|
||||
if DoesEntityExist(Ped) then
|
||||
local coords = GetEntityCoords(Ped)
|
||||
local distance = #(coords - vector3(self.coords.x, self.coords.y, self.coords.z))
|
||||
if distance > 1.5 then
|
||||
local heading = GetEntityHeading(Ped)
|
||||
self.coords = {
|
||||
x = coords.x,
|
||||
y = coords.y,
|
||||
z = coords.z,
|
||||
heading = heading or 0.0
|
||||
}
|
||||
end
|
||||
end
|
||||
self.updateCoords()
|
||||
end)
|
||||
end
|
||||
|
||||
function self.getCoords(vector)
|
||||
@@ -187,7 +205,7 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
|
||||
print(('[^1ERROR^7] Tried To Set Account ^5%s^0 For Player ^5%s^0 To An Invalid Number -> ^5%s^7'):format(accountName, self.playerId, money))
|
||||
return
|
||||
end
|
||||
if money > 0 then
|
||||
if money >= 0 then
|
||||
local account = self.getAccount(accountName)
|
||||
|
||||
if account then
|
||||
|
||||
@@ -14,11 +14,6 @@ Core.Pickups = {}
|
||||
Core.PickupId = 0
|
||||
Core.PlayerFunctionOverrides = {}
|
||||
|
||||
AddEventHandler('esx:getSharedObject', function(cb)
|
||||
local Invoke = GetInvokingResource()
|
||||
print(('[^3WARNING^7] ^5%s^7 used ^5esx:getSharedObject^7, this method is deprecated and should not be used, On 30/11/2022 esx:getSharedObject will come to EOL and be fully removed! Refer to ^5https://docs.esx-framework.org/tutorials/sharedevent^7 for more info!'):format(Invoke))
|
||||
cb(ESX)
|
||||
end)
|
||||
|
||||
exports('getSharedObject', function()
|
||||
return ESX
|
||||
|
||||
@@ -317,7 +317,7 @@ function loadESXPlayer(identifier, playerId, isNew)
|
||||
else
|
||||
exports.ox_inventory:setPlayerInventory(xPlayer, userData.inventory)
|
||||
end
|
||||
|
||||
xPlayer.updateCoords()
|
||||
xPlayer.triggerEvent('esx:registerSuggestions', Core.RegisteredCommands)
|
||||
print(('[^2INFO^0] Player ^5"%s"^0 has connected to the server. ID: ^5%s^7'):format(xPlayer.getName(), playerId))
|
||||
end
|
||||
@@ -359,16 +359,6 @@ AddEventHandler('esx:playerLogout', function(playerId, cb)
|
||||
TriggerClientEvent("esx:onPlayerLogout", playerId)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx:updateCoords')
|
||||
AddEventHandler('esx:updateCoords', function()
|
||||
local source = source
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
|
||||
if xPlayer then
|
||||
xPlayer.updateCoords()
|
||||
end
|
||||
end)
|
||||
|
||||
if not Config.OxInventory then
|
||||
RegisterNetEvent('esx:updateWeaponAmmo')
|
||||
AddEventHandler('esx:updateWeaponAmmo', function(weaponName, ammoCount)
|
||||
|
||||
@@ -61,23 +61,29 @@ end
|
||||
---@param heading number
|
||||
---@param Properties table
|
||||
---@param cb function
|
||||
function ESX.OneSync.SpawnVehicle(model, coords, heading, Properties, cb)
|
||||
model = type(model) == 'string' and joaat(model) or model
|
||||
Properties = Properties or {}
|
||||
local vector = type(coords) == "vector3" and coords or vec(coords.x, coords.y, coords.z)
|
||||
TriggerClientEvent("esx:requestModel", -1, model)
|
||||
CreateThread(function()
|
||||
local xPlayer = ESX.OneSync.GetClosestPlayer(vector, 200)
|
||||
ESX.GetVehicleType(model, xPlayer.id, function(Type)
|
||||
local SpawnedEntity = CreateVehicleServerSetter(model, Type, vector, heading)
|
||||
Wait(250)
|
||||
local NetworkId = NetworkGetNetworkIdFromEntity(SpawnedEntity)
|
||||
Properties.NetId = NetworkId
|
||||
Entity(SpawnedEntity).state:set('VehicleProperties', Properties, true)
|
||||
cb(NetworkId)
|
||||
end)
|
||||
end)
|
||||
end
|
||||
function ESX.OneSync.SpawnVehicle(model, coords, heading, Properties, cb)
|
||||
local veh_model = type(model) == 'string' and joaat(model) or model
|
||||
Properties = Properties or {}
|
||||
local vector = type(coords) == "vector3" and coords or vec(coords.x, coords.y, coords.z)
|
||||
TriggerClientEvent("esx:requestModel", -1, model)
|
||||
CreateThread(function()
|
||||
local xPlayer = ESX.OneSync.GetClosestPlayer(vector, 300)
|
||||
ESX.GetVehicleType(veh_model, xPlayer.id, function(Type)
|
||||
if Type then
|
||||
local SpawnedEntity = CreateVehicleServerSetter(veh_model, Type, vector, heading)
|
||||
local NetworkId = NetworkGetNetworkIdFromEntity(SpawnedEntity)
|
||||
while not DoesEntityExist(SpawnedEntity) do
|
||||
Wait(100)
|
||||
end
|
||||
Properties.NetId = NetworkId
|
||||
Entity(SpawnedEntity).state:set('VehicleProperties', Properties, true)
|
||||
cb(NetworkId)
|
||||
else
|
||||
print(('[^1ERROR^7] Tried to spawn invalid vehicle - ^5%s^7!'):format(model))
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
---@param model number|string
|
||||
|
||||
@@ -35,7 +35,6 @@ if ESX.GetConfig().Multichar then
|
||||
RenderScriptCams(true, false, 1, true, true)
|
||||
SetCamCoord(cam, offset.x, offset.y, offset.z)
|
||||
PointCamAtCoord(cam, Config.Spawn.x, Config.Spawn.y, Config.Spawn.z + 1.3)
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.UI.HUD.SetDisplay(0.0)
|
||||
StartLoop()
|
||||
ShutdownLoadingScreen()
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
Locales["es"] = {
|
||||
["male"] = "Hombre",
|
||||
["female"] = "Mujer",
|
||||
["delete_label"] = "¿Quieres borrar a %s %s?",
|
||||
["select_char"] = "Seleccionar personaje",
|
||||
["select_char_description"] = "Select a character to play as.",
|
||||
["select_char_description"] = "Selecciona un personaje para jugar.",
|
||||
["create_char"] = "Crear nuevo personaje",
|
||||
["char_play"] = "Jugar este personaje",
|
||||
["char_play_description"] = "Continúe hacia la ciudad.",
|
||||
["char_disabled"] = "Este personaje está deshabilitado",
|
||||
["char_disabled_description"] = "Este personaje es inutilizable.",
|
||||
["char_delete"] = "Borrar este personaje",
|
||||
["cancel"] = "Cancelar",
|
||||
["confirm"] = "Confirmar",
|
||||
["char_delete_description"] = "Eliminar permanentemente este personaje.",
|
||||
["character"] = "Personaje: %s",
|
||||
["return"] = "Volver",
|
||||
["return_description"] = "Volver a la selección de personajes.",
|
||||
["command_setslots"] = "Establecer el numero de espacios de un jugador",
|
||||
["command_remslots"] = "Elimina espacios multipersonaje de un jugador",
|
||||
["command_enablechar"] = "Habilita el personaje de un jugador",
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
Locales['it'] = {
|
||||
['skin_menu'] = 'Menu Skin',
|
||||
['use_rotate_view'] = 'usa ~INPUT_FRONTEND_LS~ e ~INPUT_CHARACTER_WHEEL~ per ruotare la visuale.',
|
||||
['skin'] = 'cambia skin',
|
||||
['saveskin'] = 'salvare la skin',
|
||||
}
|
||||
@@ -11,63 +11,59 @@ end)
|
||||
|
||||
|
||||
function OpenAmbulanceActionsMenu()
|
||||
local elements = {{label = TranslateCap('cloakroom'), value = 'cloakroom'}}
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-shirt", title = "Ambulance Actions"},
|
||||
{icon = "fas fa-shirt", title = TranslateCap('cloakroom'), value = 'cloakroom'}
|
||||
}
|
||||
|
||||
if Config.EnablePlayerManagement and ESX.PlayerData.job.grade_name == 'boss' then
|
||||
table.insert(elements, {label = TranslateCap('boss_actions'), value = 'boss_actions'})
|
||||
elements[#elements+1] = {
|
||||
icon = "fas fa-ambulance",
|
||||
title = TranslateCap('boss_actions'),
|
||||
value = 'boss_actions'
|
||||
}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.CloseAll()
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'ambulance_actions', {
|
||||
title = TranslateCap('ambulance'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
if data.current.value == 'cloakroom' then
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.value == 'cloakroom' then
|
||||
OpenCloakroomMenu()
|
||||
elseif data.current.value == 'boss_actions' then
|
||||
elseif element.value == 'boss_actions' then
|
||||
TriggerEvent('esx_society:openBossMenu', 'ambulance', function(data, menu)
|
||||
menu.close()
|
||||
end, {wash = false})
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
function OpenMobileAmbulanceActionsMenu()
|
||||
ESX.UI.Menu.CloseAll()
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-ambulance", title = TranslateCap('ambulance')},
|
||||
{icon = "fas fa-ambulance", title = TranslateCap('ems_menu'), value = "citizen_interaction"}
|
||||
}
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'mobile_ambulance_actions', {
|
||||
title = TranslateCap('ambulance'),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('ems_menu'), value = 'citizen_interaction'}
|
||||
}}, function(data, menu)
|
||||
if data.current.value == 'citizen_interaction' then
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'citizen_interaction', {
|
||||
title = TranslateCap('ems_menu_title'),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('ems_menu_revive'), value = 'revive'},
|
||||
{label = TranslateCap('ems_menu_small'), value = 'small'},
|
||||
{label = TranslateCap('ems_menu_big'), value = 'big'},
|
||||
{label = TranslateCap('ems_menu_putincar'), value = 'put_in_vehicle'},
|
||||
{label = TranslateCap('ems_menu_search'), value = 'search'}
|
||||
}}, function(data, menu)
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.value == "citizen_interaction" then
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-ambulance", title = element.title},
|
||||
{icon = "fas fa-syringe", title = TranslateCap('ems_menu_revive'), value = "revive"},
|
||||
{icon = "fas fa-bandage", title = TranslateCap('ems_menu_small'), value = "small"},
|
||||
{icon = "fas fa-bandage", title = TranslateCap('ems_menu_big'), value = "big"},
|
||||
{icon = "fas fa-car", title = TranslateCap('ems_menu_putincar'), value = "put_in_vehicle"},
|
||||
{icon = "fas fa-syringe", title = TranslateCap('ems_menu_search'), value = "search"},
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
if isBusy then return end
|
||||
|
||||
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
|
||||
|
||||
if data.current.value == 'search' then
|
||||
if element2.value == 'search' then
|
||||
TriggerServerEvent('esx_ambulancejob:svsearch')
|
||||
elseif closestPlayer == -1 or closestDistance > 1.0 then
|
||||
ESX.ShowNotification(TranslateCap('no_players'))
|
||||
else
|
||||
if data.current.value == 'revive' then
|
||||
if element2.value == 'revive' then
|
||||
revivePlayer(closestPlayer)
|
||||
elseif data.current.value == 'small' then
|
||||
elseif element2.value == 'small' then
|
||||
ESX.TriggerServerCallback('esx_ambulancejob:getItemAmount', function(quantity)
|
||||
if quantity > 0 then
|
||||
local closestPlayerPed = GetPlayerPed(closestPlayer)
|
||||
@@ -94,8 +90,7 @@ function OpenMobileAmbulanceActionsMenu()
|
||||
end
|
||||
end, 'bandage')
|
||||
|
||||
elseif data.current.value == 'big' then
|
||||
|
||||
elseif element2.value == 'big' then
|
||||
ESX.TriggerServerCallback('esx_ambulancejob:getItemAmount', function(quantity)
|
||||
if quantity > 0 then
|
||||
local closestPlayerPed = GetPlayerPed(closestPlayer)
|
||||
@@ -121,18 +116,12 @@ function OpenMobileAmbulanceActionsMenu()
|
||||
ESX.ShowNotification(TranslateCap('not_enough_medikit'))
|
||||
end
|
||||
end, 'medikit')
|
||||
|
||||
elseif data.current.value == 'put_in_vehicle' then
|
||||
elseif element2.value == 'put_in_vehicle' then
|
||||
TriggerServerEvent('esx_ambulancejob:putInVehicle', GetPlayerServerId(closestPlayer))
|
||||
end
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -328,7 +317,7 @@ end)
|
||||
|
||||
AddEventHandler('esx_ambulancejob:hasExitedMarker', function(hospital, part, partNum)
|
||||
if not isInShopMenu then
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.CloseContext()
|
||||
end
|
||||
ESX.HideUI()
|
||||
CurrentAction = nil
|
||||
@@ -411,14 +400,14 @@ AddEventHandler('esx_ambulancejob:putInVehicle', function()
|
||||
end)
|
||||
|
||||
function OpenCloakroomMenu()
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'cloakroom', {
|
||||
title = TranslateCap('cloakroom'),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('ems_clothes_civil'), value = 'citizen_wear'},
|
||||
{label = TranslateCap('ems_clothes_ems'), value = 'ambulance_wear'},
|
||||
}}, function(data, menu)
|
||||
if data.current.value == 'citizen_wear' then
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-shirt", title = TranslateCap('cloakroom')},
|
||||
{icon = "fas fa-shirt", title = TranslateCap('ems_clothes_civil'), value = "citizen_wear"},
|
||||
{icon = "fas fa-shirt", title = TranslateCap('ems_clothes_ems'), value = "ambulance_wear"},
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.value == "citizen_wear" then
|
||||
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
|
||||
TriggerEvent('skinchanger:loadSkin', skin)
|
||||
isOnDuty = false
|
||||
@@ -432,7 +421,7 @@ function OpenCloakroomMenu()
|
||||
print("[^2INFO^7] Off Duty")
|
||||
end
|
||||
end)
|
||||
elseif data.current.value == 'ambulance_wear' then
|
||||
elseif element.value == "ambulance_wear" then
|
||||
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
|
||||
if skin.sex == 0 then
|
||||
TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_male)
|
||||
@@ -450,29 +439,38 @@ function OpenCloakroomMenu()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
menu.close()
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
function OpenPharmacyMenu()
|
||||
ESX.UI.Menu.CloseAll()
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-pills", title = TranslateCap('pharmacy_menu_title')}
|
||||
}
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'pharmacy', {
|
||||
title = TranslateCap('pharmacy_menu_title'),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('pharmacy_take', TranslateCap('medikit')), item = 'medikit', type = 'slider', value = 1, min = 1, max = 100},
|
||||
{label = TranslateCap('pharmacy_take', TranslateCap('bandage')), item = 'bandage', type = 'slider', value = 1, min = 1, max = 100}
|
||||
}}, function(data, menu)
|
||||
if Config.Debug then
|
||||
print("[^2INFO^7] Attempting to Give Item - ^5" .. tostring(data.current.item) .. "^7")
|
||||
end
|
||||
TriggerServerEvent('esx_ambulancejob:giveItem', data.current.item, data.current.value)
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
for k,v in pairs(Config.PharmacyItems) do
|
||||
elements[#elements+1] = {
|
||||
icon = "fas fa-pills",
|
||||
title = v.title,
|
||||
item = v.item
|
||||
}
|
||||
end
|
||||
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-pills", title = element.title},
|
||||
{title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 100, inputPlaceholder = "Amount to buy.."},
|
||||
{icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local amount = menu2.eles[2].inputValue
|
||||
if Config.Debug then
|
||||
print("[^2INFO^7] Attempting to Give Item - ^5" .. tostring(element.item) .. "^7")
|
||||
end
|
||||
TriggerServerEvent('esx_ambulancejob:giveItem', element.item, amount)
|
||||
end, function(menu)
|
||||
OpenPharmacyMenu()
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ end)
|
||||
|
||||
function OnPlayerDeath()
|
||||
isDead = true
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.CloseContext()
|
||||
ClearTimecycleModifier()
|
||||
SetTimecycleModifier("REDMIST_blend")
|
||||
SetTimecycleModifierStrength(0.7)
|
||||
@@ -115,7 +115,7 @@ end
|
||||
|
||||
RegisterNetEvent('esx_ambulancejob:useItem')
|
||||
AddEventHandler('esx_ambulancejob:useItem', function(itemName)
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.CloseContext()
|
||||
|
||||
if itemName == 'medikit' then
|
||||
local lib, anim = 'anim@heists@narcotics@funding@gang_idle', 'gang_chatting_idle01' -- TODO better animations
|
||||
|
||||
@@ -2,16 +2,15 @@ local spawnedVehicles = {}
|
||||
|
||||
function OpenVehicleSpawnerMenu(type, hospital, part, partNum)
|
||||
local playerCoords = GetEntityCoords(PlayerPedId())
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-car", title = TranslateCap('garage_title')},
|
||||
{icon = "fas fa-car", title = TranslateCap('garage_storeditem'), action = 'garage'},
|
||||
{icon = "fas fa-car", title = TranslateCap('garage_storeitem'), action = 'store_garage'},
|
||||
{icon = "fas fa-car", title = TranslateCap('garage_buyitem'), action = 'buy_vehicle'}
|
||||
}
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle', {
|
||||
title = TranslateCap('garage_title'),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('garage_storeditem'), action = 'garage'},
|
||||
{label = TranslateCap('garage_storeitem'), action = 'store_garage'},
|
||||
{label = TranslateCap('garage_buyitem'), action = 'buy_vehicle'}
|
||||
}}, function(data, menu)
|
||||
if data.current.action == 'buy_vehicle' then
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.action == "buy_vehicle" then
|
||||
local shopElements = {}
|
||||
local authorizedVehicles = Config.AuthorizedVehicles[type][ESX.PlayerData.job.grade_name]
|
||||
local shopCoords = Config.Hospitals[hospital][part][partNum].InsideShop
|
||||
@@ -21,23 +20,30 @@ function OpenVehicleSpawnerMenu(type, hospital, part, partNum)
|
||||
if IsModelInCdimage(vehicle.model) then
|
||||
local vehicleLabel = GetLabelText(GetDisplayNameFromVehicleModel(vehicle.model))
|
||||
|
||||
table.insert(shopElements, {
|
||||
label = ('%s - <span style="color:green;">%s</span>'):format(vehicleLabel, TranslateCap('shop_item', ESX.Math.GroupDigits(vehicle.price))),
|
||||
shopElements[#shopElements+1] = {
|
||||
icon = 'fas fa-car',
|
||||
title = ('%s - <span style="color:green;">%s</span>'):format(vehicleLabel, TranslateCap('shop_item', ESX.Math.GroupDigits(vehicle.price))),
|
||||
name = vehicleLabel,
|
||||
model = vehicle.model,
|
||||
price = vehicle.price,
|
||||
props = vehicle.props,
|
||||
type = type
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
if #shopElements > 0 then
|
||||
OpenShopMenu(shopElements, playerCoords, shopCoords)
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('garage_notauthorized'))
|
||||
end
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('garage_notauthorized'))
|
||||
end
|
||||
elseif data.current.action == 'garage' then
|
||||
local garage = {}
|
||||
elseif element.action == "garage" then
|
||||
local garage = {
|
||||
{unselectable = true, icon = "fas fa-car", title = "Garage"}
|
||||
}
|
||||
|
||||
ESX.TriggerServerCallback('esx_vehicleshop:retrieveJobVehicles', function(jobVehicles)
|
||||
if #jobVehicles > 0 then
|
||||
@@ -56,42 +62,37 @@ function OpenVehicleSpawnerMenu(type, hospital, part, partNum)
|
||||
label = label .. ('<span style="color:darkred;">%s</span>'):format(TranslateCap('garage_notstored'))
|
||||
end
|
||||
|
||||
table.insert(garage, {
|
||||
label = label,
|
||||
garage[#garage+1] = {
|
||||
icon = 'fas fa-car',
|
||||
title = label,
|
||||
stored = v.stored,
|
||||
model = props.model,
|
||||
plate = props.plate
|
||||
})
|
||||
}
|
||||
|
||||
allVehicleProps[props.plate] = props
|
||||
end
|
||||
end
|
||||
|
||||
if #garage > 0 then
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_garage', {
|
||||
title = TranslateCap('garage_title'),
|
||||
align = 'top-left',
|
||||
elements = garage
|
||||
}, function(data2, menu2)
|
||||
if data2.current.stored == 1 then
|
||||
ESX.OpenContext("right", garage, function(menuG,elementG)
|
||||
if elementG.stored == 1 then
|
||||
local foundSpawn, spawnPoint = GetAvailableVehicleSpawnPoint(hospital, part, partNum)
|
||||
|
||||
if foundSpawn then
|
||||
menu2.close()
|
||||
ESX.CloseContext()
|
||||
|
||||
ESX.Game.SpawnVehicle(data2.current.model, spawnPoint.coords, spawnPoint.heading, function(vehicle)
|
||||
local vehicleProps = allVehicleProps[data2.current.plate]
|
||||
ESX.Game.SpawnVehicle(elementG.model, spawnPoint.coords, spawnPoint.heading, function(vehicle)
|
||||
local vehicleProps = allVehicleProps[elementG.plate]
|
||||
ESX.Game.SetVehicleProperties(vehicle, vehicleProps)
|
||||
|
||||
TriggerServerEvent('esx_vehicleshop:setJobVehicleState', data2.current.plate, false)
|
||||
TriggerServerEvent('esx_vehicleshop:setJobVehicleState', elementG.plate, false)
|
||||
ESX.ShowNotification(TranslateCap('garage_released'))
|
||||
end)
|
||||
end
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('garage_notavailable'))
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('garage_empty'))
|
||||
@@ -100,11 +101,9 @@ function OpenVehicleSpawnerMenu(type, hospital, part, partNum)
|
||||
ESX.ShowNotification(TranslateCap('garage_empty'))
|
||||
end
|
||||
end, type)
|
||||
elseif data.current.action == 'store_garage' then
|
||||
elseif element.action == "store_garage" then
|
||||
StoreNearbyVehicle(playerCoords)
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -198,84 +197,71 @@ end
|
||||
function OpenShopMenu(elements, restoreCoords, shopCoords)
|
||||
local playerPed = PlayerPedId()
|
||||
isInShopMenu = true
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-car", title = element.title},
|
||||
{icon = "fas fa-eye", title = "View", value = "view"}
|
||||
}
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_shop', {
|
||||
title = TranslateCap('vehicleshop_title'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_shop_confirm', {
|
||||
title = TranslateCap('vehicleshop_confirm', data.current.name, data.current.price),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('confirm_no'), value = 'no'},
|
||||
{label = TranslateCap('confirm_yes'), value = 'yes'}
|
||||
}}, function(data2, menu2)
|
||||
if data2.current.value == 'yes' then
|
||||
local newPlate = exports['esx_vehicleshop']:GeneratePlate()
|
||||
local vehicle = GetVehiclePedIsIn(playerPed, false)
|
||||
local props = ESX.Game.GetVehicleProperties(vehicle)
|
||||
props.plate = newPlate
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
if element2.value == "view" then
|
||||
DeleteSpawnedVehicles()
|
||||
WaitForVehicleToLoad(element.model)
|
||||
|
||||
ESX.TriggerServerCallback('esx_ambulancejob:buyJobVehicle', function(bought)
|
||||
if bought then
|
||||
ESX.ShowNotification(TranslateCap('vehicleshop_bought', data.current.name, ESX.Math.GroupDigits(data.current.price)))
|
||||
ESX.Game.SpawnLocalVehicle(element.model, shopCoords, 0.0, function(vehicle)
|
||||
table.insert(spawnedVehicles, vehicle)
|
||||
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
|
||||
FreezeEntityPosition(vehicle, true)
|
||||
SetModelAsNoLongerNeeded(element.model)
|
||||
|
||||
if element.props then
|
||||
ESX.Game.SetVehicleProperties(vehicle, element.props)
|
||||
end
|
||||
end)
|
||||
|
||||
local elements3 = {
|
||||
{unselectable = true, icon = "fas fa-car", title = element.title},
|
||||
{icon = "fas fa-check-double", title = "Buy", value = "buy"},
|
||||
{icon = "fas fa-eye", title = "Stop Viewing", value = "stop"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements3, function(menu3,element3)
|
||||
if element3.value == 'stop' then
|
||||
isInShopMenu = false
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.CloseContext()
|
||||
|
||||
DeleteSpawnedVehicles()
|
||||
FreezeEntityPosition(playerPed, false)
|
||||
SetEntityVisible(playerPed, true)
|
||||
|
||||
ESX.Game.Teleport(playerPed, restoreCoords)
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('vehicleshop_money'))
|
||||
menu2.close()
|
||||
elseif element3.value == "buy" then
|
||||
local newPlate = exports['esx_vehicleshop']:GeneratePlate()
|
||||
local vehicle = GetVehiclePedIsIn(playerPed, false)
|
||||
local props = ESX.Game.GetVehicleProperties(vehicle)
|
||||
props.plate = newPlate
|
||||
|
||||
ESX.TriggerServerCallback('esx_ambulancejob:buyJobVehicle', function (bought)
|
||||
if bought then
|
||||
ESX.ShowNotification(TranslateCap('vehicleshop_bought', element.name, ESX.Math.GroupDigits(element.price)))
|
||||
|
||||
isInShopMenu = false
|
||||
ESX.CloseContext()
|
||||
DeleteSpawnedVehicles()
|
||||
FreezeEntityPosition(playerPed, false)
|
||||
SetEntityVisible(playerPed, true)
|
||||
|
||||
ESX.Game.Teleport(playerPed, restoreCoords)
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('vehicleshop_money'))
|
||||
ESX.CloseContext()
|
||||
end
|
||||
end, props, element.type)
|
||||
end
|
||||
end, props, data.current.type)
|
||||
else
|
||||
menu2.close()
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end, function(data, menu)
|
||||
isInShopMenu = false
|
||||
ESX.UI.Menu.CloseAll()
|
||||
|
||||
DeleteSpawnedVehicles()
|
||||
FreezeEntityPosition(playerPed, false)
|
||||
SetEntityVisible(playerPed, true)
|
||||
|
||||
ESX.Game.Teleport(playerPed, restoreCoords)
|
||||
end, function(data, menu)
|
||||
DeleteSpawnedVehicles()
|
||||
WaitForVehicleToLoad(data.current.model)
|
||||
|
||||
ESX.Game.SpawnLocalVehicle(data.current.model, shopCoords, 0.0, function(vehicle)
|
||||
table.insert(spawnedVehicles, vehicle)
|
||||
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
|
||||
FreezeEntityPosition(vehicle, true)
|
||||
SetModelAsNoLongerNeeded(data.current.model)
|
||||
|
||||
if data.current.props then
|
||||
ESX.Game.SetVehicleProperties(vehicle, data.current.props)
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
WaitForVehicleToLoad(elements[1].model)
|
||||
ESX.Game.SpawnLocalVehicle(elements[1].model, shopCoords, 0.0, function(vehicle)
|
||||
table.insert(spawnedVehicles, vehicle)
|
||||
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
|
||||
FreezeEntityPosition(vehicle, true)
|
||||
SetModelAsNoLongerNeeded(elements[1].model)
|
||||
|
||||
if elements[1].props then
|
||||
ESX.Game.SetVehicleProperties(vehicle, elements[1].props)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
CreateThread(function()
|
||||
|
||||
@@ -35,6 +35,17 @@ Config.RespawnPoints = {
|
||||
{coords = vector3(1836.03, 3670.99, 34.28), heading = 296.06} -- Sandy Shores
|
||||
}
|
||||
|
||||
Config.PharmacyItems = {
|
||||
{
|
||||
title = "Medikit",
|
||||
item = "medikit"
|
||||
},
|
||||
{
|
||||
title = "Bandage",
|
||||
item = "bandage"
|
||||
},
|
||||
}
|
||||
|
||||
Config.Hospitals = {
|
||||
|
||||
CentralLosSantos = {
|
||||
|
||||
@@ -72,40 +72,54 @@ function OpenCustomersMenu()
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local customer = element.data
|
||||
if element2.value == "deposit" then
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'customer_deposit_amount', {
|
||||
title = TranslateCap('amount')
|
||||
}, function(data2, menu2)
|
||||
local amount = tonumber(data2.value)
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-scroll", title = TranslateCap('amount')},
|
||||
{title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 250000, inputPlaceholder = "Amount to bill.."},
|
||||
{icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
|
||||
}
|
||||
|
||||
if amount == nil then
|
||||
ESX.ShowNotification(TranslateCap('invalid_amount'))
|
||||
else
|
||||
menu2.close()
|
||||
TriggerServerEvent('esx_bankerjob:customerDeposit', customer.source, amount)
|
||||
ESX.ShowNotification("You have deposited $"..amount.." into "..element.title.."s account.")
|
||||
OpenCustomersMenu()
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.val == "confirm" then
|
||||
local amount = tonumber(menu.eles[2].inputValue)
|
||||
|
||||
if amount == nil then
|
||||
ESX.ShowNotification(TranslateCap('invalid_amount'))
|
||||
else
|
||||
ESX.CloseContext()
|
||||
TriggerServerEvent('esx_bankerjob:customerDeposit', customer.source, amount)
|
||||
ESX.ShowNotification("You have deposited $"..amount.." into "..element.title.."s account.")
|
||||
OpenCustomersMenu()
|
||||
end
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
OpenCustomersMenu()
|
||||
end, function(menu)
|
||||
CurrentAction = 'bank_actions_menu'
|
||||
CurrentActionMsg = TranslateCap('press_input_context_to_open_menu')
|
||||
CurrentActionData = {}
|
||||
end)
|
||||
elseif element2.value == "withdraw" then
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'customer_withdraw_amount', {
|
||||
title = TranslateCap('amount')
|
||||
}, function(data2, menu2)
|
||||
local amount = tonumber(data2.value)
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-scroll", title = TranslateCap('amount')},
|
||||
{title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 250000, inputPlaceholder = "Amount to bill.."},
|
||||
{icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
|
||||
}
|
||||
|
||||
if amount == nil then
|
||||
ESX.ShowNotification(TranslateCap('invalid_amount'))
|
||||
else
|
||||
menu2.close()
|
||||
TriggerServerEvent('esx_bankerjob:customerWithdraw', customer.source, amount)
|
||||
ESX.ShowNotification("You have withdrawn $"..amount.." from "..element.title.."s account.")
|
||||
OpenCustomersMenu()
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.val == "confirm" then
|
||||
local amount = tonumber(menu.eles[2].inputValue)
|
||||
|
||||
if amount == nil then
|
||||
ESX.ShowNotification(TranslateCap('invalid_amount'))
|
||||
else
|
||||
ESX.CloseContext()
|
||||
TriggerServerEvent('esx_bankerjob:customerWithdraw', customer.source, amount)
|
||||
ESX.ShowNotification("You have withdrawn $"..amount.." from "..element.title.."s account.")
|
||||
OpenCustomersMenu()
|
||||
end
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
OpenCustomersMenu()
|
||||
end, function(menu)
|
||||
CurrentAction = 'bank_actions_menu'
|
||||
CurrentActionMsg = TranslateCap('press_input_context_to_open_menu')
|
||||
CurrentActionData = {}
|
||||
end)
|
||||
end
|
||||
end, function(menu)
|
||||
@@ -122,26 +136,34 @@ function OpenCustomersMenu()
|
||||
end
|
||||
|
||||
function CreateBillingDialog()
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'billing', {
|
||||
title = TranslateCap('bill_amount')
|
||||
}, function(data, menu)
|
||||
local amount = tonumber(data.value)
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-scroll", title = TranslateCap('bill_amount')},
|
||||
{title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 250000, inputPlaceholder = "Amount to bill.."},
|
||||
{icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
|
||||
}
|
||||
|
||||
if amount == nil then
|
||||
ESX.ShowNotification(TranslateCap('invalid_amount'))
|
||||
else
|
||||
menu.close()
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.val == "confirm" then
|
||||
local amount = tonumber(menu.eles[2].inputValue)
|
||||
|
||||
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
|
||||
|
||||
if closestPlayer == -1 or closestDistance > 5.0 then
|
||||
ESX.ShowNotification(TranslateCap('no_player_nearby'))
|
||||
if amount == nil then
|
||||
ESX.ShowNotification(TranslateCap('invalid_amount'))
|
||||
else
|
||||
TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_banker', 'Bank', amount)
|
||||
ESX.CloseContext()
|
||||
|
||||
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
|
||||
|
||||
if closestPlayer == -1 or closestDistance > 5.0 then
|
||||
ESX.ShowNotification(TranslateCap('no_player_nearby'))
|
||||
else
|
||||
TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_banker', 'Bank', amount)
|
||||
end
|
||||
end
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end, function(menu)
|
||||
CurrentAction = 'bank_actions_menu'
|
||||
CurrentActionMsg = TranslateCap('press_input_context_to_open_menu')
|
||||
CurrentActionData = {}
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ function ShowBillsMenu()
|
||||
end
|
||||
|
||||
RegisterCommand('showbills', function()
|
||||
if not isDead and not ESX.UI.Menu.IsOpen('default', GetCurrentResourceName(), 'billing') then
|
||||
if not isDead then
|
||||
ShowBillsMenu()
|
||||
end
|
||||
end, false)
|
||||
|
||||
@@ -5,97 +5,96 @@ function OpenBoatShop(shop)
|
||||
isInShopMenu = true
|
||||
|
||||
local playerPed = PlayerPedId()
|
||||
local elements = {}
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-ship", title = TranslateCap('boat_shop')}
|
||||
}
|
||||
|
||||
for k,v in ipairs(Config.Vehicles) do
|
||||
table.insert(elements, {
|
||||
label = ('%s - <span style="color:green;">$%s</span>'):format(v.label, ESX.Math.GroupDigits(v.price)),
|
||||
elements[#elements+1] = {
|
||||
icon = "fas fa-ship",
|
||||
title = ('%s - <span style="color:green;">$%s</span>'):format(v.label, ESX.Math.GroupDigits(v.price)),
|
||||
name = v.label,
|
||||
model = v.model,
|
||||
price = v.price,
|
||||
props = v.props or nil
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'boat_shop', {
|
||||
title = TranslateCap('boat_shop'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function (data, menu)
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'boat_shop_confirm', {
|
||||
title = TranslateCap('boat_shop_confirm', data.current.name, ESX.Math.GroupDigits(data.current.price)),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('confirm_no'), value = 'no'},
|
||||
{label = TranslateCap('confirm_yes'), value = 'yes'}
|
||||
}}, function (data2, menu2)
|
||||
if data2.current.value == 'yes' then
|
||||
local plate = exports['esx_vehicleshop']:GeneratePlate()
|
||||
local vehicle = GetVehiclePedIsIn(playerPed, false)
|
||||
local props = ESX.Game.GetVehicleProperties(vehicle)
|
||||
props.plate = plate
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-ship", title = element.title},
|
||||
{icon = "fas fa-eye", title = "View", val = "view"}
|
||||
}
|
||||
|
||||
ESX.TriggerServerCallback('esx_boat:buyBoat', function(bought)
|
||||
if bought then
|
||||
ESX.ShowNotification(TranslateCap('boat_shop_bought', data.current.name, ESX.Math.GroupDigits(data.current.price)))
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
if element2.val == "view" then
|
||||
DeleteSpawnedVehicles()
|
||||
|
||||
DeleteSpawnedVehicles()
|
||||
isInShopMenu = false
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.Game.SpawnLocalVehicle(element.model, shop.Inside, shop.Inside.w, function (vehicle)
|
||||
table.insert(spawnedVehicles, vehicle)
|
||||
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
|
||||
FreezeEntityPosition(vehicle, true)
|
||||
|
||||
CurrentAction = 'boat_shop'
|
||||
CurrentActionMsg = TranslateCap('boat_shop_open')
|
||||
|
||||
FreezeEntityPosition(playerPed, false)
|
||||
SetEntityVisible(playerPed, true)
|
||||
SetEntityCoords(playerPed, shop.Outside.x, shop.Outside.y, shop.Outside.z)
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('boat_shop_nomoney'))
|
||||
menu2.close()
|
||||
if element.props then
|
||||
ESX.Game.SetVehicleProperties(vehicle, element.props)
|
||||
end
|
||||
end, props)
|
||||
else
|
||||
menu2.close()
|
||||
end
|
||||
end, function (data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end, function (data, menu)
|
||||
menu.close()
|
||||
isInShopMenu = false
|
||||
DeleteSpawnedVehicles()
|
||||
|
||||
local elements3 = {
|
||||
{unselectable = true, icon = "fas fa-ship", title = element.title},
|
||||
{icon = "fas fa-check-double", title = "Buy", value = "buy"},
|
||||
{icon = "fas fa-eye", title = "Stop Viewing", value = "stop"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements3, function(menu3,element3)
|
||||
if element3.value == "buy" then
|
||||
local plate = exports['esx_vehicleshop']:GeneratePlate()
|
||||
local vehicle = GetVehiclePedIsIn(playerPed, false)
|
||||
local props = ESX.Game.GetVehicleProperties(vehicle)
|
||||
props.plate = plate
|
||||
|
||||
ESX.TriggerServerCallback('esx_boat:buyBoat', function(bought)
|
||||
if bought then
|
||||
ESX.ShowNotification(TranslateCap('boat_shop_bought', element.name, ESX.Math.GroupDigits(element.price)))
|
||||
|
||||
DeleteSpawnedVehicles()
|
||||
isInShopMenu = false
|
||||
ESX.CloseContext()
|
||||
|
||||
CurrentAction = 'boat_shop'
|
||||
CurrentActionMsg = TranslateCap('boat_shop_open')
|
||||
|
||||
FreezeEntityPosition(playerPed, false)
|
||||
SetEntityVisible(playerPed, true)
|
||||
SetEntityCoords(playerPed, shop.Outside.x, shop.Outside.y, shop.Outside.z)
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('boat_shop_nomoney'))
|
||||
ESX.CloseContext()
|
||||
end
|
||||
end, props)
|
||||
elseif element3.value == "stop" then
|
||||
isInShopMenu = false
|
||||
DeleteSpawnedVehicles()
|
||||
|
||||
CurrentAction = 'boat_shop'
|
||||
CurrentActionMsg = TranslateCap('boat_shop_open')
|
||||
|
||||
FreezeEntityPosition(playerPed, false)
|
||||
SetEntityVisible(playerPed, true)
|
||||
SetEntityCoords(playerPed, shop.Outside.x, shop.Outside.y, shop.Outside.z)
|
||||
ESX.CloseContext()
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
||||
end, function(menu)
|
||||
isInShopMenu = false
|
||||
CurrentAction = 'boat_shop'
|
||||
CurrentActionMsg = TranslateCap('boat_shop_open')
|
||||
end)
|
||||
end, function(menu)
|
||||
isInShopMenu = false
|
||||
CurrentAction = 'boat_shop'
|
||||
CurrentActionMsg = TranslateCap('boat_shop_open')
|
||||
|
||||
FreezeEntityPosition(playerPed, false)
|
||||
SetEntityVisible(playerPed, true)
|
||||
SetEntityCoords(playerPed, shop.Outside.x, shop.Outside.y, shop.Outside.z)
|
||||
end, function (data, menu)
|
||||
DeleteSpawnedVehicles()
|
||||
|
||||
ESX.Game.SpawnLocalVehicle(data.current.model, shop.Inside, shop.Inside.w, function (vehicle)
|
||||
table.insert(spawnedVehicles, vehicle)
|
||||
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
|
||||
FreezeEntityPosition(vehicle, true)
|
||||
|
||||
if data.current.props then
|
||||
ESX.Game.SetVehicleProperties(vehicle, data.current.props)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
-- spawn first vehicle
|
||||
DeleteSpawnedVehicles()
|
||||
|
||||
ESX.Game.SpawnLocalVehicle(Config.Vehicles[1].model, shop.Inside, shop.Inside.w, function (vehicle)
|
||||
table.insert(spawnedVehicles, vehicle)
|
||||
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
|
||||
FreezeEntityPosition(vehicle, true)
|
||||
|
||||
if Config.Vehicles[1].props then
|
||||
ESX.Game.SetVehicleProperties(vehicle, Config.Vehicles[1].props)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -105,24 +104,22 @@ function OpenBoatGarage(garage)
|
||||
ESX.ShowNotification(TranslateCap('garage_noboats'))
|
||||
else
|
||||
-- get all available boats
|
||||
local elements = {}
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-ship", title = TranslateCap('garage')}
|
||||
}
|
||||
for i=1, #ownedBoats, 1 do
|
||||
ownedBoats[i] = json.decode(ownedBoats[i])
|
||||
|
||||
table.insert(elements, {
|
||||
label = getVehicleLabelFromHash(ownedBoats[i].model),
|
||||
elements[#elements+1] = {
|
||||
icon = "fas fa-ship",
|
||||
title = getVehicleLabelFromHash(ownedBoats[i].model),
|
||||
vehicleProps = ownedBoats[i]
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'boat_garage', {
|
||||
title = TranslateCap('garage'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function (data, menu)
|
||||
-- make sure the spawn point isn't blocked
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local playerPed = PlayerPedId()
|
||||
local vehicleProps = data.current.vehicleProps
|
||||
local vehicleProps = element.vehicleProps
|
||||
|
||||
if ESX.Game.IsSpawnPointClear(garage.SpawnPoint, 4.0) then
|
||||
TriggerServerEvent('esx_boat:takeOutVehicle', vehicleProps.plate)
|
||||
@@ -133,13 +130,11 @@ function OpenBoatGarage(garage)
|
||||
ESX.Game.SetVehicleProperties(vehicle, vehicleProps)
|
||||
end)
|
||||
|
||||
menu.close()
|
||||
ESX.CloseContext()
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('garage_blocked'))
|
||||
end
|
||||
end, function (data, menu)
|
||||
menu.close()
|
||||
|
||||
end, function(menu)
|
||||
CurrentAction = 'garage_out'
|
||||
CurrentActionMsg = TranslateCap('garage_open')
|
||||
end)
|
||||
@@ -148,33 +143,36 @@ function OpenBoatGarage(garage)
|
||||
end
|
||||
|
||||
function OpenLicenceMenu(shop)
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'boat_license', {
|
||||
title = TranslateCap('license_menu'),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('license_buy_no'), value = 'no'},
|
||||
{label = TranslateCap('license_buy_yes', ESX.Math.GroupDigits(Config.LicensePrice)), value = 'yes'}
|
||||
}}, function (data, menu)
|
||||
if data.current.value == 'yes' then
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-ship", title = TranslateCap('license_menu')},
|
||||
{icon = "fas fa-ship", title = "Purchase Boat License"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-ship", title = element.title},
|
||||
{icon = "fas fa-check-double", title = TranslateCap('license_buy_yes'), val = "yes"},
|
||||
{icon = "fas fa-window-close", title = TranslateCap('license_buy_no'), val = "no"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
ESX.TriggerServerCallback('esx_boat:buyBoatLicense', function (boughtLicense)
|
||||
if boughtLicense then
|
||||
ESX.ShowNotification(TranslateCap('license_bought', ESX.Math.GroupDigits(Config.LicensePrice)))
|
||||
menu.close()
|
||||
ESX.CloseContext()
|
||||
|
||||
OpenBoatShop(shop) -- parse current shop
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('license_nomoney'))
|
||||
end
|
||||
end)
|
||||
else
|
||||
CurrentAction = 'boat_shop'
|
||||
end, function(menu)
|
||||
CurrentAction = 'boat_shop'
|
||||
CurrentActionMsg = TranslateCap('boat_shop_open')
|
||||
menu.close()
|
||||
end
|
||||
end, function (data, menu)
|
||||
CurrentAction = 'boat_shop'
|
||||
end)
|
||||
end, function(menu)
|
||||
CurrentAction = 'boat_shop'
|
||||
CurrentActionMsg = TranslateCap('boat_shop_open')
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ end)
|
||||
|
||||
AddEventHandler('esx_boat:hasExitedMarker', function()
|
||||
if not isInShopMenu then
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.CloseContext()
|
||||
end
|
||||
|
||||
CurrentAction = nil
|
||||
|
||||
@@ -33,18 +33,18 @@ function OpenShopMenu()
|
||||
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
if element2.value == "yes" then
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'outfit_name', {
|
||||
title = TranslateCap('name_outfit')
|
||||
}, function(data3, menu3)
|
||||
menu3.close()
|
||||
local elements3 = {
|
||||
{unselectable = true, icon = "fas fa-shirt", title = TranslateCap('name_outfit')},
|
||||
{title = "Outfit Name", input = true, inputType = "text", inputPlaceholder = "Outfit name in wardrobe.."},
|
||||
{icon = "fas fa-check-circle", title = "Confirm", value = "confirm"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements3, function(menu3,element3)
|
||||
TriggerEvent('skinchanger:getSkin', function(skin)
|
||||
ESX.CloseContext()
|
||||
TriggerServerEvent('esx_clotheshop:saveOutfit', data3.value, skin)
|
||||
TriggerServerEvent('esx_clotheshop:saveOutfit', menu3.eles[2].inputValue, skin)
|
||||
ESX.ShowNotification(TranslateCap('saved_outfit'))
|
||||
end)
|
||||
end, function(data3, menu3)
|
||||
menu3.close()
|
||||
end)
|
||||
elseif element2.value == "no" then
|
||||
ESX.CloseContext()
|
||||
|
||||
@@ -21,7 +21,6 @@ CreateThread(function()
|
||||
inZoneDrugShop = false
|
||||
if menuOpen then
|
||||
menuOpen=false
|
||||
ESX.UI.Menu.CloseAll()
|
||||
end
|
||||
end
|
||||
|
||||
@@ -62,36 +61,39 @@ CreateThread(function ()
|
||||
end)
|
||||
|
||||
function OpenDrugShop()
|
||||
ESX.UI.Menu.CloseAll()
|
||||
local elements = {}
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-cannabis", title = TranslateCap('dealer_title')}
|
||||
}
|
||||
menuOpen = true
|
||||
|
||||
for k, v in pairs(ESX.GetPlayerData().inventory) do
|
||||
local price = Config.DrugDealerItems[v.name]
|
||||
|
||||
if price and v.count > 0 then
|
||||
table.insert(elements, {
|
||||
label = ('%s - <span style="color:green;">%s</span>'):format(v.label, TranslateCap('dealer_item', ESX.Math.GroupDigits(price))),
|
||||
elements[#elements+1] = {
|
||||
icon = "fas fa-shopping-basket",
|
||||
title = ('%s - <span style="color:green;">%s</span>'):format(v.label, TranslateCap('dealer_item', ESX.Math.GroupDigits(price))),
|
||||
name = v.name,
|
||||
price = price,
|
||||
|
||||
-- menu properties
|
||||
type = 'slider',
|
||||
value = 1,
|
||||
min = 1,
|
||||
max = v.count
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'drug_shop', {
|
||||
title = TranslateCap('dealer_title'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
TriggerServerEvent('esx_drugs:sellDrug', data.current.name, data.current.value)
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-shopping-basket", title = element.title},
|
||||
{icon = "fas fa-shopping-basket", title = "Amount", input = true, inputType = "number", inputPlaceholder = "Amount you want to sell", inputMin = Config.SellMenu.Min, inputMax = Config.SellMenu.Max},
|
||||
{icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local amount = menu2.eles[2].inputValue
|
||||
ESX.CloseContext()
|
||||
TriggerServerEvent('esx_drugs:sellDrug', element.name, amount)
|
||||
end, function(menu)
|
||||
menuOpen = false
|
||||
end)
|
||||
end, function(menu)
|
||||
menuOpen = false
|
||||
end)
|
||||
end
|
||||
@@ -99,7 +101,7 @@ end
|
||||
AddEventHandler('onResourceStop', function(resource)
|
||||
if resource == GetCurrentResourceName() then
|
||||
if menuOpen then
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.CloseContext()
|
||||
end
|
||||
end
|
||||
end)
|
||||
@@ -109,39 +111,20 @@ function OpenBuyLicenseMenu(licenseName)
|
||||
local license = Config.LicensePrices[licenseName]
|
||||
|
||||
local elements = {
|
||||
{
|
||||
label = TranslateCap('license_no'),
|
||||
value = 'no'
|
||||
},
|
||||
|
||||
{
|
||||
label = ('%s - <span style="color:green;">%s</span>'):format(license.label, TranslateCap('dealer_item', ESX.Math.GroupDigits(license.price))),
|
||||
value = licenseName,
|
||||
price = license.price,
|
||||
licenseName = license.label
|
||||
}
|
||||
{unselectable = true, title = TranslateCap('purchase_license')},
|
||||
{title = ('%s - <span style="color:green;">%s</span>'):format(license.label, TranslateCap('dealer_item', ESX.Math.GroupDigits(license.price))), value = licenseName, price = license.price, licenseName = license.label}
|
||||
}
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'license_shop', {
|
||||
title = TranslateCap('license_title'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
|
||||
if data.current.value ~= 'no' then
|
||||
ESX.TriggerServerCallback('esx_drugs:buyLicense', function(boughtLicense)
|
||||
if boughtLicense then
|
||||
ESX.ShowNotification(TranslateCap('license_bought', data.current.licenseName, ESX.Math.GroupDigits(data.current.price)))
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('license_bought_fail', data.current.licenseName))
|
||||
end
|
||||
end, data.current.value)
|
||||
else
|
||||
menu.close()
|
||||
end
|
||||
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
ESX.TriggerServerCallback('esx_drugs:buyLicense', function(boughtLicense)
|
||||
if boughtLicense then
|
||||
ESX.CloseContext()
|
||||
ESX.ShowNotification(TranslateCap('license_bought', element.licenseName, ESX.Math.GroupDigits(element.price)))
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('license_bought_fail', element.licenseName))
|
||||
end
|
||||
end, element.value)
|
||||
end, function(menu)
|
||||
menuOpen = false
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -31,3 +31,10 @@ Config.Marker = {
|
||||
Size = vector3(1.5,1.5,1.0),
|
||||
Type = 1,
|
||||
}
|
||||
|
||||
-- min amount of Config.DrugDealerItems to sell
|
||||
-- max amount of Config.DrugDealerItems to sell
|
||||
Config.SellMenu = {
|
||||
Min = 1,
|
||||
Max = 50
|
||||
}
|
||||
|
||||
@@ -27,17 +27,14 @@ RegisterNetEvent('esx:setJob',function(job)
|
||||
end)
|
||||
|
||||
function OpenMenu()
|
||||
ESX.UI.Menu.CloseAll()
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-shirt", title = TranslateCap('cloakroom')},
|
||||
{icon = "fas fa-shirt", title = TranslateCap('job_wear'), value = "job_wear"},
|
||||
{icon = "fas fa-shirt", title = TranslateCap('citizen_wear'), value = "citizen_wear"},
|
||||
}
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'cloakroom',
|
||||
{
|
||||
title = TranslateCap('cloakroom'),
|
||||
elements = {
|
||||
{label = TranslateCap('job_wear'), value = 'job_wear'},
|
||||
{label = TranslateCap('citizen_wear'), value = 'citizen_wear'}
|
||||
}
|
||||
}, function(data, menu)
|
||||
if data.current.value == 'citizen_wear' then
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.value == "citizen_wear" then
|
||||
onDuty = false
|
||||
ESX.ShowNotification(TranslateCap('offduty'),"success")
|
||||
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
|
||||
@@ -49,7 +46,7 @@ function OpenMenu()
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
elseif data.current.value == 'job_wear' then
|
||||
elseif element.value == "job_wear" then
|
||||
onDuty = true
|
||||
ESX.ShowNotification(TranslateCap('onduty'), "success")
|
||||
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
|
||||
@@ -68,10 +65,6 @@ function OpenMenu()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
menu.close()
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
@@ -268,9 +268,9 @@ Locales['es'] = {
|
||||
['stickers'] = 'calcomanías',
|
||||
|
||||
-- Xenon Colors
|
||||
['mintgreen'] = 'Mint Green',
|
||||
['goldenshower'] = 'Golden Shower',
|
||||
['ponypink'] = 'Pony Pink',
|
||||
['hotpink'] = 'Hot Pink',
|
||||
['blacklight'] = 'Blacklight',
|
||||
['mintgreen'] = 'Menta verde',
|
||||
['goldenshower'] = 'Baño de oro',
|
||||
['ponypink'] = 'Poni rosa',
|
||||
['hotpink'] = 'Rosa caliente',
|
||||
['blacklight'] = 'Luz negra',
|
||||
}
|
||||
|
||||
@@ -54,44 +54,41 @@ end
|
||||
|
||||
function OpenMechanicActionsMenu()
|
||||
local elements = {
|
||||
{label = TranslateCap('vehicle_list'), value = 'vehicle_list'},
|
||||
{label = TranslateCap('work_wear'), value = 'cloakroom'},
|
||||
{label = TranslateCap('civ_wear'), value = 'cloakroom2'},
|
||||
{label = TranslateCap('deposit_stock'), value = 'put_stock'},
|
||||
{label = TranslateCap('withdraw_stock'), value = 'get_stock'}
|
||||
{unselectable = true, icon = "fas fa-gear", title = TranslateCap('mechanic')},
|
||||
{icon = "fas fa-car", title = TranslateCap('vehicle_list'), value = 'vehicle_list'},
|
||||
{icon = "fas fa-shirt", title = TranslateCap('work_wear'), value = 'cloakroom'},
|
||||
{icon = "fas fa-shirt", title = TranslateCap('civ_wear'), value = 'cloakroom2'},
|
||||
{icon = "fas fa-box", title = TranslateCap('deposit_stock'), value = 'put_stock'},
|
||||
{icon = "fas fa-box", title = TranslateCap('withdraw_stock'), value = 'get_stock'}
|
||||
}
|
||||
|
||||
if Config.EnablePlayerManagement and ESX.PlayerData.job and ESX.PlayerData.job.grade_name == 'boss' then
|
||||
table.insert(elements, {label = TranslateCap('boss_actions'), value = 'boss_actions'})
|
||||
elements[#elements+1] = {
|
||||
icon = 'fas fa-boss',
|
||||
title = TranslateCap('boss_actions'),
|
||||
value = 'boss_actions'
|
||||
}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.CloseAll()
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'mechanic_actions', {
|
||||
title = TranslateCap('mechanic'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
if data.current.value == 'vehicle_list' then
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.value == 'vehicle_list' then
|
||||
if Config.EnableSocietyOwnedVehicles then
|
||||
|
||||
local elements = {}
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-car", title = TranslateCap('service_vehicle')}
|
||||
}
|
||||
|
||||
ESX.TriggerServerCallback('esx_society:getVehiclesInGarage', function(vehicles)
|
||||
for i=1, #vehicles, 1 do
|
||||
table.insert(elements, {
|
||||
label = GetDisplayNameFromVehicleModel(vehicles[i].model) .. ' [' .. vehicles[i].plate .. ']',
|
||||
elements2[#elements2+1] = {
|
||||
icon = 'fas fa-car',
|
||||
title = GetDisplayNameFromVehicleModel(vehicles[i].model) .. ' [' .. vehicles[i].plate .. ']',
|
||||
value = vehicles[i]
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_spawner', {
|
||||
title = TranslateCap('service_vehicle'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
menu.close()
|
||||
local vehicleProps = data.current.value
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
ESX.CloseContext()
|
||||
local vehicleProps = element.value
|
||||
|
||||
ESX.Game.SpawnVehicle(vehicleProps.model, Config.Zones.VehicleSpawnPoint.Pos, 270.0, function(vehicle)
|
||||
ESX.Game.SetVehicleProperties(vehicle, vehicleProps)
|
||||
@@ -100,38 +97,35 @@ function OpenMechanicActionsMenu()
|
||||
end)
|
||||
|
||||
TriggerServerEvent('esx_society:removeVehicleFromGarage', 'mechanic', vehicleProps)
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end, 'mechanic')
|
||||
|
||||
else
|
||||
|
||||
local elements = {
|
||||
{label = TranslateCap('flat_bed'), value = 'flatbed'},
|
||||
{label = TranslateCap('tow_truck'), value = 'towtruck2'}
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-car", title = TranslateCap('service_vehicle')},
|
||||
{icon = "fas fa-truck", title = TranslateCap('flat_bed'), value = 'flatbed'},
|
||||
{icon = "fas fa-truck", title = TranslateCap('tow_truck'), value = 'towtruck2'}
|
||||
}
|
||||
|
||||
if Config.EnablePlayerManagement and ESX.PlayerData.job and (ESX.PlayerData.job.grade_name == 'boss' or ESX.PlayerData.job.grade_name == 'chief' or ESX.PlayerData.job.grade_name == 'experimente') then
|
||||
table.insert(elements, {label = 'SlamVan', value = 'slamvan3'})
|
||||
elements2[#elements2+1] = {
|
||||
icon = 'fas fa-truck',
|
||||
title = 'Slamvan',
|
||||
value = 'slamvan3'
|
||||
}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.CloseAll()
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'spawn_vehicle', {
|
||||
title = TranslateCap('service_vehicle'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
if Config.MaxInService == -1 then
|
||||
ESX.Game.SpawnVehicle(data.current.value, Config.Zones.VehicleSpawnPoint.Pos, 90.0, function(vehicle)
|
||||
ESX.CloseContext()
|
||||
ESX.Game.SpawnVehicle(element2.value, Config.Zones.VehicleSpawnPoint.Pos, 90.0, function(vehicle)
|
||||
local playerPed = PlayerPedId()
|
||||
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
|
||||
end)
|
||||
else
|
||||
ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount)
|
||||
if canTakeService then
|
||||
ESX.Game.SpawnVehicle(data.current.value, Config.Zones.VehicleSpawnPoint.Pos, 90.0, function(vehicle)
|
||||
ESX.CloseContext()
|
||||
ESX.Game.SpawnVehicle(element2.value, Config.Zones.VehicleSpawnPoint.Pos, 90.0, function(vehicle)
|
||||
local playerPed = PlayerPedId()
|
||||
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
|
||||
end)
|
||||
@@ -140,16 +134,10 @@ function OpenMechanicActionsMenu()
|
||||
end
|
||||
end, 'mechanic')
|
||||
end
|
||||
|
||||
menu.close()
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
OpenMechanicActionsMenu()
|
||||
end)
|
||||
|
||||
end
|
||||
elseif data.current.value == 'cloakroom' then
|
||||
menu.close()
|
||||
elseif element.value == 'cloakroom' then
|
||||
ESX.CloseContext()
|
||||
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
|
||||
if skin.sex == 0 then
|
||||
TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_male)
|
||||
@@ -157,27 +145,24 @@ function OpenMechanicActionsMenu()
|
||||
TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female)
|
||||
end
|
||||
end)
|
||||
elseif data.current.value == 'cloakroom2' then
|
||||
menu.close()
|
||||
elseif element.value == 'cloakroom2' then
|
||||
ESX.CloseContext()
|
||||
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
|
||||
TriggerEvent('skinchanger:loadSkin', skin)
|
||||
end)
|
||||
|
||||
elseif Config.OxInventory and (data.current.value == 'put_stock' or data.current.value == 'get_stock') then
|
||||
elseif Config.OxInventory and (element.value == 'put_stock' or element.value == 'get_stock') then
|
||||
exports.ox_inventory:openInventory('stash', 'society_mechanic')
|
||||
return ESX.UI.Menu.CloseAll()
|
||||
elseif data.current.value == 'put_stock' then
|
||||
return ESX.CloseContext()
|
||||
elseif element.value == 'put_stock' then
|
||||
OpenPutStocksMenu()
|
||||
elseif data.current.value == 'get_stock' then
|
||||
elseif element.value == 'get_stock' then
|
||||
OpenGetStocksMenu()
|
||||
elseif data.current.value == 'boss_actions' then
|
||||
elseif element.value == 'boss_actions' then
|
||||
TriggerEvent('esx_society:openBossMenu', 'mechanic', function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
|
||||
end, function(menu)
|
||||
CurrentAction = 'mechanic_actions_menu'
|
||||
CurrentActionMsg = TranslateCap('open_actions')
|
||||
CurrentActionData = {}
|
||||
@@ -187,29 +172,21 @@ end
|
||||
function OpenMechanicHarvestMenu()
|
||||
if Config.EnablePlayerManagement and ESX.PlayerData.job and ESX.PlayerData.job.grade_name ~= 'recrue' then
|
||||
local elements = {
|
||||
{label = TranslateCap('gas_can'), value = 'gaz_bottle'},
|
||||
{label = TranslateCap('repair_tools'), value = 'fix_tool'},
|
||||
{label = TranslateCap('body_work_tools'), value = 'caro_tool'}
|
||||
{unselectable = true, icon = "fas fa-gear", title = "Mechanic Harvest Menu"},
|
||||
{icon = "fas fa-gear", title = TranslateCap('gas_can'), value = 'gaz_bottle'},
|
||||
{icon = "fas fa-gear", title = TranslateCap('repair_tools'), value = 'fix_tool'},
|
||||
{icon = "fas fa-gear", title = TranslateCap('body_work_tools'), value = 'caro_tool'}
|
||||
}
|
||||
|
||||
ESX.UI.Menu.CloseAll()
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'mechanic_harvest', {
|
||||
title = TranslateCap('harvest'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
menu.close()
|
||||
|
||||
if data.current.value == 'gaz_bottle' then
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.value == 'gaz_bottle' then
|
||||
TriggerServerEvent('esx_mechanicjob:startHarvest')
|
||||
elseif data.current.value == 'fix_tool' then
|
||||
elseif element.value == 'fix_tool' then
|
||||
TriggerServerEvent('esx_mechanicjob:startHarvest2')
|
||||
elseif data.current.value == 'caro_tool' then
|
||||
elseif element.value == 'caro_tool' then
|
||||
TriggerServerEvent('esx_mechanicjob:startHarvest3')
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end, function(menu)
|
||||
CurrentAction = 'mechanic_harvest_menu'
|
||||
CurrentActionMsg = TranslateCap('harvest_menu')
|
||||
CurrentActionData = {}
|
||||
@@ -222,30 +199,21 @@ end
|
||||
function OpenMechanicCraftMenu()
|
||||
if Config.EnablePlayerManagement and ESX.PlayerData.job and ESX.PlayerData.job.grade_name ~= 'recrue' then
|
||||
local elements = {
|
||||
{label = TranslateCap('blowtorch'), value = 'blow_pipe'},
|
||||
{label = TranslateCap('repair_kit'), value = 'fix_kit'},
|
||||
{label = TranslateCap('body_kit'), value = 'caro_kit'}
|
||||
{unselectable = true, icon = "fas fa-gear", title = "Mechanic Craft Menu"},
|
||||
{icon = "fas fa-gear", title = TranslateCap('blowtorch'), value = 'blow_pipe'},
|
||||
{icon = "fas fa-gear", title = TranslateCap('repair_kit'), value = 'fix_kit'},
|
||||
{icon = "fas fa-gear", title = TranslateCap('body_kit'), value = 'caro_kit'}
|
||||
}
|
||||
|
||||
ESX.UI.Menu.CloseAll()
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'mechanic_craft', {
|
||||
title = TranslateCap('craft'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
menu.close()
|
||||
|
||||
if data.current.value == 'blow_pipe' then
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.value == 'blow_pipe' then
|
||||
TriggerServerEvent('esx_mechanicjob:startCraft')
|
||||
elseif data.current.value == 'fix_kit' then
|
||||
elseif element.value == 'fix_kit' then
|
||||
TriggerServerEvent('esx_mechanicjob:startCraft2')
|
||||
elseif data.current.value == 'caro_kit' then
|
||||
elseif element.value == 'caro_kit' then
|
||||
TriggerServerEvent('esx_mechanicjob:startCraft3')
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
|
||||
end, function(menu)
|
||||
CurrentAction = 'mechanic_craft_menu'
|
||||
CurrentActionMsg = TranslateCap('craft_menu')
|
||||
CurrentActionData = {}
|
||||
@@ -256,27 +224,29 @@ function OpenMechanicCraftMenu()
|
||||
end
|
||||
|
||||
function OpenMobileMechanicActionsMenu()
|
||||
ESX.UI.Menu.CloseAll()
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-gear", title = TranslateCap('mechanic')},
|
||||
{icon = "fas fa-gear", title = TranslateCap('billing'), value = 'billing'},
|
||||
{icon = "fas fa-gear", title = TranslateCap('hijack'), value = 'hijack_vehicle'},
|
||||
{icon = "fas fa-gear", title = TranslateCap('repair'), value = 'fix_vehicle'},
|
||||
{icon = "fas fa-gear", title = TranslateCap('clean'), value = 'clean_vehicle'},
|
||||
{icon = "fas fa-gear", title = TranslateCap('imp_veh'), value = 'del_vehicle'},
|
||||
{icon = "fas fa-gear", title = TranslateCap('flat_bed'), value = 'dep_vehicle'},
|
||||
{icon = "fas fa-gear", title = TranslateCap('place_objects'), value = 'object_spawner'}
|
||||
}
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'mobile_mechanic_actions', {
|
||||
title = TranslateCap('mechanic'),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('billing'), value = 'billing'},
|
||||
{label = TranslateCap('hijack'), value = 'hijack_vehicle'},
|
||||
{label = TranslateCap('repair'), value = 'fix_vehicle'},
|
||||
{label = TranslateCap('clean'), value = 'clean_vehicle'},
|
||||
{label = TranslateCap('imp_veh'), value = 'del_vehicle'},
|
||||
{label = TranslateCap('flat_bed'), value = 'dep_vehicle'},
|
||||
{label = TranslateCap('place_objects'), value = 'object_spawner'}
|
||||
}}, function(data, menu)
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if isBusy then return end
|
||||
|
||||
if data.current.value == 'billing' then
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'billing', {
|
||||
title = TranslateCap('invoice_amount')
|
||||
}, function(data, menu)
|
||||
local amount = tonumber(data.value)
|
||||
if element.value == "billing" then
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-scroll", title = element.title},
|
||||
{title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 250000, inputPlaceholder = "Amount to bill.."},
|
||||
{icon = "fas fa-check-double", title = "Confirm", value = "confirm"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local amount = tonumber(menu2.eles[2].inputValue)
|
||||
|
||||
if amount == nil or amount < 0 then
|
||||
ESX.ShowNotification(TranslateCap('amount_invalid'), "error")
|
||||
@@ -289,10 +259,8 @@ function OpenMobileMechanicActionsMenu()
|
||||
TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_mechanic', TranslateCap('mechanic'), amount)
|
||||
end
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
elseif data.current.value == 'hijack_vehicle' then
|
||||
elseif element.value == "hijack_vehicle" then
|
||||
local playerPed = PlayerPedId()
|
||||
local vehicle = ESX.Game.GetVehicleInDirection()
|
||||
local coords = GetEntityCoords(playerPed)
|
||||
@@ -318,7 +286,7 @@ function OpenMobileMechanicActionsMenu()
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('no_vehicle_nearby'))
|
||||
end
|
||||
elseif data.current.value == 'fix_vehicle' then
|
||||
elseif element.value == "fix_vehicle" then
|
||||
local playerPed = PlayerPedId()
|
||||
local vehicle = ESX.Game.GetVehicleInDirection()
|
||||
local coords = GetEntityCoords(playerPed)
|
||||
@@ -346,7 +314,7 @@ function OpenMobileMechanicActionsMenu()
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('no_vehicle_nearby'))
|
||||
end
|
||||
elseif data.current.value == 'clean_vehicle' then
|
||||
elseif element.value == "clean_vehicle" then
|
||||
local playerPed = PlayerPedId()
|
||||
local vehicle = ESX.Game.GetVehicleInDirection()
|
||||
local coords = GetEntityCoords(playerPed)
|
||||
@@ -371,7 +339,7 @@ function OpenMobileMechanicActionsMenu()
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('no_vehicle_nearby'))
|
||||
end
|
||||
elseif data.current.value == 'del_vehicle' then
|
||||
elseif element.value == "del_vehicle" then
|
||||
local playerPed = PlayerPedId()
|
||||
|
||||
if IsPedSittingInAnyVehicle(playerPed) then
|
||||
@@ -393,7 +361,7 @@ function OpenMobileMechanicActionsMenu()
|
||||
ESX.ShowNotification(TranslateCap('must_near'))
|
||||
end
|
||||
end
|
||||
elseif data.current.value == 'dep_vehicle' then
|
||||
elseif element.value == "dep_vehicle" then
|
||||
local playerPed = PlayerPedId()
|
||||
local vehicle = GetVehiclePedIsIn(playerPed, true)
|
||||
|
||||
@@ -459,7 +427,7 @@ function OpenMobileMechanicActionsMenu()
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('imp_flatbed'))
|
||||
end
|
||||
elseif data.current.value == 'object_spawner' then
|
||||
elseif element.value == "object_spawner" then
|
||||
local playerPed = PlayerPedId()
|
||||
|
||||
if IsPedSittingInAnyVehicle(playerPed) then
|
||||
@@ -467,14 +435,14 @@ function OpenMobileMechanicActionsMenu()
|
||||
return
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'mobile_mechanic_actions_spawn', {
|
||||
title = TranslateCap('objects'),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = TranslateCap('roadcone'), value = 'prop_roadcone02a'},
|
||||
{label = TranslateCap('toolbox'), value = 'prop_toolchest_01'}
|
||||
}}, function(data2, menu2)
|
||||
local model = data2.current.value
|
||||
local elements2 = {
|
||||
{unselectable= true, icon = "fas fa-object", title = TranslateCap('objects')},
|
||||
{icon = "fas fa-object", title = TranslateCap('roadcone'), value = 'prop_roadcone02a'},
|
||||
{icon = "fas fa-object", title = TranslateCap('toolbox'), value = 'prop_toolchest_01'}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements2, function(menuObj,elementObj)
|
||||
local model = elementObj.value
|
||||
local coords = GetEntityCoords(playerPed)
|
||||
local forward = GetEntityForwardVector(playerPed)
|
||||
local x, y, z = table.unpack(coords + forward * 1.0)
|
||||
@@ -489,100 +457,92 @@ function OpenMobileMechanicActionsMenu()
|
||||
SetEntityHeading(obj, GetEntityHeading(playerPed))
|
||||
PlaceObjectOnGroundProperly(obj)
|
||||
end)
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end
|
||||
|
||||
function OpenGetStocksMenu()
|
||||
ESX.TriggerServerCallback('esx_mechanicjob:getStockItems', function(items)
|
||||
local elements = {}
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-box", title = TranslateCap('mechanic_stock')}
|
||||
}
|
||||
|
||||
for i=1, #items, 1 do
|
||||
table.insert(elements, {
|
||||
label = 'x' .. items[i].count .. ' ' .. items[i].label,
|
||||
elements[#elements+1] = {
|
||||
icon = 'fas fa-box',
|
||||
title = 'x' .. items[i].count .. ' ' .. items[i].label,
|
||||
value = items[i].name
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', {
|
||||
title = TranslateCap('mechanic_stock'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
local itemName = data.current.value
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local itemName = element.value
|
||||
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', {
|
||||
title = TranslateCap('quantity')
|
||||
}, function(data2, menu2)
|
||||
local count = tonumber(data2.value)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-box", title = element.title},
|
||||
{title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 100, inputPlaceholder = "Amount to withdraw.."},
|
||||
{icon = "fas fa-check-double", title = "Confirm", value = "confirm"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local count = tonumber(menu2.eles[2].inputValue)
|
||||
|
||||
if count == nil then
|
||||
ESX.ShowNotification(TranslateCap('invalid_quantity'))
|
||||
else
|
||||
menu2.close()
|
||||
menu.close()
|
||||
ESX.CloseContext()
|
||||
TriggerServerEvent('esx_mechanicjob:getStockItem', itemName, count)
|
||||
|
||||
Wait(1000)
|
||||
OpenGetStocksMenu()
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
function OpenPutStocksMenu()
|
||||
ESX.TriggerServerCallback('esx_mechanicjob:getPlayerInventory', function(inventory)
|
||||
local elements = {}
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-box", title = TranslateCap('inventory')}
|
||||
}
|
||||
|
||||
for i=1, #inventory.items, 1 do
|
||||
local item = inventory.items[i]
|
||||
|
||||
if item.count > 0 then
|
||||
table.insert(elements, {
|
||||
label = item.label .. ' x' .. item.count,
|
||||
elements[#elements+1] = {
|
||||
icon = 'fas fa-box',
|
||||
title = item.label .. ' x' .. item.count,
|
||||
type = 'item_standard',
|
||||
value = item.name
|
||||
})
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', {
|
||||
title = TranslateCap('inventory'),
|
||||
align = 'top-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
local itemName = data.current.value
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local itemName = element.value
|
||||
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', {
|
||||
title = TranslateCap('quantity')
|
||||
}, function(data2, menu2)
|
||||
local count = tonumber(data2.value)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-box", title = element.title},
|
||||
{title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 100, inputPlaceholder = "Amount to deposit.."},
|
||||
{icon = "fas fa-check-double", title = "Confirm", value = "confirm"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local count = tonumber(menu2.eles[2].inputValue)
|
||||
|
||||
if count == nil then
|
||||
ESX.ShowNotification(TranslateCap('invalid_quantity'))
|
||||
else
|
||||
menu2.close()
|
||||
menu.close()
|
||||
ESX.CloseContext()
|
||||
TriggerServerEvent('esx_mechanicjob:putStockItems', itemName, count)
|
||||
|
||||
Wait(1000)
|
||||
OpenPutStocksMenu()
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
end)
|
||||
end
|
||||
@@ -738,7 +698,7 @@ AddEventHandler('esx_mechanicjob:hasExitedMarker', function(zone)
|
||||
end
|
||||
|
||||
CurrentAction = nil
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.CloseContext()
|
||||
end)
|
||||
|
||||
AddEventHandler('esx_mechanicjob:hasEnteredEntityZone', function(entity)
|
||||
|
||||
@@ -2,49 +2,39 @@ local hasAlreadyEnteredMarker, lastZone
|
||||
local currentAction, currentActionMsg, currentActionData = nil, nil, {}
|
||||
|
||||
function OpenShopMenu(zone)
|
||||
local elements = {}
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-shopping-basket", title = TranslateCap('shop') }
|
||||
}
|
||||
|
||||
for i=1, #Config.Zones[zone].Items, 1 do
|
||||
local item = Config.Zones[zone].Items[i]
|
||||
|
||||
table.insert(elements, {
|
||||
label = ('%s - <span style="color:green;">%s</span>'):format(item.label, TranslateCap('shop_item', ESX.Math.GroupDigits(item.price))),
|
||||
elements[#elements+1] = {
|
||||
icon = "fas fa-shopping-basket",
|
||||
title = ('%s - <span style="color:green;">%s</span>'):format(item.label, TranslateCap('shop_item', ESX.Math.GroupDigits(item.price))),
|
||||
itemLabel = item.label,
|
||||
item = item.name,
|
||||
price = item.price,
|
||||
|
||||
-- menu properties
|
||||
value = 1,
|
||||
type = 'slider',
|
||||
min = 1,
|
||||
max = 100
|
||||
})
|
||||
item = item.name,
|
||||
price = item.price
|
||||
}
|
||||
end
|
||||
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-shopping-basket", title = element.title},
|
||||
{icon = "fas fa-shopping-basket", title = "Amount", input = true, inputType = "number", inputPlaceholder = "Amount you want to buy", inputMin = 1, inputMax = 25},
|
||||
{icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
|
||||
}
|
||||
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'shop', {
|
||||
title = TranslateCap('shop'),
|
||||
align = 'bottom-left',
|
||||
elements = elements
|
||||
}, function(data, menu)
|
||||
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'shop_confirm', {
|
||||
title = TranslateCap('shop_confirm', data.current.value, data.current.itemLabel, ESX.Math.GroupDigits(data.current.price * data.current.value)),
|
||||
align = 'bottom-left',
|
||||
elements = {
|
||||
{label = TranslateCap('no'), value = 'no'},
|
||||
{label = TranslateCap('yes'), value = 'yes'}
|
||||
}}, function(data2, menu2)
|
||||
if data2.current.value == 'yes' then
|
||||
TriggerServerEvent('esx_shops:buyItem', data.current.item, data.current.value, zone)
|
||||
end
|
||||
|
||||
menu2.close()
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local amount = menu2.eles[2].inputValue
|
||||
ESX.CloseContext()
|
||||
TriggerServerEvent('esx_shops:buyItem', element.item, amount, zone)
|
||||
end, function(menu)
|
||||
currentAction = 'shop_menu'
|
||||
currentActionMsg = TranslateCap('press_menu')
|
||||
currentActionData = {zone = zone}
|
||||
end)
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
|
||||
end, function(menu)
|
||||
currentAction = 'shop_menu'
|
||||
currentActionMsg = TranslateCap('press_menu')
|
||||
currentActionData = {zone = zone}
|
||||
@@ -59,7 +49,7 @@ end)
|
||||
|
||||
AddEventHandler('esx_shops:hasExitedMarker', function(zone)
|
||||
currentAction = nil
|
||||
ESX.UI.Menu.CloseAll()
|
||||
ESX.CloseContext()
|
||||
end)
|
||||
|
||||
-- Create Blips
|
||||
|
||||
@@ -238,15 +238,18 @@ function OpenMobileTaxiActionsMenu()
|
||||
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.value == "billing" then
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'billing', {
|
||||
title = TranslateCap('invoice_amount')
|
||||
}, function(data, menu)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-taxi", title = element.title},
|
||||
{title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 250000, inputPlaceholder = "Amount to bill.."},
|
||||
{icon = "fas fa-check-double", title = "Confirm", value = "confirm"}
|
||||
}
|
||||
|
||||
local amount = tonumber(data.value)
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local amount = tonumber(menu2.eles[2].inputValue)
|
||||
if amount == nil then
|
||||
ESX.ShowNotification(TranslateCap('amount_invalid'))
|
||||
else
|
||||
menu.close()
|
||||
ESX.CloseContext()
|
||||
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
|
||||
if closestPlayer == -1 or closestDistance > 3.0 then
|
||||
ESX.ShowNotification(TranslateCap('no_players_near'))
|
||||
@@ -256,8 +259,6 @@ function OpenMobileTaxiActionsMenu()
|
||||
ESX.ShowNotification(TranslateCap('billing_sent'))
|
||||
end
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
elseif element.value == "start_job" then
|
||||
if OnJob then
|
||||
@@ -322,24 +323,24 @@ function OpenGetStocksMenu()
|
||||
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local itemName = element.value
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', {
|
||||
title = TranslateCap('quantity')
|
||||
}, function(data2, menu2)
|
||||
local count = tonumber(data2.value)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-box", title = element.title},
|
||||
{title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 100, inputPlaceholder = "Amount to withdraw.."},
|
||||
{icon = "fas fa-check-double", title = "Confirm", value = "confirm"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local count = tonumber(menu2.eles[2].inputValue)
|
||||
|
||||
if count == nil then
|
||||
ESX.ShowNotification(TranslateCap('quantity_invalid'))
|
||||
else
|
||||
menu2.close()
|
||||
ESX.CloseContext()
|
||||
|
||||
-- todo: refresh on callback
|
||||
TriggerServerEvent('esx_taxijob:getStockItem', itemName, count)
|
||||
|
||||
Wait(1000)
|
||||
OpenGetStocksMenu()
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end)
|
||||
end, function(menu)
|
||||
@@ -370,24 +371,24 @@ function OpenPutStocksMenu()
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local itemName = element.value
|
||||
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', {
|
||||
title = TranslateCap('quantity')
|
||||
}, function(data2, menu2)
|
||||
local count = tonumber(data2.value)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-box", title = element.title},
|
||||
{title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 100, inputPlaceholder = "Amount to deposit.."},
|
||||
{icon = "fas fa-check-double", title = "Confirm", value = "confirm"}
|
||||
}
|
||||
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local count = tonumber(menu2.eles[2].inputValue)
|
||||
|
||||
if count == nil then
|
||||
ESX.ShowNotification(TranslateCap('quantity_invalid'))
|
||||
else
|
||||
menu2.close()
|
||||
else
|
||||
ESX.CloseContext()
|
||||
|
||||
-- todo: refresh on callback
|
||||
TriggerServerEvent('esx_taxijob:putStockItems', itemName, count)
|
||||
Wait(1000)
|
||||
OpenPutStocksMenu()
|
||||
end
|
||||
end, function(data2, menu2)
|
||||
menu2.close()
|
||||
end)
|
||||
end)
|
||||
end, function(menu)
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
Locales['it'] = {
|
||||
-- cloakroom
|
||||
['cloakroom_menu'] = 'guardaroba',
|
||||
['cloakroom_prompt'] = 'premi [E] per accedere al guardaroba.',
|
||||
['wear_citizen'] = 'abbigliamento cittadino',
|
||||
['wear_work'] = 'abiti da lavoro',
|
||||
|
||||
-- garage
|
||||
['spawner_prompt'] = 'premi [E] per accedere al garage.',
|
||||
["vehicle_spawned"] = "generato con successo un ~b~Taxi!",
|
||||
['store_veh'] = 'premi [E] per depositare il veicolo',
|
||||
['spawn_veh'] = 'genera veicolo',
|
||||
['spawnpoint_blocked'] = 'un veicolo blocca lo spawnpoint!',
|
||||
['only_taxi'] = 'puoi depositare solo taxi.',
|
||||
['empty_garage'] = 'nessun veicolo nel garage!',
|
||||
|
||||
['taking_service'] = 'prendi servizio: Taxi/Uber',
|
||||
['full_service'] = 'servizio completo: ',
|
||||
['amount_invalid'] = 'importo non valido',
|
||||
['press_to_open'] = 'premi [E] per accedere al menu',
|
||||
['billing'] = 'fattura',
|
||||
['billing_sent'] = 'la fattura è stata registrata!',
|
||||
['invoice_amount'] = 'importo fattura',
|
||||
['no_players_near'] = 'nessun giocatore nelle vicinanze',
|
||||
['start_job'] = 'inizia / interrompi la guida di lavori NPC',
|
||||
['drive_search_pass'] = 'guida alla ricerca di passeggeri',
|
||||
['customer_found'] = 'hai trovato un cliente avvicinati a lui',
|
||||
['client_unconcious'] = 'il tuo cliente è ~r~incosciente, cercane un altro',
|
||||
['arrive_dest'] = 'sei arrivato a destinazione',
|
||||
['take_me_to_near'] = 'portami a %s, vicino a %s',
|
||||
['take_me_to'] = 'portami a %s',
|
||||
['close_to_client'] = 'sei troppo lontano dal cliente, avvicinati a lui',
|
||||
['return_to_veh'] = 'torna al tuo veicolo per continuare la missione',
|
||||
['must_in_taxi'] = 'devi essere in un taxi per iniziare la missione',
|
||||
['must_in_vehicle'] = 'devi essere in un veicolo per iniziare la missione',
|
||||
['not_in_taxi'] = 'Hai lasciato il taxi mentre eri in missione!',
|
||||
['have_earned'] = 'hai guadagnato $%s',
|
||||
['comp_earned'] = '- la tua azienda ha guadagnato $%s \n - hai guadagnato $%s',
|
||||
['deposit_stock'] = 'deposito',
|
||||
['take_stock' ] = 'prendi',
|
||||
['empty_stock'] = 'deposito vuoto!',
|
||||
['empty_your_inventory'] = 'Svuota il tuo inventario!' ,
|
||||
['boss_actions'] = 'Azioni del capo',
|
||||
['mission_complete'] = 'missione completata',
|
||||
['quantity' ] = 'quantità',
|
||||
['quantity_invalid'] = 'questa quantità non è valida!',
|
||||
['inventory'] = 'inventario',
|
||||
['taxi_client'] = 'cliente taxi',
|
||||
['have_withdrawn'] = 'hai prelevato x%s %s',
|
||||
['have_deposited'] = 'hai depositato x%s %s',
|
||||
['player_cannot_hold'] = '~r~non hai abbastanza spazio libero nel tuo inventario!',
|
||||
['blip_taxi'] = 'Downtown Cab Co.',
|
||||
['phone_taxi' ] = ' downtown Cab Co.',
|
||||
['taxi' ] = 'taxi',
|
||||
['taxi_stock'] = 'deposito dei taxi',
|
||||
['menu_return'] = 'Ritorno'
|
||||
}
|
||||
@@ -99,12 +99,13 @@ end)
|
||||
RegisterNetEvent('esx_taxijob:putStockItems')
|
||||
AddEventHandler('esx_taxijob:putStockItems', function(itemName, count)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
|
||||
local sourceItem = xPlayer.getInventoryItem(itemName)
|
||||
|
||||
if xPlayer.job.name == 'taxi' then
|
||||
TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory)
|
||||
local item = inventory.getItem(itemName)
|
||||
|
||||
if item.count > 0 then
|
||||
if sourceItem.count >= count and count > 0 then
|
||||
xPlayer.removeInventoryItem(itemName, count)
|
||||
inventory.addItem(itemName, count)
|
||||
xPlayer.showNotification(TranslateCap('have_deposited', count, item.label))
|
||||
|
||||
Reference in New Issue
Block a user