- 22 Ocak 2020
- 422
- 38
- 28
Bu linki görmek için izniniz yok
Giriş yap veya üye ol.
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.
Bu linki görmek için izniniz yok
Giriş yap veya üye ol.
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)
end
end, shoptype)
Citizen.Wait(500)
TriggerEvent("esx_inventoryhud
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.x, FastFood.y, FastFood.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
AddEventHandler('esx
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.name then
table.insert(itemShopList, {
type = "item_standard",
name = itemInformation[itemResult.name].name,
label = itemInformation[itemResult.name].label,
limit = itemInformation[itemResult.name].limit,
rare = itemInformation[itemResult.name].rare,
can_remove = itemInformation[itemResult.name].can_remove,
price = itemInformation[itemResult.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
Bu linki görmek için izniniz yok
Giriş yap veya üye ol.