Merge branch 'develop' into locale-update

This commit is contained in:
Csoki
2022-12-15 13:43:56 +01:00
committed by GitHub
30 changed files with 1167 additions and 1046 deletions
-2
View File
@@ -1,5 +1,3 @@
# These are supported funding model platforms # These are supported funding model platforms
patreon: esx patreon: esx
ko_fi: esxframework
custom: https://esx-framework.tebex.io
-6
View File
@@ -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() exports('getSharedObject', function()
return ESX return ESX
end) end)
+113 -117
View File
@@ -1088,22 +1088,26 @@ end
function ESX.ShowInventory() function ESX.ShowInventory()
local playerPed = ESX.PlayerData.ped 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 for i=1, #(ESX.PlayerData.accounts) do
if ESX.PlayerData.accounts[i].money > 0 then if ESX.PlayerData.accounts[i].money > 0 then
local formattedMoney = TranslateCap('locale_currency', ESX.Math.GroupDigits(ESX.PlayerData.accounts[i].money)) local formattedMoney = TranslateCap('locale_currency', ESX.Math.GroupDigits(ESX.PlayerData.accounts[i].money))
local canDrop = ESX.PlayerData.accounts[i].name ~= 'bank' local canDrop = ESX.PlayerData.accounts[i].name ~= 'bank'
table.insert(elements, { elements[#elements+1] = {
label = ('%s: <span style="color:green;">%s</span>'):format(ESX.PlayerData.accounts[i].label, formattedMoney), 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, count = ESX.PlayerData.accounts[i].money,
type = 'item_account', type = 'item_account',
value = ESX.PlayerData.accounts[i].name, value = ESX.PlayerData.accounts[i].name,
usable = false, usable = false,
rare = false, rare = false,
canRemove = canDrop canRemove = canDrop
}) }
end end
end end
@@ -1111,15 +1115,16 @@ function ESX.ShowInventory()
if v.count > 0 then if v.count > 0 then
currentWeight = currentWeight + (v.weight * v.count) currentWeight = currentWeight + (v.weight * v.count)
table.insert(elements, { elements[#elements+1] = {
label = ('%s x%s'):format(v.label, v.count), icon = 'fas fa-box',
title = ('%s x%s'):format(v.label, v.count),
count = v.count, count = v.count,
type = 'item_standard', type = 'item_standard',
value = v.name, value = v.name,
usable = v.usable, usable = v.usable,
rare = v.rare, rare = v.rare,
canRemove = v.canRemove canRemove = v.canRemove
}) }
end end
end end
@@ -1135,8 +1140,9 @@ function ESX.ShowInventory()
label = v.label label = v.label
end end
table.insert(elements, { elements[#elements+1] = {
label = label, icon = 'fas fa-gun',
title = label,
count = 1, count = 1,
type = 'item_weapon', type = 'item_weapon',
value = v.name, value = v.name,
@@ -1145,76 +1151,80 @@ function ESX.ShowInventory()
ammo = ammo, ammo = ammo,
canGiveAmmo = (v.ammo ~= nil), canGiveAmmo = (v.ammo ~= nil),
canRemove = true canRemove = true
}) }
end end
end end
ESX.UI.Menu.CloseAll() elements[#elements+1] = {
unselectable = true,
icon = "fas fa-weight",
title = "Current Weight: "..currentWeight
}
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'inventory', { ESX.CloseContext()
title = TranslateCap('inventory', currentWeight, ESX.PlayerData.maxWeight),
align = 'bottom-right', ESX.OpenContext("right", elements, function(menu,element)
elements = elements
}, function(data, menu)
menu.close()
local player, distance = ESX.Game.GetClosestPlayer() local player, distance = ESX.Game.GetClosestPlayer()
elements = {}
if data.current.usable then elements2 = {}
table.insert(elements, {
label = TranslateCap('use'), if element.usable then
elements2[#elements2+1] = {
icon = "fas fa-utensils",
title = TranslateCap('use'),
action = 'use', action = 'use',
type = data.current.type, type = element.type,
value = data.current.value value = element.value
}) }
end end
if data.current.canRemove then if element.canRemove then
if player ~= -1 and distance <= 3.0 then if player ~= -1 and distance <= 3.0 then
table.insert(elements, { elements2[#elements2+1] = {
label = TranslateCap('give'), icon = "fas fa-hands",
title = TranslateCap('give'),
action = 'give', action = 'give',
type = data.current.type, type = element.type,
value = data.current.value value = element.value
}) }
end end
table.insert(elements, { elements2[#elements2+1] = {
label = TranslateCap('remove'), icon = "fas fa-trash",
title = TranslateCap('remove'),
action = 'remove', action = 'remove',
type = data.current.type, type = element.type,
value = data.current.value value = element.value
}) }
end end
if data.current.type == 'item_weapon' and data.current.canGiveAmmo and data.current.ammo > 0 and player ~= -1 and if element.type == 'item_weapon' and element.canGiveAmmo and element.ammo > 0 and player ~= -1 and distance <= 3.0 then
distance <= 3.0 then elements2[#elements2+1] = {
table.insert(elements, { icon = "fas fa-gun",
label = TranslateCap('giveammo'), title = TranslateCap('giveammo'),
action = 'give_ammo', action = 'give_ammo',
type = data.current.type, type = element.type,
value = data.current.value value = element.value
}) }
end end
table.insert(elements, { elements2[#elements2+1] = {
label = TranslateCap('return'), icon = "fas fa-arrow-left",
title = TranslateCap('return'),
action = 'return' action = 'return'
}) }
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'inventory_item', { ESX.OpenContext("right", elements2, function(menu2,element2)
title = data.current.label, local item, type = element2.value, element2.type
align = 'bottom-right',
elements = elements
}, function(data1, menu1)
local item, type = data1.current.value, data1.current.type
if data1.current.action == 'give' then if element2.action == "give" then
local playersNearby = ESX.Game.GetPlayersInArea(GetEntityCoords(playerPed), 3.0) local playersNearby = ESX.Game.GetPlayersInArea(GetEntityCoords(playerPed), 3.0)
if #playersNearby > 0 then if #playersNearby > 0 then
local players = {} local players = {}
elements = {} elements3 = {
{unselectable = true, icon = "fas fa-users", title = "Nearby Players"}
}
for k, playerNearby in ipairs(playersNearby) do for k, playerNearby in ipairs(playersNearby) do
players[GetPlayerServerId(playerNearby)] = true players[GetPlayerServerId(playerNearby)] = true
@@ -1222,19 +1232,15 @@ function ESX.ShowInventory()
ESX.TriggerServerCallback('esx:getPlayerNames', function(returnedPlayers) ESX.TriggerServerCallback('esx:getPlayerNames', function(returnedPlayers)
for playerId, playerName in pairs(returnedPlayers) do for playerId, playerName in pairs(returnedPlayers) do
table.insert(elements, { elements3[#elements3+1] = {
label = playerName, icon = "fas fa-user",
title = playerName,
playerId = playerId playerId = playerId
}) }
end end
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'give_item_to', { ESX.OpenContext("right", elements3, function(menu3,element3)
title = TranslateCap('give_to'), local selectedPlayer, selectedPlayerId = GetPlayerFromServerId(element3.playerId), element3.playerId
align = 'bottom-right',
elements = elements
}, function(data2, menu2)
local selectedPlayer, selectedPlayerId = GetPlayerFromServerId(data2.current.playerId),
data2.current.playerId
playersNearby = ESX.Game.GetPlayersInArea(GetEntityCoords(playerPed), 3.0) playersNearby = ESX.Game.GetPlayersInArea(GetEntityCoords(playerPed), 3.0)
playersNearby = ESX.Table.Set(playersNearby) playersNearby = ESX.Table.Set(playersNearby)
@@ -1244,62 +1250,58 @@ function ESX.ShowInventory()
if IsPedOnFoot(selectedPlayerPed) and not IsPedFalling(selectedPlayerPed) then if IsPedOnFoot(selectedPlayerPed) and not IsPedFalling(selectedPlayerPed) then
if type == 'item_weapon' then if type == 'item_weapon' then
TriggerServerEvent('esx:giveInventoryItem', selectedPlayerId, type, item, nil) TriggerServerEvent('esx:giveInventoryItem', selectedPlayerId, type, item, nil)
menu2.close() ESX.CloseContext()
menu1.close()
else else
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), local elementsG = {
'inventory_item_count_give', { {unselectable = true, icon = "fas fa-trash", title = element.title},
title = TranslateCap('amount') {icon = "fas fa-tally", title = "Amount.", input = true, inputType = "number", inputPlaceholder = "Amount to give..", inputMin = 1, inputMax = 1000},
}, function(data3, menu3) {icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
local quantity = tonumber(data3.value) }
if quantity and quantity > 0 and data.current.count >= quantity then ESX.OpenContext("right", elementsG, function(menuG,elementG)
TriggerServerEvent('esx:giveInventoryItem', selectedPlayerId, type, local quantity = tonumber(menuG.eles[2].inputValue)
item, quantity)
menu3.close() if quantity and quantity > 0 and element.count >= quantity then
menu2.close() TriggerServerEvent('esx:giveInventoryItem', selectedPlayerId, type, item, quantity)
menu1.close() ESX.CloseContext()
else else
ESX.ShowNotification(TranslateCap('amount_invalid')) ESX.ShowNotification(TranslateCap('amount_invalid'))
end end
end, function(data3, menu3) end)
menu3.close()
end)
end end
else else
ESX.ShowNotification(TranslateCap('in_vehicle')) ESX.ShowNotification(TranslateCap('in_vehicle'))
end end
else else
ESX.ShowNotification(TranslateCap('players_nearby')) ESX.ShowNotification(TranslateCap('players_nearby'))
menu2.close() ESX.CloseContext()
end end
end, function(data2, menu2)
menu2.close()
end) end)
end, players) end, players)
else
ESX.ShowNotification(TranslateCap('players_nearby'))
end end
elseif data1.current.action == 'remove' then elseif element2.action == "remove" then
if IsPedOnFoot(playerPed) and not IsPedFalling(playerPed) then if IsPedOnFoot(playerPed) and not IsPedFalling(playerPed) then
local dict, anim = 'weapons@first_person@aim_rng@generic@projectile@sticky_bomb@', 'plant_floor' local dict, anim = 'weapons@first_person@aim_rng@generic@projectile@sticky_bomb@', 'plant_floor'
ESX.Streaming.RequestAnimDict(dict) ESX.Streaming.RequestAnimDict(dict)
if type == 'item_weapon' then if type == 'item_weapon' then
menu1.close() ESX.CloseContext()
TaskPlayAnim(playerPed, dict, anim, 8.0, 1.0, 1000, 16, 0.0, false, false, false) TaskPlayAnim(playerPed, dict, anim, 8.0, 1.0, 1000, 16, 0.0, false, false, false)
RemoveAnimDict(dict) RemoveAnimDict(dict)
Wait(1000) Wait(1000)
TriggerServerEvent('esx:removeInventoryItem', type, item) TriggerServerEvent('esx:removeInventoryItem', type, item)
else else
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'inventory_item_count_remove', { local elementsR = {
title = TranslateCap('amount') {unselectable = true, icon = "fas fa-trash", title = element.title},
}, function(data2, menu2) {icon = "fas fa-tally", title = "Amount.", input = true, inputType = "number", inputPlaceholder = "Amount to remove..", inputMin = 1, inputMax = 1000},
local quantity = tonumber(data2.value) {icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
}
if quantity and quantity > 0 and data.current.count >= quantity then ESX.OpenContext("right", elementsR, function(menuR,elementR)
menu2.close() local quantity = tonumber(menuR.eles[2].inputValue)
menu1.close()
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) TaskPlayAnim(playerPed, dict, anim, 8.0, 1.0, 1000, 16, 0.0, false, false, false)
RemoveAnimDict(dict) RemoveAnimDict(dict)
Wait(1000) Wait(1000)
@@ -1307,17 +1309,16 @@ function ESX.ShowInventory()
else else
ESX.ShowNotification(TranslateCap('amount_invalid')) ESX.ShowNotification(TranslateCap('amount_invalid'))
end end
end, function(data2, menu2)
menu2.close()
end) end)
end end
end end
elseif data1.current.action == 'use' then elseif element2.action == "use" then
ESX.CloseContext()
TriggerServerEvent('esx:useItem', item) TriggerServerEvent('esx:useItem', item)
elseif data1.current.action == 'return' then elseif element2.action == "return" then
ESX.UI.Menu.CloseAll() ESX.CloseContext()
ESX.ShowInventory() ESX.ShowInventory()
elseif data1.current.action == 'give_ammo' then elseif element2.action == "give_ammo" then
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
local closestPed = GetPlayerPed(closestPlayer) local closestPed = GetPlayerPed(closestPlayer)
local pedAmmo = GetAmmoInPedWeapon(playerPed, joaat(item)) local pedAmmo = GetAmmoInPedWeapon(playerPed, joaat(item))
@@ -1325,25 +1326,25 @@ function ESX.ShowInventory()
if IsPedOnFoot(closestPed) and not IsPedFalling(closestPed) then if IsPedOnFoot(closestPed) and not IsPedFalling(closestPed) then
if closestPlayer ~= -1 and closestDistance < 3.0 then if closestPlayer ~= -1 and closestDistance < 3.0 then
if pedAmmo > 0 then if pedAmmo > 0 then
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'inventory_item_count_give', { local elementsGA = {
title = TranslateCap('amountammo') {unselectable = true, icon = "fas fa-trash", title = element.title},
}, function(data2, menu2) {icon = "fas fa-tally", title = "Amount.", input = true, inputType = "number", inputPlaceholder = "Amount to give..", inputMin = 1, inputMax = 1000},
local quantity = tonumber(data2.value) {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 quantity and quantity > 0 then
if pedAmmo >= quantity then if pedAmmo >= quantity then
TriggerServerEvent('esx:giveInventoryItem', GetPlayerServerId(closestPlayer), TriggerServerEvent('esx:giveInventoryItem', GetPlayerServerId(closestPlayer), 'item_ammo', item, quantity)
'item_ammo', item, quantity) ESX.CloseContext()
menu2.close()
menu1.close()
else else
ESX.ShowNotification(TranslateCap('noammo')) ESX.ShowNotification(TranslateCap('noammo'))
end end
else else
ESX.ShowNotification(TranslateCap('amount_invalid')) ESX.ShowNotification(TranslateCap('amount_invalid'))
end end
end, function(data2, menu2)
menu2.close()
end) end)
else else
ESX.ShowNotification(TranslateCap('noammo')) ESX.ShowNotification(TranslateCap('noammo'))
@@ -1355,12 +1356,7 @@ function ESX.ShowInventory()
ESX.ShowNotification(TranslateCap('in_vehicle')) ESX.ShowNotification(TranslateCap('in_vehicle'))
end end
end end
end, function(data1, menu1)
ESX.UI.Menu.CloseAll()
ESX.ShowInventory()
end) end)
end, function(data, menu)
menu.close()
end) end)
end end
+8 -30
View File
@@ -250,9 +250,7 @@ if not Config.OxInventory then
ESX.UI.ShowInventoryItemNotification(true, item, count) ESX.UI.ShowInventoryItemNotification(true, item, count)
end end
if ESX.UI.Menu.IsOpen('default', 'es_extended', 'inventory') then ESX.ShowInventory()
ESX.ShowInventory()
end
end) end)
RegisterNetEvent('esx:removeInventoryItem') RegisterNetEvent('esx:removeInventoryItem')
@@ -269,9 +267,7 @@ if not Config.OxInventory then
ESX.UI.ShowInventoryItemNotification(false, item, count) ESX.UI.ShowInventoryItemNotification(false, item, count)
end end
if ESX.UI.Menu.IsOpen('default', 'es_extended', 'inventory') then ESX.ShowInventory()
ESX.ShowInventory()
end
end) end)
RegisterNetEvent('esx:addWeapon') RegisterNetEvent('esx:addWeapon')
@@ -438,32 +434,11 @@ function StartServerSyncLoops()
end end
end) 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 end
if not Config.OxInventory and Config.EnableDefaultInventory then if not Config.OxInventory and Config.EnableDefaultInventory then
RegisterCommand('showinv', function() 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() ESX.ShowInventory()
end end
end) end)
@@ -700,8 +675,12 @@ AddEventHandler("esx:freezePlayer", function(input)
end) end)
RegisterNetEvent("esx:GetVehicleType", function(Model, Request) 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 if Model == `submersible` or Model == `submersible2` then
return TriggerServerEvent("esx:ReturnVehicleType", "submarine", Request) return TriggerServerEvent("esx:ReturnVehicleType", "submarine", Request)
end end
local VehicleType = GetVehicleClassFromName(Model) local VehicleType = GetVehicleClassFromName(Model)
@@ -718,7 +697,6 @@ RegisterNetEvent("esx:GetVehicleType", function(Model, Request)
TriggerServerEvent("esx:ReturnVehicleType", types[VehicleType] or "automobile", Request) TriggerServerEvent("esx:ReturnVehicleType", types[VehicleType] or "automobile", Request)
end) end)
local DoNotUse = { local DoNotUse = {
'essentialmode', 'essentialmode',
'es_admin2', 'es_admin2',
+338 -207
View File
@@ -1,228 +1,359 @@
Locales['cs'] = { Locales['cs'] = {
-- Inventory -- Inventory
['inventory'] = 'inventář %s / %s', ['inventory'] = 'Inventář ( Váha %s / %s )',
['use'] = 'použít', ['use'] = 'Použít',
['give'] = 'dát', ['give'] = 'Darovat',
['remove'] = 'zahodit', ['remove'] = 'Odhodit',
['return'] = 'zpět', ['return'] = 'Vrátit',
['give_to'] = 'dát', ['give_to'] = 'Darováno',
['amount'] = 'množství', ['amount'] = 'Počet',
['giveammo'] = 'dát munici', ['giveammo'] = 'Podat náboje',
['amountammo'] = 'množství munice', ['amountammo'] = 'Počet nábojů',
['noammo'] = 'nemáte dostatek munice!', ['noammo'] = 'Nedostatek!',
['gave_item'] = 'dali jste %sx %s %s', ['gave_item'] = 'Daroval %sx %s pro %s',
['received_item'] = 'obdrželi jste %sx %s od %s', ['received_item'] = 'Získáno %sx %s od %s',
['gave_weapon'] = 'dal jsi %s hráči %s', ['gave_weapon'] = 'Předání %s pro %s',
['gave_weapon_ammo'] = 'dal jsi ~o~%sx %s za %s to %s', ['gave_weapon_ammo'] = 'Darování ~o~%sx %s do %s pro %s',
['gave_weapon_withammo'] = 'dal jwi %s s ~o~%sx %s to %s', ['gave_weapon_withammo'] = 'Darování %s s ~o~%sx %s pro %s',
['gave_weapon_hasalready'] = '%s již %s', ['gave_weapon_hasalready'] = '%s již vlastní %s',
['gave_weapon_noweapon'] = '%s nemá tuhle zbraň', ['gave_weapon_noweapon'] = '%s nemá tuto zbraň',
['received_weapon'] = 'obdrzel jsi %s od %s', ['received_weapon'] = 'Obdrženo %s od %s',
['received_weapon_ammo'] = 'obdrzel jsi ~o~%sx %s za tvůj %s od %s', ['received_weapon_ammo'] = 'Obdrženo ~o~%sx %s pro zbraň %s od %s',
['received_weapon_withammo'] = 'obdzel jsi %s s ~o~%sx %s od %s', ['received_weapon_withammo'] = 'Obdrženo %s s ~o~%sx %s od %s',
['received_weapon_hasalready'] = '%s se pokusil ti dat %s, ale jiz tento predmet jednou mas', ['received_weapon_hasalready'] = '%s se snažil darovat %s, ale již tuto zbraň máš',
['received_weapon_noweapon'] = '%s se pokusil ti dat naboje pro %s, ale tuhle zbran nemas', ['received_weapon_noweapon'] = '%s se snažil ti dát náboje %s, ale nemáš potřebnou zbrań',
['gave_account_money'] = 'dali jste $%s (%s) %s', ['gave_account_money'] = 'Darováno $%s (%s) pro %s',
['received_account_money'] = 'obdrželi jste $%s (%s) od %s', ['received_account_money'] = 'Získáno $%s (%s) od %s',
['amount_invalid'] = 'neplatné množství', ['amount_invalid'] = 'Špatné množství',
['players_nearby'] = 'žádní hráči poblíž', ['players_nearby'] = 'Žádný hráč není poblíž',
['ex_inv_lim'] = 'akce není možná, překročen limit inventáře pro %s', ['ex_inv_lim'] = 'Nelze sebrat,protože máš plné kapsy %s',
['imp_invalid_quantity'] = 'akce není možná, neplatný počet', ['imp_invalid_quantity'] = 'Neplatné množství',
['imp_invalid_amount'] = 'akce není možná, neplatné množství', ['imp_invalid_amount'] = 'Nelze provést, neplatné množství',
['threw_standard'] = 'vyhodil jsi %sx %s', ['threw_standard'] = 'Zahozeno %sx %s',
['threw_account'] = 'vyhodil jsi $%s %s', ['threw_account'] = 'Zahozeno $%s %s',
['threw_weapon'] = 'vzhodil jsi %s', ['threw_weapon'] = 'Zahozeno %s',
['threw_weapon_ammo'] = 'vyhodil jsi %s s ~o~%sx %s', ['threw_weapon_ammo'] = 'Zahozeno %s s ~o~%sx %s',
['threw_weapon_already'] = 'jiz stejnou zbraan mas', ['threw_weapon_already'] = 'Již vlastníš tuto zbraň',
['threw_cannot_pickup'] = 'tohle nemuzes sebrat, protoze tvuj inventar je plny', ['threw_cannot_pickup'] = 'Kapsy máš plné, nemůžeš sebrat!',
['threw_pickup_prompt'] = 'stiskni E po zvednuti', ['threw_pickup_prompt'] = 'Zmáčkni E pro sebrání!',
-- Key mapping -- Key mapping
['keymap_showinventory'] = 'zobrazit inventar', ['keymap_showinventory'] = 'Otevřít inventář',
-- Salary related -- Salary related
['received_salary'] = 'obdrželi jste výplatu: $%s', ['received_salary'] = 'Obdržel jsi: $%s',
['received_help'] = 'obdrželi jste sociální dávku: $%s', ['received_help'] = 'Obdržel jsi svůj podíl: $%s',
['company_nomoney'] = 'společnost u které jste zaměstananí nemá peníze na váš plat', ['company_nomoney'] = 'Firma kde pracujete je příliš chudá, aby vám zaplatila',
['received_paycheck'] = 'obdržena plata', ['received_paycheck'] = 'Obdržena platba',
['bank'] = 'bankovní účet', ['bank'] = 'Banka',
['account_bank'] = 'banka', ['account_bank'] = 'V bance',
['account_black_money'] = 'spinave penize', ['account_black_money'] = 'Špináve peníze',
['account_money'] = 'kapesne', ['account_money'] = 'V kapse',
['act_imp'] = 'akce není možná', ['act_imp'] = 'Nelze provést',
['in_vehicle'] = 'nemůže nic dát osobě ve vozidle', ['in_vehicle'] = 'Nelze provést, hráč je v autě',
-- Commands -- Commands
['command_car'] = 'spawn an vehicle', ['command_bring'] = 'Přivolat si hráče k sobě',
['command_car_car'] = 'vehicle spawn name or hash', ['command_car'] = 'Spawnout vozidlo',
['command_cardel'] = 'delete vehicle in proximity', ['command_car_car'] = 'Zadej jméno vozidla nebo spawnname',
['command_cardel_radius'] = 'optional, delete every vehicle within the specified radius', ['command_cardel'] = 'Odstranění vozidla v okolí',
['command_clear'] = 'clear chat', ['command_cardel_radius'] = 'Odstranění vozidla v určeném dosahu',
['command_clearall'] = 'clear chat for all players', ['command_clear'] = 'Vymazat text v chatu',
['command_clearinventory'] = 'clear player inventory', ['command_clearall'] = 'Vymazat chet pro všechny hráče',
['command_clearloadout'] = 'clear a player loadout', ['command_clearinventory'] = 'Vymazat všechny věci z invetáře hráče',
['command_giveaccountmoney'] = 'give account money', ['command_clearloadout'] = 'Vymazat všechny zbraně z inventáře hráče',
['command_giveaccountmoney_account'] = 'valid account name', ['command_freeze'] = 'Zmrazit hráče',
['command_giveaccountmoney_amount'] = 'amount to add', ['command_unfreeze'] = 'Odmrazit hráče',
['command_giveaccountmoney_invalid'] = 'invalid account name', ['command_giveaccountmoney'] = 'Poslat peníze na účet ',
['command_giveitem'] = 'give an item to a player', ['command_giveaccountmoney_account'] = 'Převést peníze na účet',
['command_giveitem_item'] = 'item name', ['command_giveaccountmoney_amount'] = 'Částka k poslání',
['command_giveitem_count'] = 'item count', ['command_giveaccountmoney_invalid'] = 'Neplátné jméno',
['command_giveweapon'] = 'give a weapon to a player', ['command_giveitem'] = 'Darovat věc hráči',
['command_giveweapon_weapon'] = 'weapon name', ['command_giveitem_item'] = 'Název věci',
['command_giveweapon_ammo'] = 'ammo count', ['command_giveitem_count'] = 'Množství',
['command_giveweapon_hasalready'] = 'player already has that weapon', ['command_giveweapon'] = 'Dát zbraň hráči',
['command_giveweaponcomponent'] = 'give weapon component', ['command_giveweapon_weapon'] = 'Název zbraně',
['command_giveweaponcomponent_component'] = 'component name', ['command_giveweapon_ammo'] = 'Množství náboje',
['command_giveweaponcomponent_invalid'] = 'invalid weapon component', ['command_giveweapon_hasalready'] = 'Hráč již má tuto zbraň',
['command_giveweaponcomponent_hasalready'] = 'player already has that weapon component', ['command_giveweaponcomponent'] = 'Darovat přídavek na zbraň',
['command_giveweaponcomponent_missingweapon'] = 'player does not have that weapon', ['command_giveweaponcomponent_component'] = 'Název zbraně',
['command_save'] = 'save a player to database', ['command_giveweaponcomponent_invalid'] = 'Špatné jméno přídavku',
['command_saveall'] = 'save all players to database', ['command_giveweaponcomponent_hasalready'] = 'Hráč již má tento přídavek',
['command_setaccountmoney'] = 'set account money for a player', ['command_giveweaponcomponent_missingweapon'] = 'Hráč nemá tuto zbrań',
['command_setaccountmoney_amount'] = 'amount of money to set', ['command_goto'] = 'Teleportování sebe k hráči',
['command_setcoords'] = 'teleport to coordinates', ['command_kill'] = 'Zabití hráče',
['command_setcoords_x'] = 'x axis', ['command_save'] = 'Uložení dat hráče',
['command_setcoords_y'] = 'y axis', ['command_saveall'] = 'Uložení veškerých dat hráče',
['command_setcoords_z'] = 'z axis', ['command_setaccountmoney'] = 'Nastavení určeného počtu peněz',
['command_setjob'] = 'set job for a player', ['command_setaccountmoney_amount'] = 'Počet peněz',
['command_setjob_job'] = 'job name', ['command_setcoords'] = 'Teleportování na určené souřadnice',
['command_setjob_grade'] = 'job grade', ['command_setcoords_x'] = 'Hodnota X',
['command_setjob_invalid'] = 'the job, grade or both are invalid', ['command_setcoords_y'] = 'Hodnota Y',
['command_setgroup'] = 'set player group', ['command_setcoords_z'] = 'Hodnota Z',
['command_setgroup_group'] = 'group name', ['command_setjob'] = 'Nastavit práci hráči',
['commanderror_argumentmismatch'] = 'argument count mismatch (passed %s, wanted %s)', ['command_setjob_job'] = 'Název práce',
['commanderror_argumentmismatch_number'] = 'argument #%s type mismatch (passed string, wanted number)', ['command_setjob_grade'] = 'Pozice ve firmě',
['commanderror_invaliditem'] = 'invalid item name', ['command_setjob_invalid'] = 'Špatné zadání práce,hodnosti nebo i obou hodnot',
['commanderror_invalidweapon'] = 'invalid weapon', ['command_setgroup'] = 'Nastavení práv hráči',
['commanderror_console'] = 'that command can not be run from console', ['command_setgroup_group'] = 'Název skupiny',
['commanderror_invalidcommand'] = '/%s is not an valid command!', ['commanderror_argumentmismatch'] = 'Chybný počet hodnot (správně %s, potřebných %s)',
['commanderror_invalidplayerid'] = 'there is no player online matching that server id', ['commanderror_argumentmismatch_number'] = 'Chybně zadaná hodnot #%s (správně, špatně)',
['commandgeneric_playerid'] = 'player id', ['commanderror_invaliditem'] = 'Špatný předmět',
['command_giveammo_noweapon_found'] = '%s does not have that weapon', ['commanderror_invalidweapon'] = 'Špatná zbraň',
['command_giveammo_weapon'] = 'Weapon name', ['commanderror_console'] = 'příkaz nelze být zpracován v konzoli',
['command_giveammo_ammo'] = 'Ammo Quantity', ['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 settings
['locale_digit_grouping_symbol'] = ' ', ['locale_digit_grouping_symbol'] = ',',
['locale_currency'] = '$%s', ['locale_currency'] = '£%s',
-- Weapons -- Weapons
['weapon_knife'] = 'nuz',
['weapon_nightstick'] = 'policejni obusek', -- Melee
['weapon_hammer'] = 'kladivo', ['weapon_dagger'] = 'Dýka',
['weapon_bat'] = 'basseballka', ['weapon_bat'] = 'Baseballová pálka',
['weapon_golfclub'] = 'gollfova hul', ['weapon_battleaxe'] = 'Bitevní sekera',
['weapon_crowbar'] = 'pacidlo', ['weapon_bottle'] = 'Rozbitá lahve',
['weapon_pistol'] = 'pistole', ['weapon_crowbar'] = 'Páčidlo',
['weapon_combatpistol'] = 'utocna pistole', ['weapon_flashlight'] = 'Baterka',
['weapon_appistol'] = 'ap pistole', ['weapon_golfclub'] = 'Golfová hůl',
['weapon_pistol50'] = 'pistole .50', ['weapon_hammer'] = 'Kladivo',
['weapon_microsmg'] = 'micro smg', ['weapon_hatchet'] = 'Sekera',
['weapon_smg'] = 'smg', ['weapon_knife'] = 'Nůž',
['weapon_assaultsmg'] = 'utocne smg', ['weapon_knuckle'] = 'Boxer',
['weapon_assaultrifle'] = 'utocna puska', ['weapon_machete'] = 'Mačeta',
['weapon_carbinerifle'] = 'carbine puska', ['weapon_nightstick'] = 'Policejní obušek',
['weapon_advancedrifle'] = 'pokrocily puska', ['weapon_wrench'] = 'Francouzský klíč',
['weapon_mg'] = 'mg', ['weapon_poolcue'] = 'Kulečníkové tágo',
['weapon_combatmg'] = 'utocne mg', ['weapon_stone_hatchet'] = 'Kamenná sekera',
['weapon_pumpshotgun'] = 'pumpovana brokovnice', ['weapon_switchblade'] = 'Vystřelovací nůž',
['weapon_sawnoffshotgun'] = 'upilovana brokovnice',
['weapon_assaultshotgun'] = 'utocna brokovnice', -- Handguns
['weapon_bullpupshotgun'] = 'bullpup brokovnice', ['weapon_appistol'] = 'AP pistol',
['weapon_stungun'] = 'tazer', ['weapon_ceramicpistol'] = 'Ceramic pistol',
['weapon_sniperrifle'] = 'sniperka', ['weapon_combatpistol'] = 'Combat pistol',
['weapon_heavysniper'] = 'tezka sniperka', ['weapon_doubleaction'] = 'Double-Action Revolver',
['weapon_grenadelauncher'] = 'launcher granatu', ['weapon_navyrevolver'] = 'Navy Revolver',
['weapon_rpg'] = 'raketomet', ['weapon_flaregun'] = 'Flaregun',
['weapon_minigun'] = 'minigun', ['weapon_gadgetpistol'] = 'Gadget Pistol',
['weapon_grenade'] = 'granat', ['weapon_heavypistol'] = 'Heavy Pistol',
['weapon_stickybomb'] = 'lepkava bomba', ['weapon_revolver'] = 'Heavy Revolver',
['weapon_smokegrenade'] = 'kourovy granat', ['weapon_revolver_mk2'] = 'Heavy Revolver MK2',
['weapon_bzgas'] = 'bz gas', ['weapon_marksmanpistol'] = 'Marksman Pistol',
['weapon_molotov'] = 'molotov koktejl', ['weapon_pistol'] = 'Pistol',
['weapon_fireextinguisher'] = 'hasicak', ['weapon_pistol_mk2'] = 'Pistol MK2',
['weapon_petrolcan'] = 'kanystr', ['weapon_pistol50'] = 'Pistol .50',
['weapon_ball'] = 'koule', ['weapon_snspistol'] = 'SNS Pistol',
['weapon_snspistol'] = 'sns pistole', ['weapon_snspistol_mk2'] = 'SNS Pistol MK2',
['weapon_bottle'] = 'lahev', ['weapon_stungun'] = 'Taser',
['weapon_gusenberg'] = 'gusenberguv zametac', ['weapon_raypistol'] = 'Up-N-Atomizer',
['weapon_specialcarbine'] = 'specialni karabina', ['weapon_vintagepistol'] = 'Vintage Pistol',
['weapon_heavypistol'] = 'tezka pistole',
['weapon_bullpuprifle'] = 'bullpup puska', -- Shotguns
['weapon_dagger'] = 'dyka', ['weapon_assaultshotgun'] = 'Assault Shotgun',
['weapon_vintagepistol'] = 'velmi stara pistole', ['weapon_autoshotgun'] = 'Auto Shotgun',
['weapon_firework'] = 'ohnostroj', ['weapon_bullpupshotgun'] = 'Bullpup Shotgun',
['weapon_musket'] = 'musketa', ['weapon_combatshotgun'] = 'Combat Shotgun',
['weapon_heavyshotgun'] = 'tezka brokovnice', ['weapon_dbshotgun'] = 'Double Barrel Shotgun',
['weapon_marksmanrifle'] = 'puska strelce', ['weapon_heavyshotgun'] = 'Heavy Shotgun',
['weapon_hominglauncher'] = 'navadeci launcher', ['weapon_musket'] = 'Musket',
['weapon_proxmine'] = 'mina na blizko', ['weapon_pumpshotgun'] = 'Pump Shotgun',
['weapon_snowball'] = 'snehova koule', ['weapon_pumpshotgun_mk2'] = 'Pump Shotgun MK2',
['weapon_flaregun'] = 'svetlice', ['weapon_sawnoffshotgun'] = 'Sawed Off Shotgun',
['weapon_combatpdw'] = 'utocne pdw',
['weapon_marksmanpistol'] = 'pistole strelce', -- SMG & LMG
['weapon_knuckle'] = 'knuckledusters', ['weapon_assaultsmg'] = 'Assault SMG',
['weapon_hatchet'] = 'sekerka', ['weapon_combatmg'] = 'Combat MG',
['weapon_railgun'] = 'vlakovy launcher', ['weapon_combatmg_mk2'] = 'Combat MG MK2',
['weapon_machete'] = 'maceta', ['weapon_combatpdw'] = 'Combat PDW',
['weapon_machinepistol'] = 'kulomet', ['weapon_gusenberg'] = 'Gusenberg Sweeper',
['weapon_switchblade'] = 'vystrelovaci nuz', ['weapon_machinepistol'] = 'Machine Pistol',
['weapon_revolver'] = 'tezky revolver', ['weapon_mg'] = 'MG',
['weapon_dbshotgun'] = 'dvouhlavnova brokovnice', ['weapon_microsmg'] = 'Micro SMG',
['weapon_compactrifle'] = 'kompaktni puska', ['weapon_minismg'] = 'Mini SMG',
['weapon_autoshotgun'] = 'automaticka brokovnice', ['weapon_smg'] = 'SMG',
['weapon_battleaxe'] = 'bojova sekera', ['weapon_smg_mk2'] = 'SMG MK2',
['weapon_compactlauncher'] = 'kompaktni launcher', ['weapon_raycarbine'] = 'Unholy Hellbringer',
['weapon_minismg'] = 'mini smg',
['weapon_pipebomb'] = 'dymkova bomba', -- Rifles
['weapon_poolcue'] = 'kulecnikove tago', ['weapon_advancedrifle'] = 'Advanced Rifle',
['weapon_wrench'] = 'klic na trubky', ['weapon_assaultrifle'] = 'Assault Rifle',
['weapon_flashlight'] = 'baterka', ['weapon_assaultrifle_mk2'] = 'Assault Rifle MK2',
['gadget_parachute'] = 'padak', ['weapon_bullpuprifle'] = 'Bullpup Rifle',
['weapon_flare'] = 'svetlice', ['weapon_bullpuprifle_mk2'] = 'Bullpup Rifle MK2',
['weapon_doubleaction'] = 'dvojhlavnovy revolver', ['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 -- Weapon Components
['component_clip_default'] = 'zakladni rukojet', ['component_knuckle_base'] = 'base Model',
['component_clip_extended'] = 'prodloucena rukojet', ['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_drum'] = 'drum Magazine',
['component_clip_box'] = 'krabice s naboji', ['component_clip_box'] = 'box Magazine',
['component_flashlight'] = 'baterka',
['component_scope'] = 'zamerovac', ['component_scope_holo'] = 'holographic Scope',
['component_scope_advanced'] = 'pokrocily zamerovac', ['component_scope_small'] = 'small Scope',
['component_suppressor'] = 'tlumic', ['component_scope_medium'] = 'medium Scope',
['component_grip'] = 'rukojet', ['component_scope_large'] = 'large Scope',
['component_luxary_finish'] = 'luxusni vzhled zbrane', ['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 -- Weapon Ammo
['ammo_rounds'] = 'naboj(e)', ['ammo_rounds'] = 'round(s)',
['ammo_shells'] = 'patrona(y)', ['ammo_shells'] = 'shell(s)',
['ammo_charge'] = 'naboj(e)', ['ammo_charge'] = 'charge',
['ammo_petrol'] = 'galonu paliva', ['ammo_petrol'] = 'gallons of fuel',
['ammo_firework'] = 'ohnostroj(e)', ['ammo_firework'] = 'firework(s)',
['ammo_rockets'] = 'raketa(y)', ['ammo_rockets'] = 'rocket(s)',
['ammo_grenadelauncher'] = 'granat(y)', ['ammo_grenadelauncher'] = 'grenade(s)',
['ammo_grenade'] = 'granat(y)', ['ammo_grenade'] = 'grenade(s)',
['ammo_stickybomb'] = 'bomba(y)', ['ammo_stickybomb'] = 'bomb(s)',
['ammo_pipebomb'] = 'bomba(y)', ['ammo_pipebomb'] = 'bomb(s)',
['ammo_smokebomb'] = 'bomba(y)', ['ammo_smokebomb'] = 'bomb(s)',
['ammo_molotov'] = 'koktejl(y)', ['ammo_molotov'] = 'cocktail(s)',
['ammo_proxmine'] = 'mina(y)', ['ammo_proxmine'] = 'mine(s)',
['ammo_bzgas'] = 'kanystr(y)', ['ammo_bzgas'] = 'can(s)',
['ammo_ball'] = 'koule', ['ammo_ball'] = 'ball(s)',
['ammo_snowball'] = 'snehova(e) koule', ['ammo_snowball'] = 'snowball(s)',
['ammo_flare'] = 'svetlice', ['ammo_flare'] = 'flare(s)',
['ammo_flaregun'] = 'svetlice', ['ammo_flaregun'] = 'flare(s)',
-- Weapon Tints -- Weapon Tints
['tint_default'] = 'zakladni skin', ['tint_default'] = 'default skin',
['tint_green'] = 'zeleny skin', ['tint_green'] = 'green skin',
['tint_gold'] = 'zlaty skin', ['tint_gold'] = 'gold skin',
['tint_pink'] = 'ruzovy skin', ['tint_pink'] = 'pink skin',
['tint_army'] = 'armadni skin', ['tint_army'] = 'army skin',
['tint_lspd'] = 'modry skin', ['tint_lspd'] = 'blue skin',
['tint_orange'] = 'oranzovy skin', ['tint_orange'] = 'orange skin',
['tint_platinum'] = 'platinovy skin', ['tint_platinum'] = 'platinum skin',
} }
+24 -6
View File
@@ -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) function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, weight, job, loadout, name, coords)
local targetOverrides = Config.PlayerFunctionOverride and Core.PlayerFunctionOverrides[Config.PlayerFunctionOverride] or {} local targetOverrides = Config.PlayerFunctionOverride and Core.PlayerFunctionOverrides[Config.PlayerFunctionOverride] or {}
@@ -31,7 +37,6 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
end end
function self.setCoords(coords) function self.setCoords(coords)
self.updateCoords(coords)
local Ped = GetPlayerPed(self.source) local Ped = GetPlayerPed(self.source)
local vector = type(coords) == "vector4" and coords or type(coords) == "vector3" and vector4(coords, 0.0) or 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) vec(coords.x, coords.y, coords.z, coords.heading or 0.0)
@@ -40,10 +45,23 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
end end
function self.updateCoords() function self.updateCoords()
local Ped = GetPlayerPed(self.source) SetTimeout(1000,function()
local coords = GetEntityCoords(Ped) local Ped = GetPlayerPed(self.source)
local heading = GetEntityHeading(Ped) if DoesEntityExist(Ped) then
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)} 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 end
function self.getCoords(vector) 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)) 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 return
end end
if money > 0 then if money >= 0 then
local account = self.getAccount(accountName) local account = self.getAccount(accountName)
if account then if account then
-5
View File
@@ -14,11 +14,6 @@ Core.Pickups = {}
Core.PickupId = 0 Core.PickupId = 0
Core.PlayerFunctionOverrides = {} 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() exports('getSharedObject', function()
return ESX return ESX
+1 -11
View File
@@ -317,7 +317,7 @@ function loadESXPlayer(identifier, playerId, isNew)
else else
exports.ox_inventory:setPlayerInventory(xPlayer, userData.inventory) exports.ox_inventory:setPlayerInventory(xPlayer, userData.inventory)
end end
xPlayer.updateCoords()
xPlayer.triggerEvent('esx:registerSuggestions', Core.RegisteredCommands) 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)) print(('[^2INFO^0] Player ^5"%s"^0 has connected to the server. ID: ^5%s^7'):format(xPlayer.getName(), playerId))
end end
@@ -359,16 +359,6 @@ AddEventHandler('esx:playerLogout', function(playerId, cb)
TriggerClientEvent("esx:onPlayerLogout", playerId) TriggerClientEvent("esx:onPlayerLogout", playerId)
end) 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 if not Config.OxInventory then
RegisterNetEvent('esx:updateWeaponAmmo') RegisterNetEvent('esx:updateWeaponAmmo')
AddEventHandler('esx:updateWeaponAmmo', function(weaponName, ammoCount) AddEventHandler('esx:updateWeaponAmmo', function(weaponName, ammoCount)
+23 -17
View File
@@ -61,23 +61,29 @@ end
---@param heading number ---@param heading number
---@param Properties table ---@param Properties table
---@param cb function ---@param cb function
function ESX.OneSync.SpawnVehicle(model, coords, heading, Properties, cb) function ESX.OneSync.SpawnVehicle(model, coords, heading, Properties, cb)
model = type(model) == 'string' and joaat(model) or model local veh_model = type(model) == 'string' and joaat(model) or model
Properties = Properties or {} Properties = Properties or {}
local vector = type(coords) == "vector3" and coords or vec(coords.x, coords.y, coords.z) local vector = type(coords) == "vector3" and coords or vec(coords.x, coords.y, coords.z)
TriggerClientEvent("esx:requestModel", -1, model) TriggerClientEvent("esx:requestModel", -1, model)
CreateThread(function() CreateThread(function()
local xPlayer = ESX.OneSync.GetClosestPlayer(vector, 200) local xPlayer = ESX.OneSync.GetClosestPlayer(vector, 300)
ESX.GetVehicleType(model, xPlayer.id, function(Type) ESX.GetVehicleType(veh_model, xPlayer.id, function(Type)
local SpawnedEntity = CreateVehicleServerSetter(model, Type, vector, heading) if Type then
Wait(250) local SpawnedEntity = CreateVehicleServerSetter(veh_model, Type, vector, heading)
local NetworkId = NetworkGetNetworkIdFromEntity(SpawnedEntity) local NetworkId = NetworkGetNetworkIdFromEntity(SpawnedEntity)
Properties.NetId = NetworkId while not DoesEntityExist(SpawnedEntity) do
Entity(SpawnedEntity).state:set('VehicleProperties', Properties, true) Wait(100)
cb(NetworkId) end
end) Properties.NetId = NetworkId
end) Entity(SpawnedEntity).state:set('VehicleProperties', Properties, true)
end cb(NetworkId)
else
print(('[^1ERROR^7] Tried to spawn invalid vehicle - ^5%s^7!'):format(model))
end
end)
end)
end
---@param model number|string ---@param model number|string
-1
View File
@@ -35,7 +35,6 @@ if ESX.GetConfig().Multichar then
RenderScriptCams(true, false, 1, true, true) RenderScriptCams(true, false, 1, true, true)
SetCamCoord(cam, offset.x, offset.y, offset.z) SetCamCoord(cam, offset.x, offset.y, offset.z)
PointCamAtCoord(cam, Config.Spawn.x, Config.Spawn.y, Config.Spawn.z + 1.3) PointCamAtCoord(cam, Config.Spawn.x, Config.Spawn.y, Config.Spawn.z + 1.3)
ESX.UI.Menu.CloseAll()
ESX.UI.HUD.SetDisplay(0.0) ESX.UI.HUD.SetDisplay(0.0)
StartLoop() StartLoop()
ShutdownLoadingScreen() ShutdownLoadingScreen()
+7 -4
View File
@@ -1,15 +1,18 @@
Locales["es"] = { Locales["es"] = {
["male"] = "Hombre", ["male"] = "Hombre",
["female"] = "Mujer", ["female"] = "Mujer",
["delete_label"] = "¿Quieres borrar a %s %s?",
["select_char"] = "Seleccionar personaje", ["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", ["create_char"] = "Crear nuevo personaje",
["char_play"] = "Jugar este personaje", ["char_play"] = "Jugar este personaje",
["char_play_description"] = "Continúe hacia la ciudad.",
["char_disabled"] = "Este personaje está deshabilitado", ["char_disabled"] = "Este personaje está deshabilitado",
["char_disabled_description"] = "Este personaje es inutilizable.",
["char_delete"] = "Borrar este personaje", ["char_delete"] = "Borrar este personaje",
["cancel"] = "Cancelar", ["char_delete_description"] = "Eliminar permanentemente este personaje.",
["confirm"] = "Confirmar", ["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_setslots"] = "Establecer el numero de espacios de un jugador",
["command_remslots"] = "Elimina espacios multipersonaje de un jugador", ["command_remslots"] = "Elimina espacios multipersonaje de un jugador",
["command_enablechar"] = "Habilita el personaje de un jugador", ["command_enablechar"] = "Habilita el personaje de un jugador",
+6
View File
@@ -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',
}
+70 -72
View File
@@ -11,63 +11,59 @@ end)
function OpenAmbulanceActionsMenu() 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 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 end
ESX.UI.Menu.CloseAll() ESX.OpenContext("right", elements, function(menu,element)
if element.value == 'cloakroom' then
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
OpenCloakroomMenu() OpenCloakroomMenu()
elseif data.current.value == 'boss_actions' then elseif element.value == 'boss_actions' then
TriggerEvent('esx_society:openBossMenu', 'ambulance', function(data, menu) TriggerEvent('esx_society:openBossMenu', 'ambulance', function(data, menu)
menu.close() menu.close()
end, {wash = false}) end, {wash = false})
end end
end, function(data, menu)
menu.close()
end) end)
end end
function OpenMobileAmbulanceActionsMenu() 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', { ESX.OpenContext("right", elements, function(menu,element)
title = TranslateCap('ambulance'), if element.value == "citizen_interaction" then
align = 'top-left', local elements2 = {
elements = { {unselectable = true, icon = "fas fa-ambulance", title = element.title},
{label = TranslateCap('ems_menu'), value = 'citizen_interaction'} {icon = "fas fa-syringe", title = TranslateCap('ems_menu_revive'), value = "revive"},
}}, function(data, menu) {icon = "fas fa-bandage", title = TranslateCap('ems_menu_small'), value = "small"},
if data.current.value == 'citizen_interaction' then {icon = "fas fa-bandage", title = TranslateCap('ems_menu_big'), value = "big"},
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'citizen_interaction', { {icon = "fas fa-car", title = TranslateCap('ems_menu_putincar'), value = "put_in_vehicle"},
title = TranslateCap('ems_menu_title'), {icon = "fas fa-syringe", title = TranslateCap('ems_menu_search'), value = "search"},
align = 'top-left', }
elements = {
{label = TranslateCap('ems_menu_revive'), value = 'revive'}, ESX.OpenContext("right", elements2, function(menu2,element2)
{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)
if isBusy then return end if isBusy then return end
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
if data.current.value == 'search' then if element2.value == 'search' then
TriggerServerEvent('esx_ambulancejob:svsearch') TriggerServerEvent('esx_ambulancejob:svsearch')
elseif closestPlayer == -1 or closestDistance > 1.0 then elseif closestPlayer == -1 or closestDistance > 1.0 then
ESX.ShowNotification(TranslateCap('no_players')) ESX.ShowNotification(TranslateCap('no_players'))
else else
if data.current.value == 'revive' then if element2.value == 'revive' then
revivePlayer(closestPlayer) revivePlayer(closestPlayer)
elseif data.current.value == 'small' then elseif element2.value == 'small' then
ESX.TriggerServerCallback('esx_ambulancejob:getItemAmount', function(quantity) ESX.TriggerServerCallback('esx_ambulancejob:getItemAmount', function(quantity)
if quantity > 0 then if quantity > 0 then
local closestPlayerPed = GetPlayerPed(closestPlayer) local closestPlayerPed = GetPlayerPed(closestPlayer)
@@ -94,8 +90,7 @@ function OpenMobileAmbulanceActionsMenu()
end end
end, 'bandage') end, 'bandage')
elseif data.current.value == 'big' then elseif element2.value == 'big' then
ESX.TriggerServerCallback('esx_ambulancejob:getItemAmount', function(quantity) ESX.TriggerServerCallback('esx_ambulancejob:getItemAmount', function(quantity)
if quantity > 0 then if quantity > 0 then
local closestPlayerPed = GetPlayerPed(closestPlayer) local closestPlayerPed = GetPlayerPed(closestPlayer)
@@ -121,18 +116,12 @@ function OpenMobileAmbulanceActionsMenu()
ESX.ShowNotification(TranslateCap('not_enough_medikit')) ESX.ShowNotification(TranslateCap('not_enough_medikit'))
end end
end, 'medikit') end, 'medikit')
elseif element2.value == 'put_in_vehicle' then
elseif data.current.value == 'put_in_vehicle' then
TriggerServerEvent('esx_ambulancejob:putInVehicle', GetPlayerServerId(closestPlayer)) TriggerServerEvent('esx_ambulancejob:putInVehicle', GetPlayerServerId(closestPlayer))
end end
end end
end, function(data, menu)
menu.close()
end) end)
end end
end, function(data, menu)
menu.close()
end) end)
end end
@@ -328,7 +317,7 @@ end)
AddEventHandler('esx_ambulancejob:hasExitedMarker', function(hospital, part, partNum) AddEventHandler('esx_ambulancejob:hasExitedMarker', function(hospital, part, partNum)
if not isInShopMenu then if not isInShopMenu then
ESX.UI.Menu.CloseAll() ESX.CloseContext()
end end
ESX.HideUI() ESX.HideUI()
CurrentAction = nil CurrentAction = nil
@@ -411,14 +400,14 @@ AddEventHandler('esx_ambulancejob:putInVehicle', function()
end) end)
function OpenCloakroomMenu() function OpenCloakroomMenu()
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'cloakroom', { local elements = {
title = TranslateCap('cloakroom'), {unselectable = true, icon = "fas fa-shirt", title = TranslateCap('cloakroom')},
align = 'top-left', {icon = "fas fa-shirt", title = TranslateCap('ems_clothes_civil'), value = "citizen_wear"},
elements = { {icon = "fas fa-shirt", title = TranslateCap('ems_clothes_ems'), value = "ambulance_wear"},
{label = TranslateCap('ems_clothes_civil'), value = 'citizen_wear'}, }
{label = TranslateCap('ems_clothes_ems'), value = 'ambulance_wear'},
}}, function(data, menu) ESX.OpenContext("right", elements, function(menu,element)
if data.current.value == 'citizen_wear' then if element.value == "citizen_wear" then
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
TriggerEvent('skinchanger:loadSkin', skin) TriggerEvent('skinchanger:loadSkin', skin)
isOnDuty = false isOnDuty = false
@@ -432,7 +421,7 @@ function OpenCloakroomMenu()
print("[^2INFO^7] Off Duty") print("[^2INFO^7] Off Duty")
end end
end) end)
elseif data.current.value == 'ambulance_wear' then elseif element.value == "ambulance_wear" then
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
if skin.sex == 0 then if skin.sex == 0 then
TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_male) TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_male)
@@ -450,29 +439,38 @@ function OpenCloakroomMenu()
end end
end) end)
end end
menu.close()
end, function(data, menu)
menu.close()
end) end)
end end
function OpenPharmacyMenu() 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', { for k,v in pairs(Config.PharmacyItems) do
title = TranslateCap('pharmacy_menu_title'), elements[#elements+1] = {
align = 'top-left', icon = "fas fa-pills",
elements = { title = v.title,
{label = TranslateCap('pharmacy_take', TranslateCap('medikit')), item = 'medikit', type = 'slider', value = 1, min = 1, max = 100}, item = v.item
{label = TranslateCap('pharmacy_take', TranslateCap('bandage')), item = 'bandage', type = 'slider', value = 1, min = 1, max = 100} }
}}, function(data, menu) end
if Config.Debug then
print("[^2INFO^7] Attempting to Give Item - ^5" .. tostring(data.current.item) .. "^7") ESX.OpenContext("right", elements, function(menu,element)
end local elements2 = {
TriggerServerEvent('esx_ambulancejob:giveItem', data.current.item, data.current.value) {unselectable = true, icon = "fas fa-pills", title = element.title},
end, function(data, menu) {title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 100, inputPlaceholder = "Amount to buy.."},
menu.close() {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)
end end
@@ -100,7 +100,7 @@ end)
function OnPlayerDeath() function OnPlayerDeath()
isDead = true isDead = true
ESX.UI.Menu.CloseAll() ESX.CloseContext()
ClearTimecycleModifier() ClearTimecycleModifier()
SetTimecycleModifier("REDMIST_blend") SetTimecycleModifier("REDMIST_blend")
SetTimecycleModifierStrength(0.7) SetTimecycleModifierStrength(0.7)
@@ -115,7 +115,7 @@ end
RegisterNetEvent('esx_ambulancejob:useItem') RegisterNetEvent('esx_ambulancejob:useItem')
AddEventHandler('esx_ambulancejob:useItem', function(itemName) AddEventHandler('esx_ambulancejob:useItem', function(itemName)
ESX.UI.Menu.CloseAll() ESX.CloseContext()
if itemName == 'medikit' then if itemName == 'medikit' then
local lib, anim = 'anim@heists@narcotics@funding@gang_idle', 'gang_chatting_idle01' -- TODO better animations 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) function OpenVehicleSpawnerMenu(type, hospital, part, partNum)
local playerCoords = GetEntityCoords(PlayerPedId()) 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', { ESX.OpenContext("right", elements, function(menu,element)
title = TranslateCap('garage_title'), if element.action == "buy_vehicle" then
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
local shopElements = {} local shopElements = {}
local authorizedVehicles = Config.AuthorizedVehicles[type][ESX.PlayerData.job.grade_name] local authorizedVehicles = Config.AuthorizedVehicles[type][ESX.PlayerData.job.grade_name]
local shopCoords = Config.Hospitals[hospital][part][partNum].InsideShop local shopCoords = Config.Hospitals[hospital][part][partNum].InsideShop
@@ -21,23 +20,30 @@ function OpenVehicleSpawnerMenu(type, hospital, part, partNum)
if IsModelInCdimage(vehicle.model) then if IsModelInCdimage(vehicle.model) then
local vehicleLabel = GetLabelText(GetDisplayNameFromVehicleModel(vehicle.model)) local vehicleLabel = GetLabelText(GetDisplayNameFromVehicleModel(vehicle.model))
table.insert(shopElements, { shopElements[#shopElements+1] = {
label = ('%s - <span style="color:green;">%s</span>'):format(vehicleLabel, TranslateCap('shop_item', ESX.Math.GroupDigits(vehicle.price))), icon = 'fas fa-car',
title = ('%s - <span style="color:green;">%s</span>'):format(vehicleLabel, TranslateCap('shop_item', ESX.Math.GroupDigits(vehicle.price))),
name = vehicleLabel, name = vehicleLabel,
model = vehicle.model, model = vehicle.model,
price = vehicle.price, price = vehicle.price,
props = vehicle.props, props = vehicle.props,
type = type type = type
}) }
end end
end end
if #shopElements > 0 then if #shopElements > 0 then
OpenShopMenu(shopElements, playerCoords, shopCoords) OpenShopMenu(shopElements, playerCoords, shopCoords)
else
ESX.ShowNotification(TranslateCap('garage_notauthorized'))
end end
else
ESX.ShowNotification(TranslateCap('garage_notauthorized'))
end end
elseif data.current.action == 'garage' then elseif element.action == "garage" then
local garage = {} local garage = {
{unselectable = true, icon = "fas fa-car", title = "Garage"}
}
ESX.TriggerServerCallback('esx_vehicleshop:retrieveJobVehicles', function(jobVehicles) ESX.TriggerServerCallback('esx_vehicleshop:retrieveJobVehicles', function(jobVehicles)
if #jobVehicles > 0 then 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')) label = label .. ('<span style="color:darkred;">%s</span>'):format(TranslateCap('garage_notstored'))
end end
table.insert(garage, { garage[#garage+1] = {
label = label, icon = 'fas fa-car',
title = label,
stored = v.stored, stored = v.stored,
model = props.model, model = props.model,
plate = props.plate plate = props.plate
}) }
allVehicleProps[props.plate] = props allVehicleProps[props.plate] = props
end end
end end
if #garage > 0 then if #garage > 0 then
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_garage', { ESX.OpenContext("right", garage, function(menuG,elementG)
title = TranslateCap('garage_title'), if elementG.stored == 1 then
align = 'top-left',
elements = garage
}, function(data2, menu2)
if data2.current.stored == 1 then
local foundSpawn, spawnPoint = GetAvailableVehicleSpawnPoint(hospital, part, partNum) local foundSpawn, spawnPoint = GetAvailableVehicleSpawnPoint(hospital, part, partNum)
if foundSpawn then if foundSpawn then
menu2.close() ESX.CloseContext()
ESX.Game.SpawnVehicle(data2.current.model, spawnPoint.coords, spawnPoint.heading, function(vehicle) ESX.Game.SpawnVehicle(elementG.model, spawnPoint.coords, spawnPoint.heading, function(vehicle)
local vehicleProps = allVehicleProps[data2.current.plate] local vehicleProps = allVehicleProps[elementG.plate]
ESX.Game.SetVehicleProperties(vehicle, vehicleProps) 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')) ESX.ShowNotification(TranslateCap('garage_released'))
end) end)
end end
else else
ESX.ShowNotification(TranslateCap('garage_notavailable')) ESX.ShowNotification(TranslateCap('garage_notavailable'))
end end
end, function(data2, menu2)
menu2.close()
end) end)
else else
ESX.ShowNotification(TranslateCap('garage_empty')) ESX.ShowNotification(TranslateCap('garage_empty'))
@@ -100,11 +101,9 @@ function OpenVehicleSpawnerMenu(type, hospital, part, partNum)
ESX.ShowNotification(TranslateCap('garage_empty')) ESX.ShowNotification(TranslateCap('garage_empty'))
end end
end, type) end, type)
elseif data.current.action == 'store_garage' then elseif element.action == "store_garage" then
StoreNearbyVehicle(playerCoords) StoreNearbyVehicle(playerCoords)
end end
end, function(data, menu)
menu.close()
end) end)
end end
@@ -198,84 +197,71 @@ end
function OpenShopMenu(elements, restoreCoords, shopCoords) function OpenShopMenu(elements, restoreCoords, shopCoords)
local playerPed = PlayerPedId() local playerPed = PlayerPedId()
isInShopMenu = true 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', { ESX.OpenContext("right", elements2, function(menu2,element2)
title = TranslateCap('vehicleshop_title'), if element2.value == "view" then
align = 'top-left', DeleteSpawnedVehicles()
elements = elements WaitForVehicleToLoad(element.model)
}, 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.TriggerServerCallback('esx_ambulancejob:buyJobVehicle', function(bought) ESX.Game.SpawnLocalVehicle(element.model, shopCoords, 0.0, function(vehicle)
if bought then table.insert(spawnedVehicles, vehicle)
ESX.ShowNotification(TranslateCap('vehicleshop_bought', data.current.name, ESX.Math.GroupDigits(data.current.price))) 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 isInShopMenu = false
ESX.UI.Menu.CloseAll() ESX.CloseContext()
DeleteSpawnedVehicles() DeleteSpawnedVehicles()
FreezeEntityPosition(playerPed, false) FreezeEntityPosition(playerPed, false)
SetEntityVisible(playerPed, true) SetEntityVisible(playerPed, true)
ESX.Game.Teleport(playerPed, restoreCoords) ESX.Game.Teleport(playerPed, restoreCoords)
else elseif element3.value == "buy" then
ESX.ShowNotification(TranslateCap('vehicleshop_money')) local newPlate = exports['esx_vehicleshop']:GeneratePlate()
menu2.close() 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
end, props, data.current.type) end)
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)
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 end
CreateThread(function() CreateThread(function()
+11
View File
@@ -35,6 +35,17 @@ Config.RespawnPoints = {
{coords = vector3(1836.03, 3670.99, 34.28), heading = 296.06} -- Sandy Shores {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 = { Config.Hospitals = {
CentralLosSantos = { CentralLosSantos = {
+65 -43
View File
@@ -72,40 +72,54 @@ function OpenCustomersMenu()
ESX.OpenContext("right", elements2, function(menu2,element2) ESX.OpenContext("right", elements2, function(menu2,element2)
local customer = element.data local customer = element.data
if element2.value == "deposit" then if element2.value == "deposit" then
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'customer_deposit_amount', { local elements = {
title = TranslateCap('amount') {unselectable = true, icon = "fas fa-scroll", title = TranslateCap('amount')},
}, function(data2, menu2) {title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 250000, inputPlaceholder = "Amount to bill.."},
local amount = tonumber(data2.value) {icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
}
if amount == nil then ESX.OpenContext("right", elements, function(menu,element)
ESX.ShowNotification(TranslateCap('invalid_amount')) if element.val == "confirm" then
else local amount = tonumber(menu.eles[2].inputValue)
menu2.close()
TriggerServerEvent('esx_bankerjob:customerDeposit', customer.source, amount) if amount == nil then
ESX.ShowNotification("You have deposited $"..amount.." into "..element.title.."s account.") ESX.ShowNotification(TranslateCap('invalid_amount'))
OpenCustomersMenu() 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
end, function(data2, menu2) end, function(menu)
menu2.close() CurrentAction = 'bank_actions_menu'
OpenCustomersMenu() CurrentActionMsg = TranslateCap('press_input_context_to_open_menu')
CurrentActionData = {}
end) end)
elseif element2.value == "withdraw" then elseif element2.value == "withdraw" then
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'customer_withdraw_amount', { local elements = {
title = TranslateCap('amount') {unselectable = true, icon = "fas fa-scroll", title = TranslateCap('amount')},
}, function(data2, menu2) {title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 250000, inputPlaceholder = "Amount to bill.."},
local amount = tonumber(data2.value) {icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
}
if amount == nil then ESX.OpenContext("right", elements, function(menu,element)
ESX.ShowNotification(TranslateCap('invalid_amount')) if element.val == "confirm" then
else local amount = tonumber(menu.eles[2].inputValue)
menu2.close()
TriggerServerEvent('esx_bankerjob:customerWithdraw', customer.source, amount) if amount == nil then
ESX.ShowNotification("You have withdrawn $"..amount.." from "..element.title.."s account.") ESX.ShowNotification(TranslateCap('invalid_amount'))
OpenCustomersMenu() 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
end, function(data2, menu2) end, function(menu)
menu2.close() CurrentAction = 'bank_actions_menu'
OpenCustomersMenu() CurrentActionMsg = TranslateCap('press_input_context_to_open_menu')
CurrentActionData = {}
end) end)
end end
end, function(menu) end, function(menu)
@@ -122,26 +136,34 @@ function OpenCustomersMenu()
end end
function CreateBillingDialog() function CreateBillingDialog()
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'billing', { local elements = {
title = TranslateCap('bill_amount') {unselectable = true, icon = "fas fa-scroll", title = TranslateCap('bill_amount')},
}, function(data, menu) {title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 250000, inputPlaceholder = "Amount to bill.."},
local amount = tonumber(data.value) {icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
}
if amount == nil then ESX.OpenContext("right", elements, function(menu,element)
ESX.ShowNotification(TranslateCap('invalid_amount')) if element.val == "confirm" then
else local amount = tonumber(menu.eles[2].inputValue)
menu.close()
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() if amount == nil then
ESX.ShowNotification(TranslateCap('invalid_amount'))
if closestPlayer == -1 or closestDistance > 5.0 then
ESX.ShowNotification(TranslateCap('no_player_nearby'))
else 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 end
end, function(data, menu) end, function(menu)
menu.close() CurrentAction = 'bank_actions_menu'
CurrentActionMsg = TranslateCap('press_input_context_to_open_menu')
CurrentActionData = {}
end) end)
end end
+1 -1
View File
@@ -27,7 +27,7 @@ function ShowBillsMenu()
end end
RegisterCommand('showbills', function() RegisterCommand('showbills', function()
if not isDead and not ESX.UI.Menu.IsOpen('default', GetCurrentResourceName(), 'billing') then if not isDead then
ShowBillsMenu() ShowBillsMenu()
end end
end, false) end, false)
+105 -107
View File
@@ -5,97 +5,96 @@ function OpenBoatShop(shop)
isInShopMenu = true isInShopMenu = true
local playerPed = PlayerPedId() 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 for k,v in ipairs(Config.Vehicles) do
table.insert(elements, { elements[#elements+1] = {
label = ('%s - <span style="color:green;">$%s</span>'):format(v.label, ESX.Math.GroupDigits(v.price)), icon = "fas fa-ship",
title = ('%s - <span style="color:green;">$%s</span>'):format(v.label, ESX.Math.GroupDigits(v.price)),
name = v.label, name = v.label,
model = v.model, model = v.model,
price = v.price, price = v.price,
props = v.props or nil props = v.props or nil
}) }
end end
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'boat_shop', { ESX.OpenContext("right", elements, function(menu,element)
title = TranslateCap('boat_shop'), local elements2 = {
align = 'top-left', {unselectable = true, icon = "fas fa-ship", title = element.title},
elements = elements {icon = "fas fa-eye", title = "View", val = "view"}
}, 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.TriggerServerCallback('esx_boat:buyBoat', function(bought) ESX.OpenContext("right", elements2, function(menu2,element2)
if bought then if element2.val == "view" then
ESX.ShowNotification(TranslateCap('boat_shop_bought', data.current.name, ESX.Math.GroupDigits(data.current.price))) DeleteSpawnedVehicles()
DeleteSpawnedVehicles() ESX.Game.SpawnLocalVehicle(element.model, shop.Inside, shop.Inside.w, function (vehicle)
isInShopMenu = false table.insert(spawnedVehicles, vehicle)
ESX.UI.Menu.CloseAll() TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
FreezeEntityPosition(vehicle, true)
CurrentAction = 'boat_shop' if element.props then
CurrentActionMsg = TranslateCap('boat_shop_open') ESX.Game.SetVehicleProperties(vehicle, element.props)
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()
end 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' CurrentAction = 'boat_shop'
CurrentActionMsg = TranslateCap('boat_shop_open') 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)
end end
@@ -105,24 +104,22 @@ function OpenBoatGarage(garage)
ESX.ShowNotification(TranslateCap('garage_noboats')) ESX.ShowNotification(TranslateCap('garage_noboats'))
else else
-- get all available boats -- get all available boats
local elements = {} local elements = {
{unselectable = true, icon = "fas fa-ship", title = TranslateCap('garage')}
}
for i=1, #ownedBoats, 1 do for i=1, #ownedBoats, 1 do
ownedBoats[i] = json.decode(ownedBoats[i]) ownedBoats[i] = json.decode(ownedBoats[i])
table.insert(elements, { elements[#elements+1] = {
label = getVehicleLabelFromHash(ownedBoats[i].model), icon = "fas fa-ship",
title = getVehicleLabelFromHash(ownedBoats[i].model),
vehicleProps = ownedBoats[i] vehicleProps = ownedBoats[i]
}) }
end end
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'boat_garage', { ESX.OpenContext("right", elements, function(menu,element)
title = TranslateCap('garage'),
align = 'top-left',
elements = elements
}, function (data, menu)
-- make sure the spawn point isn't blocked
local playerPed = PlayerPedId() local playerPed = PlayerPedId()
local vehicleProps = data.current.vehicleProps local vehicleProps = element.vehicleProps
if ESX.Game.IsSpawnPointClear(garage.SpawnPoint, 4.0) then if ESX.Game.IsSpawnPointClear(garage.SpawnPoint, 4.0) then
TriggerServerEvent('esx_boat:takeOutVehicle', vehicleProps.plate) TriggerServerEvent('esx_boat:takeOutVehicle', vehicleProps.plate)
@@ -133,13 +130,11 @@ function OpenBoatGarage(garage)
ESX.Game.SetVehicleProperties(vehicle, vehicleProps) ESX.Game.SetVehicleProperties(vehicle, vehicleProps)
end) end)
menu.close() ESX.CloseContext()
else else
ESX.ShowNotification(TranslateCap('garage_blocked')) ESX.ShowNotification(TranslateCap('garage_blocked'))
end end
end, function (data, menu) end, function(menu)
menu.close()
CurrentAction = 'garage_out' CurrentAction = 'garage_out'
CurrentActionMsg = TranslateCap('garage_open') CurrentActionMsg = TranslateCap('garage_open')
end) end)
@@ -148,33 +143,36 @@ function OpenBoatGarage(garage)
end end
function OpenLicenceMenu(shop) function OpenLicenceMenu(shop)
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'boat_license', { local elements = {
title = TranslateCap('license_menu'), {unselectable = true, icon = "fas fa-ship", title = TranslateCap('license_menu')},
align = 'top-left', {icon = "fas fa-ship", title = "Purchase Boat License"}
elements = { }
{label = TranslateCap('license_buy_no'), value = 'no'},
{label = TranslateCap('license_buy_yes', ESX.Math.GroupDigits(Config.LicensePrice)), value = 'yes'} ESX.OpenContext("right", elements, function(menu,element)
}}, function (data, menu) local elements2 = {
if data.current.value == 'yes' then {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) ESX.TriggerServerCallback('esx_boat:buyBoatLicense', function (boughtLicense)
if boughtLicense then if boughtLicense then
ESX.ShowNotification(TranslateCap('license_bought', ESX.Math.GroupDigits(Config.LicensePrice))) ESX.ShowNotification(TranslateCap('license_bought', ESX.Math.GroupDigits(Config.LicensePrice)))
menu.close() ESX.CloseContext()
OpenBoatShop(shop) -- parse current shop OpenBoatShop(shop) -- parse current shop
else else
ESX.ShowNotification(TranslateCap('license_nomoney')) ESX.ShowNotification(TranslateCap('license_nomoney'))
end end
end) end)
else end, function(menu)
CurrentAction = 'boat_shop' CurrentAction = 'boat_shop'
CurrentActionMsg = TranslateCap('boat_shop_open') CurrentActionMsg = TranslateCap('boat_shop_open')
menu.close() end)
end end, function(menu)
end, function (data, menu) CurrentAction = 'boat_shop'
CurrentAction = 'boat_shop'
CurrentActionMsg = TranslateCap('boat_shop_open') CurrentActionMsg = TranslateCap('boat_shop_open')
menu.close()
end) end)
end end
+1 -1
View File
@@ -68,7 +68,7 @@ end)
AddEventHandler('esx_boat:hasExitedMarker', function() AddEventHandler('esx_boat:hasExitedMarker', function()
if not isInShopMenu then if not isInShopMenu then
ESX.UI.Menu.CloseAll() ESX.CloseContext()
end end
CurrentAction = nil CurrentAction = nil
+7 -7
View File
@@ -33,18 +33,18 @@ function OpenShopMenu()
ESX.OpenContext("right", elements2, function(menu2,element2) ESX.OpenContext("right", elements2, function(menu2,element2)
if element2.value == "yes" then if element2.value == "yes" then
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'outfit_name', { local elements3 = {
title = TranslateCap('name_outfit') {unselectable = true, icon = "fas fa-shirt", title = TranslateCap('name_outfit')},
}, function(data3, menu3) {title = "Outfit Name", input = true, inputType = "text", inputPlaceholder = "Outfit name in wardrobe.."},
menu3.close() {icon = "fas fa-check-circle", title = "Confirm", value = "confirm"}
}
ESX.OpenContext("right", elements3, function(menu3,element3)
TriggerEvent('skinchanger:getSkin', function(skin) TriggerEvent('skinchanger:getSkin', function(skin)
ESX.CloseContext() ESX.CloseContext()
TriggerServerEvent('esx_clotheshop:saveOutfit', data3.value, skin) TriggerServerEvent('esx_clotheshop:saveOutfit', menu3.eles[2].inputValue, skin)
ESX.ShowNotification(TranslateCap('saved_outfit')) ESX.ShowNotification(TranslateCap('saved_outfit'))
end) end)
end, function(data3, menu3)
menu3.close()
end) end)
elseif element2.value == "no" then elseif element2.value == "no" then
ESX.CloseContext() ESX.CloseContext()
+35 -52
View File
@@ -21,7 +21,6 @@ CreateThread(function()
inZoneDrugShop = false inZoneDrugShop = false
if menuOpen then if menuOpen then
menuOpen=false menuOpen=false
ESX.UI.Menu.CloseAll()
end end
end end
@@ -62,36 +61,39 @@ CreateThread(function ()
end) end)
function OpenDrugShop() function OpenDrugShop()
ESX.UI.Menu.CloseAll() local elements = {
local elements = {} {unselectable = true, icon = "fas fa-cannabis", title = TranslateCap('dealer_title')}
}
menuOpen = true menuOpen = true
for k, v in pairs(ESX.GetPlayerData().inventory) do for k, v in pairs(ESX.GetPlayerData().inventory) do
local price = Config.DrugDealerItems[v.name] local price = Config.DrugDealerItems[v.name]
if price and v.count > 0 then if price and v.count > 0 then
table.insert(elements, { elements[#elements+1] = {
label = ('%s - <span style="color:green;">%s</span>'):format(v.label, TranslateCap('dealer_item', ESX.Math.GroupDigits(price))), 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, name = v.name,
price = price, price = price,
}
-- menu properties
type = 'slider',
value = 1,
min = 1,
max = v.count
})
end end
end end
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'drug_shop', { ESX.OpenContext("right", elements, function(menu,element)
title = TranslateCap('dealer_title'), local elements2 = {
align = 'top-left', {unselectable = true, icon = "fas fa-shopping-basket", title = element.title},
elements = elements {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},
}, function(data, menu) {icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
TriggerServerEvent('esx_drugs:sellDrug', data.current.name, data.current.value) }
end, function(data, menu)
menu.close() 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 menuOpen = false
end) end)
end end
@@ -99,7 +101,7 @@ end
AddEventHandler('onResourceStop', function(resource) AddEventHandler('onResourceStop', function(resource)
if resource == GetCurrentResourceName() then if resource == GetCurrentResourceName() then
if menuOpen then if menuOpen then
ESX.UI.Menu.CloseAll() ESX.CloseContext()
end end
end end
end) end)
@@ -109,39 +111,20 @@ function OpenBuyLicenseMenu(licenseName)
local license = Config.LicensePrices[licenseName] local license = Config.LicensePrices[licenseName]
local elements = { local elements = {
{ {unselectable = true, title = TranslateCap('purchase_license')},
label = TranslateCap('license_no'), {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}
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
}
} }
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'license_shop', { ESX.OpenContext("right", elements, function(menu,element)
title = TranslateCap('license_title'), ESX.TriggerServerCallback('esx_drugs:buyLicense', function(boughtLicense)
align = 'top-left', if boughtLicense then
elements = elements ESX.CloseContext()
}, function(data, menu) ESX.ShowNotification(TranslateCap('license_bought', element.licenseName, ESX.Math.GroupDigits(element.price)))
else
if data.current.value ~= 'no' then ESX.ShowNotification(TranslateCap('license_bought_fail', element.licenseName))
ESX.TriggerServerCallback('esx_drugs:buyLicense', function(boughtLicense) end
if boughtLicense then end, element.value)
ESX.ShowNotification(TranslateCap('license_bought', data.current.licenseName, ESX.Math.GroupDigits(data.current.price))) end, function(menu)
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()
menuOpen = false menuOpen = false
end) end)
end end
+7
View File
@@ -31,3 +31,10 @@ Config.Marker = {
Size = vector3(1.5,1.5,1.0), Size = vector3(1.5,1.5,1.0),
Type = 1, Type = 1,
} }
-- min amount of Config.DrugDealerItems to sell
-- max amount of Config.DrugDealerItems to sell
Config.SellMenu = {
Min = 1,
Max = 50
}
+8 -15
View File
@@ -27,17 +27,14 @@ RegisterNetEvent('esx:setJob',function(job)
end) end)
function OpenMenu() 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', ESX.OpenContext("right", elements, function(menu,element)
{ if element.value == "citizen_wear" then
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
onDuty = false onDuty = false
ESX.ShowNotification(TranslateCap('offduty'),"success") ESX.ShowNotification(TranslateCap('offduty'),"success")
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
@@ -49,7 +46,7 @@ function OpenMenu()
end) end)
end) end)
end) end)
elseif data.current.value == 'job_wear' then elseif element.value == "job_wear" then
onDuty = true onDuty = true
ESX.ShowNotification(TranslateCap('onduty'), "success") ESX.ShowNotification(TranslateCap('onduty'), "success")
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
@@ -68,10 +65,6 @@ function OpenMenu()
end end
end) end)
end end
menu.close()
end, function(data, menu)
menu.close()
end) end)
end end
+5 -5
View File
@@ -268,9 +268,9 @@ Locales['es'] = {
['stickers'] = 'calcomanías', ['stickers'] = 'calcomanías',
-- Xenon Colors -- Xenon Colors
['mintgreen'] = 'Mint Green', ['mintgreen'] = 'Menta verde',
['goldenshower'] = 'Golden Shower', ['goldenshower'] = 'Baño de oro',
['ponypink'] = 'Pony Pink', ['ponypink'] = 'Poni rosa',
['hotpink'] = 'Hot Pink', ['hotpink'] = 'Rosa caliente',
['blacklight'] = 'Blacklight', ['blacklight'] = 'Luz negra',
} }
+136 -176
View File
@@ -54,44 +54,41 @@ end
function OpenMechanicActionsMenu() function OpenMechanicActionsMenu()
local elements = { local elements = {
{label = TranslateCap('vehicle_list'), value = 'vehicle_list'}, {unselectable = true, icon = "fas fa-gear", title = TranslateCap('mechanic')},
{label = TranslateCap('work_wear'), value = 'cloakroom'}, {icon = "fas fa-car", title = TranslateCap('vehicle_list'), value = 'vehicle_list'},
{label = TranslateCap('civ_wear'), value = 'cloakroom2'}, {icon = "fas fa-shirt", title = TranslateCap('work_wear'), value = 'cloakroom'},
{label = TranslateCap('deposit_stock'), value = 'put_stock'}, {icon = "fas fa-shirt", title = TranslateCap('civ_wear'), value = 'cloakroom2'},
{label = TranslateCap('withdraw_stock'), value = 'get_stock'} {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 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 end
ESX.UI.Menu.CloseAll() ESX.OpenContext("right", elements, function(menu,element)
if element.value == 'vehicle_list' then
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
if Config.EnableSocietyOwnedVehicles then if Config.EnableSocietyOwnedVehicles then
local elements2 = {
local elements = {} {unselectable = true, icon = "fas fa-car", title = TranslateCap('service_vehicle')}
}
ESX.TriggerServerCallback('esx_society:getVehiclesInGarage', function(vehicles) ESX.TriggerServerCallback('esx_society:getVehiclesInGarage', function(vehicles)
for i=1, #vehicles, 1 do for i=1, #vehicles, 1 do
table.insert(elements, { elements2[#elements2+1] = {
label = GetDisplayNameFromVehicleModel(vehicles[i].model) .. ' [' .. vehicles[i].plate .. ']', icon = 'fas fa-car',
title = GetDisplayNameFromVehicleModel(vehicles[i].model) .. ' [' .. vehicles[i].plate .. ']',
value = vehicles[i] value = vehicles[i]
}) }
end end
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'vehicle_spawner', { ESX.OpenContext("right", elements2, function(menu2,element2)
title = TranslateCap('service_vehicle'), ESX.CloseContext()
align = 'top-left', local vehicleProps = element.value
elements = elements
}, function(data, menu)
menu.close()
local vehicleProps = data.current.value
ESX.Game.SpawnVehicle(vehicleProps.model, Config.Zones.VehicleSpawnPoint.Pos, 270.0, function(vehicle) ESX.Game.SpawnVehicle(vehicleProps.model, Config.Zones.VehicleSpawnPoint.Pos, 270.0, function(vehicle)
ESX.Game.SetVehicleProperties(vehicle, vehicleProps) ESX.Game.SetVehicleProperties(vehicle, vehicleProps)
@@ -100,38 +97,35 @@ function OpenMechanicActionsMenu()
end) end)
TriggerServerEvent('esx_society:removeVehicleFromGarage', 'mechanic', vehicleProps) TriggerServerEvent('esx_society:removeVehicleFromGarage', 'mechanic', vehicleProps)
end, function(data, menu)
menu.close()
end) end)
end, 'mechanic') end, 'mechanic')
else else
local elements2 = {
local elements = { {unselectable = true, icon = "fas fa-car", title = TranslateCap('service_vehicle')},
{label = TranslateCap('flat_bed'), value = 'flatbed'}, {icon = "fas fa-truck", title = TranslateCap('flat_bed'), value = 'flatbed'},
{label = TranslateCap('tow_truck'), value = 'towtruck2'} {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 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 end
ESX.UI.Menu.CloseAll() ESX.OpenContext("right", elements2, function(menu2,element2)
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'spawn_vehicle', {
title = TranslateCap('service_vehicle'),
align = 'top-left',
elements = elements
}, function(data, menu)
if Config.MaxInService == -1 then 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() local playerPed = PlayerPedId()
TaskWarpPedIntoVehicle(playerPed, vehicle, -1) TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
end) end)
else else
ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount) ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount)
if canTakeService then 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() local playerPed = PlayerPedId()
TaskWarpPedIntoVehicle(playerPed, vehicle, -1) TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
end) end)
@@ -140,16 +134,10 @@ function OpenMechanicActionsMenu()
end end
end, 'mechanic') end, 'mechanic')
end end
menu.close()
end, function(data, menu)
menu.close()
OpenMechanicActionsMenu()
end) end)
end end
elseif data.current.value == 'cloakroom' then elseif element.value == 'cloakroom' then
menu.close() ESX.CloseContext()
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
if skin.sex == 0 then if skin.sex == 0 then
TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_male) TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_male)
@@ -157,27 +145,24 @@ function OpenMechanicActionsMenu()
TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female) TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female)
end end
end) end)
elseif data.current.value == 'cloakroom2' then elseif element.value == 'cloakroom2' then
menu.close() ESX.CloseContext()
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
TriggerEvent('skinchanger:loadSkin', skin) TriggerEvent('skinchanger:loadSkin', skin)
end) end)
elseif Config.OxInventory and (element.value == 'put_stock' or element.value == 'get_stock') then
elseif Config.OxInventory and (data.current.value == 'put_stock' or data.current.value == 'get_stock') then
exports.ox_inventory:openInventory('stash', 'society_mechanic') exports.ox_inventory:openInventory('stash', 'society_mechanic')
return ESX.UI.Menu.CloseAll() return ESX.CloseContext()
elseif data.current.value == 'put_stock' then elseif element.value == 'put_stock' then
OpenPutStocksMenu() OpenPutStocksMenu()
elseif data.current.value == 'get_stock' then elseif element.value == 'get_stock' then
OpenGetStocksMenu() OpenGetStocksMenu()
elseif data.current.value == 'boss_actions' then elseif element.value == 'boss_actions' then
TriggerEvent('esx_society:openBossMenu', 'mechanic', function(data, menu) TriggerEvent('esx_society:openBossMenu', 'mechanic', function(data, menu)
menu.close() menu.close()
end) end)
end end
end, function(data, menu) end, function(menu)
menu.close()
CurrentAction = 'mechanic_actions_menu' CurrentAction = 'mechanic_actions_menu'
CurrentActionMsg = TranslateCap('open_actions') CurrentActionMsg = TranslateCap('open_actions')
CurrentActionData = {} CurrentActionData = {}
@@ -187,29 +172,21 @@ end
function OpenMechanicHarvestMenu() function OpenMechanicHarvestMenu()
if Config.EnablePlayerManagement and ESX.PlayerData.job and ESX.PlayerData.job.grade_name ~= 'recrue' then if Config.EnablePlayerManagement and ESX.PlayerData.job and ESX.PlayerData.job.grade_name ~= 'recrue' then
local elements = { local elements = {
{label = TranslateCap('gas_can'), value = 'gaz_bottle'}, {unselectable = true, icon = "fas fa-gear", title = "Mechanic Harvest Menu"},
{label = TranslateCap('repair_tools'), value = 'fix_tool'}, {icon = "fas fa-gear", title = TranslateCap('gas_can'), value = 'gaz_bottle'},
{label = TranslateCap('body_work_tools'), value = 'caro_tool'} {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.OpenContext("right", elements, function(menu,element)
if element.value == 'gaz_bottle' then
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
TriggerServerEvent('esx_mechanicjob:startHarvest') TriggerServerEvent('esx_mechanicjob:startHarvest')
elseif data.current.value == 'fix_tool' then elseif element.value == 'fix_tool' then
TriggerServerEvent('esx_mechanicjob:startHarvest2') TriggerServerEvent('esx_mechanicjob:startHarvest2')
elseif data.current.value == 'caro_tool' then elseif element.value == 'caro_tool' then
TriggerServerEvent('esx_mechanicjob:startHarvest3') TriggerServerEvent('esx_mechanicjob:startHarvest3')
end end
end, function(data, menu) end, function(menu)
menu.close()
CurrentAction = 'mechanic_harvest_menu' CurrentAction = 'mechanic_harvest_menu'
CurrentActionMsg = TranslateCap('harvest_menu') CurrentActionMsg = TranslateCap('harvest_menu')
CurrentActionData = {} CurrentActionData = {}
@@ -222,30 +199,21 @@ end
function OpenMechanicCraftMenu() function OpenMechanicCraftMenu()
if Config.EnablePlayerManagement and ESX.PlayerData.job and ESX.PlayerData.job.grade_name ~= 'recrue' then if Config.EnablePlayerManagement and ESX.PlayerData.job and ESX.PlayerData.job.grade_name ~= 'recrue' then
local elements = { local elements = {
{label = TranslateCap('blowtorch'), value = 'blow_pipe'}, {unselectable = true, icon = "fas fa-gear", title = "Mechanic Craft Menu"},
{label = TranslateCap('repair_kit'), value = 'fix_kit'}, {icon = "fas fa-gear", title = TranslateCap('blowtorch'), value = 'blow_pipe'},
{label = TranslateCap('body_kit'), value = 'caro_kit'} {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.OpenContext("right", elements, function(menu,element)
if element.value == 'blow_pipe' then
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
TriggerServerEvent('esx_mechanicjob:startCraft') TriggerServerEvent('esx_mechanicjob:startCraft')
elseif data.current.value == 'fix_kit' then elseif element.value == 'fix_kit' then
TriggerServerEvent('esx_mechanicjob:startCraft2') TriggerServerEvent('esx_mechanicjob:startCraft2')
elseif data.current.value == 'caro_kit' then elseif element.value == 'caro_kit' then
TriggerServerEvent('esx_mechanicjob:startCraft3') TriggerServerEvent('esx_mechanicjob:startCraft3')
end end
end, function(data, menu) end, function(menu)
menu.close()
CurrentAction = 'mechanic_craft_menu' CurrentAction = 'mechanic_craft_menu'
CurrentActionMsg = TranslateCap('craft_menu') CurrentActionMsg = TranslateCap('craft_menu')
CurrentActionData = {} CurrentActionData = {}
@@ -256,27 +224,29 @@ function OpenMechanicCraftMenu()
end end
function OpenMobileMechanicActionsMenu() 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', { ESX.OpenContext("right", elements, function(menu,element)
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)
if isBusy then return end if isBusy then return end
if data.current.value == 'billing' then if element.value == "billing" then
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'billing', { local elements2 = {
title = TranslateCap('invoice_amount') {unselectable = true, icon = "fas fa-scroll", title = element.title},
}, function(data, menu) {title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 250000, inputPlaceholder = "Amount to bill.."},
local amount = tonumber(data.value) {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 if amount == nil or amount < 0 then
ESX.ShowNotification(TranslateCap('amount_invalid'), "error") ESX.ShowNotification(TranslateCap('amount_invalid'), "error")
@@ -289,10 +259,8 @@ function OpenMobileMechanicActionsMenu()
TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_mechanic', TranslateCap('mechanic'), amount) TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_mechanic', TranslateCap('mechanic'), amount)
end end
end end
end, function(data, menu)
menu.close()
end) end)
elseif data.current.value == 'hijack_vehicle' then elseif element.value == "hijack_vehicle" then
local playerPed = PlayerPedId() local playerPed = PlayerPedId()
local vehicle = ESX.Game.GetVehicleInDirection() local vehicle = ESX.Game.GetVehicleInDirection()
local coords = GetEntityCoords(playerPed) local coords = GetEntityCoords(playerPed)
@@ -318,7 +286,7 @@ function OpenMobileMechanicActionsMenu()
else else
ESX.ShowNotification(TranslateCap('no_vehicle_nearby')) ESX.ShowNotification(TranslateCap('no_vehicle_nearby'))
end end
elseif data.current.value == 'fix_vehicle' then elseif element.value == "fix_vehicle" then
local playerPed = PlayerPedId() local playerPed = PlayerPedId()
local vehicle = ESX.Game.GetVehicleInDirection() local vehicle = ESX.Game.GetVehicleInDirection()
local coords = GetEntityCoords(playerPed) local coords = GetEntityCoords(playerPed)
@@ -346,7 +314,7 @@ function OpenMobileMechanicActionsMenu()
else else
ESX.ShowNotification(TranslateCap('no_vehicle_nearby')) ESX.ShowNotification(TranslateCap('no_vehicle_nearby'))
end end
elseif data.current.value == 'clean_vehicle' then elseif element.value == "clean_vehicle" then
local playerPed = PlayerPedId() local playerPed = PlayerPedId()
local vehicle = ESX.Game.GetVehicleInDirection() local vehicle = ESX.Game.GetVehicleInDirection()
local coords = GetEntityCoords(playerPed) local coords = GetEntityCoords(playerPed)
@@ -371,7 +339,7 @@ function OpenMobileMechanicActionsMenu()
else else
ESX.ShowNotification(TranslateCap('no_vehicle_nearby')) ESX.ShowNotification(TranslateCap('no_vehicle_nearby'))
end end
elseif data.current.value == 'del_vehicle' then elseif element.value == "del_vehicle" then
local playerPed = PlayerPedId() local playerPed = PlayerPedId()
if IsPedSittingInAnyVehicle(playerPed) then if IsPedSittingInAnyVehicle(playerPed) then
@@ -393,7 +361,7 @@ function OpenMobileMechanicActionsMenu()
ESX.ShowNotification(TranslateCap('must_near')) ESX.ShowNotification(TranslateCap('must_near'))
end end
end end
elseif data.current.value == 'dep_vehicle' then elseif element.value == "dep_vehicle" then
local playerPed = PlayerPedId() local playerPed = PlayerPedId()
local vehicle = GetVehiclePedIsIn(playerPed, true) local vehicle = GetVehiclePedIsIn(playerPed, true)
@@ -459,7 +427,7 @@ function OpenMobileMechanicActionsMenu()
else else
ESX.ShowNotification(TranslateCap('imp_flatbed')) ESX.ShowNotification(TranslateCap('imp_flatbed'))
end end
elseif data.current.value == 'object_spawner' then elseif element.value == "object_spawner" then
local playerPed = PlayerPedId() local playerPed = PlayerPedId()
if IsPedSittingInAnyVehicle(playerPed) then if IsPedSittingInAnyVehicle(playerPed) then
@@ -467,14 +435,14 @@ function OpenMobileMechanicActionsMenu()
return return
end end
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'mobile_mechanic_actions_spawn', { local elements2 = {
title = TranslateCap('objects'), {unselectable= true, icon = "fas fa-object", title = TranslateCap('objects')},
align = 'top-left', {icon = "fas fa-object", title = TranslateCap('roadcone'), value = 'prop_roadcone02a'},
elements = { {icon = "fas fa-object", title = TranslateCap('toolbox'), value = 'prop_toolchest_01'}
{label = TranslateCap('roadcone'), value = 'prop_roadcone02a'}, }
{label = TranslateCap('toolbox'), value = 'prop_toolchest_01'}
}}, function(data2, menu2) ESX.OpenContext("right", elements2, function(menuObj,elementObj)
local model = data2.current.value local model = elementObj.value
local coords = GetEntityCoords(playerPed) local coords = GetEntityCoords(playerPed)
local forward = GetEntityForwardVector(playerPed) local forward = GetEntityForwardVector(playerPed)
local x, y, z = table.unpack(coords + forward * 1.0) local x, y, z = table.unpack(coords + forward * 1.0)
@@ -489,100 +457,92 @@ function OpenMobileMechanicActionsMenu()
SetEntityHeading(obj, GetEntityHeading(playerPed)) SetEntityHeading(obj, GetEntityHeading(playerPed))
PlaceObjectOnGroundProperly(obj) PlaceObjectOnGroundProperly(obj)
end) end)
end, function(data2, menu2)
menu2.close()
end) end)
end end
end, function(data, menu)
menu.close()
end) end)
end end
function OpenGetStocksMenu() function OpenGetStocksMenu()
ESX.TriggerServerCallback('esx_mechanicjob:getStockItems', function(items) 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 for i=1, #items, 1 do
table.insert(elements, { elements[#elements+1] = {
label = 'x' .. items[i].count .. ' ' .. items[i].label, icon = 'fas fa-box',
title = 'x' .. items[i].count .. ' ' .. items[i].label,
value = items[i].name value = items[i].name
}) }
end end
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', { ESX.OpenContext("right", elements, function(menu,element)
title = TranslateCap('mechanic_stock'), local itemName = element.value
align = 'top-left',
elements = elements
}, function(data, menu)
local itemName = data.current.value
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', { local elements2 = {
title = TranslateCap('quantity') {unselectable = true, icon = "fas fa-box", title = element.title},
}, function(data2, menu2) {title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 100, inputPlaceholder = "Amount to withdraw.."},
local count = tonumber(data2.value) {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 if count == nil then
ESX.ShowNotification(TranslateCap('invalid_quantity')) ESX.ShowNotification(TranslateCap('invalid_quantity'))
else else
menu2.close() ESX.CloseContext()
menu.close()
TriggerServerEvent('esx_mechanicjob:getStockItem', itemName, count) TriggerServerEvent('esx_mechanicjob:getStockItem', itemName, count)
Wait(1000) Wait(1000)
OpenGetStocksMenu() OpenGetStocksMenu()
end end
end, function(data2, menu2)
menu2.close()
end) end)
end, function(data, menu)
menu.close()
end) end)
end) end)
end end
function OpenPutStocksMenu() function OpenPutStocksMenu()
ESX.TriggerServerCallback('esx_mechanicjob:getPlayerInventory', function(inventory) 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 for i=1, #inventory.items, 1 do
local item = inventory.items[i] local item = inventory.items[i]
if item.count > 0 then if item.count > 0 then
table.insert(elements, { elements[#elements+1] = {
label = item.label .. ' x' .. item.count, icon = 'fas fa-box',
title = item.label .. ' x' .. item.count,
type = 'item_standard', type = 'item_standard',
value = item.name value = item.name
}) }
end end
end end
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'stocks_menu', { ESX.OpenContext("right", elements, function(menu,element)
title = TranslateCap('inventory'), local itemName = element.value
align = 'top-left',
elements = elements
}, function(data, menu)
local itemName = data.current.value
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', { local elements2 = {
title = TranslateCap('quantity') {unselectable = true, icon = "fas fa-box", title = element.title},
}, function(data2, menu2) {title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 100, inputPlaceholder = "Amount to deposit.."},
local count = tonumber(data2.value) {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 if count == nil then
ESX.ShowNotification(TranslateCap('invalid_quantity')) ESX.ShowNotification(TranslateCap('invalid_quantity'))
else else
menu2.close() ESX.CloseContext()
menu.close()
TriggerServerEvent('esx_mechanicjob:putStockItems', itemName, count) TriggerServerEvent('esx_mechanicjob:putStockItems', itemName, count)
Wait(1000) Wait(1000)
OpenPutStocksMenu() OpenPutStocksMenu()
end end
end, function(data2, menu2)
menu2.close()
end) end)
end, function(data, menu)
menu.close()
end) end)
end) end)
end end
@@ -738,7 +698,7 @@ AddEventHandler('esx_mechanicjob:hasExitedMarker', function(zone)
end end
CurrentAction = nil CurrentAction = nil
ESX.UI.Menu.CloseAll() ESX.CloseContext()
end) end)
AddEventHandler('esx_mechanicjob:hasEnteredEntityZone', function(entity) AddEventHandler('esx_mechanicjob:hasEnteredEntityZone', function(entity)
+26 -36
View File
@@ -2,49 +2,39 @@ local hasAlreadyEnteredMarker, lastZone
local currentAction, currentActionMsg, currentActionData = nil, nil, {} local currentAction, currentActionMsg, currentActionData = nil, nil, {}
function OpenShopMenu(zone) 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 for i=1, #Config.Zones[zone].Items, 1 do
local item = Config.Zones[zone].Items[i] local item = Config.Zones[zone].Items[i]
table.insert(elements, { elements[#elements+1] = {
label = ('%s - <span style="color:green;">%s</span>'):format(item.label, TranslateCap('shop_item', ESX.Math.GroupDigits(item.price))), 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, itemLabel = item.label,
item = item.name, item = item.name,
price = item.price, price = item.price
}
-- menu properties
value = 1,
type = 'slider',
min = 1,
max = 100
})
end 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', { ESX.OpenContext("right", elements2, function(menu2,element2)
title = TranslateCap('shop'), local amount = menu2.eles[2].inputValue
align = 'bottom-left', ESX.CloseContext()
elements = elements TriggerServerEvent('esx_shops:buyItem', element.item, amount, zone)
}, function(data, menu) end, function(menu)
ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'shop_confirm', { currentAction = 'shop_menu'
title = TranslateCap('shop_confirm', data.current.value, data.current.itemLabel, ESX.Math.GroupDigits(data.current.price * data.current.value)), currentActionMsg = TranslateCap('press_menu')
align = 'bottom-left', currentActionData = {zone = zone}
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()
end) end)
end, function(data, menu) end, function(menu)
menu.close()
currentAction = 'shop_menu' currentAction = 'shop_menu'
currentActionMsg = TranslateCap('press_menu') currentActionMsg = TranslateCap('press_menu')
currentActionData = {zone = zone} currentActionData = {zone = zone}
@@ -59,7 +49,7 @@ end)
AddEventHandler('esx_shops:hasExitedMarker', function(zone) AddEventHandler('esx_shops:hasExitedMarker', function(zone)
currentAction = nil currentAction = nil
ESX.UI.Menu.CloseAll() ESX.CloseContext()
end) end)
-- Create Blips -- Create Blips
+25 -24
View File
@@ -238,15 +238,18 @@ function OpenMobileTaxiActionsMenu()
ESX.OpenContext("right", elements, function(menu,element) ESX.OpenContext("right", elements, function(menu,element)
if element.value == "billing" then if element.value == "billing" then
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'billing', { local elements2 = {
title = TranslateCap('invoice_amount') {unselectable = true, icon = "fas fa-taxi", title = element.title},
}, function(data, menu) {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 if amount == nil then
ESX.ShowNotification(TranslateCap('amount_invalid')) ESX.ShowNotification(TranslateCap('amount_invalid'))
else else
menu.close() ESX.CloseContext()
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer() local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
if closestPlayer == -1 or closestDistance > 3.0 then if closestPlayer == -1 or closestDistance > 3.0 then
ESX.ShowNotification(TranslateCap('no_players_near')) ESX.ShowNotification(TranslateCap('no_players_near'))
@@ -256,8 +259,6 @@ function OpenMobileTaxiActionsMenu()
ESX.ShowNotification(TranslateCap('billing_sent')) ESX.ShowNotification(TranslateCap('billing_sent'))
end end
end end
end, function(data, menu)
menu.close()
end) end)
elseif element.value == "start_job" then elseif element.value == "start_job" then
if OnJob then if OnJob then
@@ -322,24 +323,24 @@ function OpenGetStocksMenu()
ESX.OpenContext("right", elements, function(menu,element) ESX.OpenContext("right", elements, function(menu,element)
local itemName = element.value local itemName = element.value
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_get_item_count', { local elements2 = {
title = TranslateCap('quantity') {unselectable = true, icon = "fas fa-box", title = element.title},
}, function(data2, menu2) {title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 100, inputPlaceholder = "Amount to withdraw.."},
local count = tonumber(data2.value) {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 if count == nil then
ESX.ShowNotification(TranslateCap('quantity_invalid')) ESX.ShowNotification(TranslateCap('quantity_invalid'))
else else
menu2.close()
ESX.CloseContext() ESX.CloseContext()
-- todo: refresh on callback
TriggerServerEvent('esx_taxijob:getStockItem', itemName, count) TriggerServerEvent('esx_taxijob:getStockItem', itemName, count)
Wait(1000) Wait(1000)
OpenGetStocksMenu() OpenGetStocksMenu()
end end
end, function(data2, menu2)
menu2.close()
end) end)
end) end)
end, function(menu) end, function(menu)
@@ -370,24 +371,24 @@ function OpenPutStocksMenu()
ESX.OpenContext("right", elements, function(menu,element) ESX.OpenContext("right", elements, function(menu,element)
local itemName = element.value local itemName = element.value
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'stocks_menu_put_item_count', { local elements2 = {
title = TranslateCap('quantity') {unselectable = true, icon = "fas fa-box", title = element.title},
}, function(data2, menu2) {title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 100, inputPlaceholder = "Amount to deposit.."},
local count = tonumber(data2.value) {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 if count == nil then
ESX.ShowNotification(TranslateCap('quantity_invalid')) ESX.ShowNotification(TranslateCap('quantity_invalid'))
else else
menu2.close()
ESX.CloseContext() ESX.CloseContext()
-- todo: refresh on callback -- todo: refresh on callback
TriggerServerEvent('esx_taxijob:putStockItems', itemName, count) TriggerServerEvent('esx_taxijob:putStockItems', itemName, count)
Wait(1000) Wait(1000)
OpenPutStocksMenu() OpenPutStocksMenu()
end end
end, function(data2, menu2)
menu2.close()
end) end)
end) end)
end, function(menu) end, function(menu)
+57
View File
@@ -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'
}
+2 -1
View File
@@ -99,12 +99,13 @@ end)
RegisterNetEvent('esx_taxijob:putStockItems') RegisterNetEvent('esx_taxijob:putStockItems')
AddEventHandler('esx_taxijob:putStockItems', function(itemName, count) AddEventHandler('esx_taxijob:putStockItems', function(itemName, count)
local xPlayer = ESX.GetPlayerFromId(source) local xPlayer = ESX.GetPlayerFromId(source)
local sourceItem = xPlayer.getInventoryItem(itemName)
if xPlayer.job.name == 'taxi' then if xPlayer.job.name == 'taxi' then
TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory) TriggerEvent('esx_addoninventory:getSharedInventory', 'society_taxi', function(inventory)
local item = inventory.getItem(itemName) local item = inventory.getItem(itemName)
if item.count > 0 then if sourceItem.count >= count and count > 0 then
xPlayer.removeInventoryItem(itemName, count) xPlayer.removeInventoryItem(itemName, count)
inventory.addItem(itemName, count) inventory.addItem(itemName, count)
xPlayer.showNotification(TranslateCap('have_deposited', count, item.label)) xPlayer.showNotification(TranslateCap('have_deposited', count, item.label))