LRP-fastfood


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.

10 Likes

Hey, just letting you know. you could have just called the customshop event instead. I ensured that you wouldn’t have to modify any code in inventoryhud that way.

3 Likes

This was done so that it is only the store of that work and does not interfere.

Thank you very much for commenting, but I wanted to do it that way.

1 Like

Alright, well there might be a few that get scared away from having to sit through the instructions. Great work though, keep 'em coming ^^

if it is true they are many, but it was tried to explain well so that they do not have failures
U.u

Looks good. We will try this later this week

1 Like

Mi causa la master cheff :heart_eyes:

1 Like

Causa :heart:
jajajaja

1 Like


hay un error en jobgrades

Inténtalo por “Heidi.sql” :slight_smile:

1 Like

ese no esta! en el comprimido al no ser que el sueño me tenga medio mongolico jajaja

It installs and tries to :slight_smile:

https://www.heidisql.com/

sigo con problemas en la table de jobs grade, al igual aparece error de un sintaxis en la ropa

tu sql esta mal, esta pidiendo id y no pusiste el id en los values

INSERT INTO job_grades (id, job_name
(‘fastfood’, 0, ‘Trabajador’, ‘Trabajador’,

cuando tendria que ser (‘id aqui’, ‘fastfood’, 0, ‘Trabajador’, ‘Trabajador’,

1 Like

me costo hacer la correccion del jobgrade, aparte que en item no tenia price hahaha aqui la dejo por si acaso

INSERT INTO job_grades (id, job_name, grade, name, label, salary, skin_male, skin_female) VALUES
(2, ‘fastfood’,0, ‘Trabajador’,‘trabajador’,50, ‘{\r\n"tshirt_1":15,\r\n"tshirt_2":0,\r\n"torso_1":281,\r\n"torso_2":1,\r\n"pants_1":98,\r\n"pants_2":25,\r\n"decals_2":0,\r\n"decals_1":0,\r\n"chain_1":0,\r\n"glasses":0,\r\n"arms":0\r\n}’, ‘{“tshirt_1”:15,\r\n"tshirt_2":0,\r\n"torso_1":294,\r\n"torso_2":1,\r\n"pants_1":101,\r\n"pants_2":25,\r\n"decals_2":0,\r\n"decals_1":0,\r\n"chain_1":0,\r\n"glasses":0,\r\n"arms":0}’),
;

hola! sera que hay manera de poner a trabajar este inventoryHUD la version limpia

con este skript?

I raised it so that it can adapt in its own way, I put what I use and it needs, but they can do it in the way that seems best to them. :slight_smile:

podrias darme una idea que debo editar? es que las tiendas y el ammunation no me gustan con ese inventoryhud hahaha gracias

hola ando teniendo este problema con la conexion a los item de la base de datos

y cuando abro la nevera para los item me abre el menu pero no sale nada respecto al hambruguezeria

alguna solucion? todo esta hecho al pie de la letra

Hello, first that nothing tries to write also in English so that others who have this problem see what happens to you and know how to find a solution.

Try to see if you have the “price” column in your database in the “items” table

also disable esx_Shop if you have it activated.

the script or modification will only work if you have first installed the “inventoryhud shops”

and then place what was put up.

If you are using another version or do not know which version you have, I recommend you download everything from 0 and try.


hola, ´primero que nada trata de escribir tambien en ingles para que otros que tengan este problema vean lo que te pasa y sepan encontrar alguna solucion.

Trata de ver si tienes la columna “price” en tu base de datos en la table “items”

tambien desactiva el esx_Shop si es que lo tienes activado.

el script o modificacion solo funcionara si tienes primero instalado el "inventoryhud shops "

y ahi colocar lo que se puso arriba.

si estas usando otra version o no sabes que version tienes te recomiendo que bajes todo desde 0 y pruebes.