Fast food work.
This work has been created to serve as a role.
The script depends on several resources, you need to read the guide and install the necessary scripts.
First step:
Place the sound files inside the “sounds” folder of the “interaction sounds” script.
Step two:
Place the images of “items” inside “esx_inventoryhud.html.img.items”.
Step three:
Import the file “fastfood.sql” into your “Database”.
Step four:
Go to “esx_inventoryhud"client” and open “shop.lua”.
We look for this code “if IsInRegularShopZone(coords) or IsInRobsLiquorZone(coords)
”
and add this:
or IsInFastFoodZone(coords)
should look like this:
if IsInRegularShopZone(coords) or IsInRobsLiquorZone(coords) or IsInFastFoodZone(coords)
now below the colo codewe can see this :
if IsInFastFoodZone(coords) then
if IsControlJustReleased(0, Keys["E"]) then
OpenShopInvFastFood("fastfood")
Citizen.Wait(2000)
end
end
Look for this:
“openShopInv(shoptype) function
”
and we put above :
function OpenShopInvFastFood(shoptype)
text = "TIENDA"
data = {text = text}
inventory = {}
if (ESX.PlayerData.job.name == 'fastfood') then
ESX.TriggerServerCallback("suku:getShopItems", function(shopInv)
for i = 1, #shopInv, 1 do
table.insert(inventory, shopInv[i])
end
end, shoptype)
Citizen.Wait(500)
TriggerEvent("esx_inventoryhud:openShopInventory", data, inventory)
else
exports['mythic_notify']:SendAlert('error', ' No Eres Trabajador de FastFood ')
end
end
Now we’re looking for this:
function IsInRegularShopZone(coords)
and above we put this: and above we put
function IsInFastFoodZone(coords)
FastFood = Config.Shops.FastFood.Locations
for i = 1, #FastFood, 1 do
if GetDistanceBetweenCoords(coords, FastFood[i].x, FastFood[i].y, FastFood[i].z, true) < 1.5 then
return true
end
end
return false
end
look for this line of code:
for k, v in pairs(Config.Shops.RegularShop.Locations) do
and above it puts this:
for k, v in pairs(Config.Shops.FastFood.Locations) do
if GetDistanceBetweenCoords(coords, Config.Shops.FastFood.Locations[k].x, Config.Shops.FastFood.Locations[k].y, Config.Shops.FastFood.Locations[k].z, true) < 1.7 then
DrawText3Ds(vector3(Config.Shops.FastFood.Locations[k].x, Config.Shops.FastFood.Locations[k].y, Config.Shops.FastFood.Locations[k].z + 1.0), "Presiona [E] para abrir la tienda", 0.35)
ESX.Game.Utils.DrawText3D(vector3(Config.Shops.YouTool.Locations[k].x, Config.Shops.YouTool.Locations[k].y, Config.Shops.YouTool.Locations[k].z + 1.0), "Presioma [E] para abrir la tienda", 0.4)
end
end
Below all place this code:
DrawText3Ds = function(coords, text, scale)
local x,y,z = coords.x, coords.y, coords.z
local onScreen, _x, _y = World3dToScreen2d(x, y, z)
local pX, pY, pZ = table.unpack(GetGameplayCamCoords())
SetTextScale(scale, scale)
SetTextFont(4)
SetTextProportional(1)
SetTextEntry("STRING")
SetTextCentre(1)
SetTextColour(255, 255, 255, 215)
AddTextComponentString(text)
DrawText(_x, _y)
local factor = (string.len(text)) / 420
DrawRect(_x, _y + 0.0115, 0.032 + factor, 0.033, 41, 11, 41, 100)
end
Go to “shop.lua” and look for this code:
local Licenses = {}
and below place:
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0)
end
while ESX.GetPlayerData().job == nil do
Citizen.Wait(10)
end
PlayerData = ESX.GetPlayerData()
end)
RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(xPlayer)
ESX.PlayerData = xPlayer
end)
RegisterNetEvent('esx:setJob')
AddEventHandler('esx:setJob', function(job)
ESX.PlayerData.job = job
end)
Enter “esx_inventoryhud/server” and open “main.lua” looks for this code:
if shoptype == "regular" then
and above it puts this code:
if shoptype == "fastfood" then
for _, v in pairs(Config.Shops.FastFood.Items) do
if v.name == itemResult[i].name then
table.insert(itemShopList, {
type = "item_standard",
name = itemInformation[itemResult[i].name].name,
label = itemInformation[itemResult[i].name].label,
limit = itemInformation[itemResult[i].name].limit,
rare = itemInformation[itemResult[i].name].rare,
can_remove = itemInformation[itemResult[i].name].can_remove,
price = itemInformation[itemResult[i].name].price,
count = 99999999
})
end
end
end
Now go to the “config.lua” of the “inventoryhud” and look for this code :
RegularShop = {
above puts this:
FastFood = {
Locations = {
{x = -1195.52, y = -901.05, z = 14.0 -0.90}
},
Items = {
{name = 'pancortado'},
{name = 'hcarnecruda'},
{name = 'hpollocrudo'},
{name = 'papascongeladas'},
{name = 'brostercrudo'},
{name = 'nuggetscrudo'}
}
},
Download
https://github.com/karenciita/LRP-fastfood
the script was made with my partner @ShinxD
script’s needed:
1.https://forum.cfx.re/t/inventoryhud-shops/685775
2.https://forum.cfx.re/t/dev-resource-mythic-notifications/587071
3.https://forum.cfx.re/t/release-progress-bars-1-0-standalone/526287
4.https://forum.cfx.re/t/release-play-custom-sounds-for-interactions/8282
MAPEADO
https://es.gta5-mods.com/maps/gtaiv-burgershot-interior-sp-and-fivem
Read the guide to the steps you have to follow, so that the script works correctly, if you have any doubts or problems do not forget to comment on this thread.
psdt: You must have all the necessary scripts installed.
A community stole our work over half a year of programming, the community is called DoblevidaRP, which is why we will be throwing things in the course of days.