This commit is contained in:
Nordi98 2025-06-15 02:07:50 +02:00
parent 65fb8a9793
commit beb46174cd
225 changed files with 1525 additions and 14 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View file

@ -0,0 +1,14 @@
INSERT INTO `items` (`name`, `label`, `weight`) VALUES
('res_food_a', 'Schnitzel with fries', 1),
('res_food_b', 'Schnitzel with croquettes', 1),
('res_food_c', 'Spaghetti', 1),
('res_food_d', 'Grilled fish', 1),
('res_food_e', 'Steak with potatoes', 1),
('res_food_f', 'Steak with fries', 1),
('res_food_g', 'Lobster', 1),
('res_food_h', 'Eggs with toast', 1),
('res_food_i', 'Sushi', 1),
('res_food_j', 'Shrimps with sauce', 1),
('res_food_k', 'Chicken with potatoes', 1),
('res_food_l', 'Vegetarian salad', 1)
;

View file

@ -0,0 +1,71 @@
1) If you're using version '2.0.0', it's necessary to add an additional section to the client.lua file.
This is so that the mouth moves while eating. Of course, you can use the old config, but your mouth won't move.

-------- ADD CLIENT.LUA - BZZZ_USABLEITEMS verison 2.0.0. ----------------------

RegisterNetEvent('bzzz_usableitems:onEatPlates')
AddEventHandler('bzzz_usableitems:onEatPlates', function(basicInfo, firstProp, secondProp)
if not IsAnimated then
IsAnimated = true

CreateThread(function()
local playerPed = PlayerPedId()
local x, y, z = table.unpack(GetEntityCoords(playerPed))

if secondProp and secondProp.propName then
local boneIndex2 = GetPedBoneIndex(playerPed, secondProp.boneIndex)
prop2 = CreateObject(secondProp.propName, x, y, z + 0.2, true, true, true)
AttachEntityToEntity(prop2, playerPed, boneIndex2, secondProp.xPos, secondProp.yPos, secondProp.zPos, secondProp.xRot, secondProp.yRot, secondProp.zRot, true, true, false, true, 1, true)
end

local boneIndex = GetPedBoneIndex(playerPed, firstProp.boneIndex)
local prop = CreateObject(firstProp.propName, x, y, z + 0.2, true, true, true)
AttachEntityToEntity(prop, playerPed, boneIndex, firstProp.xPos, firstProp.yPos, firstProp.zPos, firstProp.xRot, firstProp.yRot, firstProp.zRot, true, true, false, true, 1, true)

ESX.Streaming.RequestAnimDict(basicInfo.animationDictEat, function()
TaskPlayAnim(playerPed, basicInfo.animationDictEat, basicInfo.animationNameEat, 8.0, -8, -1, 49, 0, 0, 0, 0)
PlayFacialAnim(playerPed, basicInfo.animationNameChewing, basicInfo.animationDictChewing)

Wait(6000)
IsAnimated = false
ClearPedSecondaryTask(playerPed)
DeleteObject(prop)
DeleteObject(prop2)
end)
end)
end
end)

--------------------------------------------------------------------------------------



2) Also, edit the server.lua file.
Insert the code into the function!


-------- ADD SERVER.LUA - BZZZ_USABLEITEMS verison 2.0.0. ----------------------

for k, v in pairs(Config.Items['FoodPlates']) do

ESX.RegisterUsableItem(k, function(source)
local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
xPlayer.removeInventoryItem(k, 1)

TriggerClientEvent('esx_status:add', _source, 'hunger', v.basicInfo.amountToAdd)
TriggerClientEvent('bzzz_usableitems:onEatPlates', _source, v.basicInfo, v.firstProp, v.secondProp or nil)
xPlayer.showNotification('~q~Bon appetit!')
end)
end
--------------------------------------------------------------------------------------



3) Paste the entire code from the file 'restaurant_code_for_usableitems.lua' into the configuration file in 'bzzz_usableitems'.

After all changes, you must restart the server. It is never enough to restart the script only in txadmin.



View file

@ -0,0 +1,236 @@
-- insert bzzz_usableitems into Config.Items
FoodPlates = { -- Food which uses special animation for eating, like when you eating from plate or box :D chewing is included too
['res_food_a'] = {
basicInfo = {
amountToAdd = 200000, -- Adds food to your status bar (require esx_status)
animationDictEat = "bzzz@restaurant@eat",
animationNameEat = "bzzz_restaurant_eat",
animationDictChewing = "facials@gen_male@base",
animationNameChewing = "eating_1"
},
firstProp = {
boneIndex = 18905,
propName = "bzzz_restaurant_food_a",
xPos = 0.08, yPos = -0.04, zPos = 0.07, xRot = -30.0, yRot = 10.0, zRot = 0.0
},
secondProp = {
boneIndex = 57005,
propName = "bzzz_restaurant_fork_a",
xPos = 0.1, yPos = 0.05, zPos = 0.0, xRot = -117.0, yRot = -68.0, zRot = -43.0
}
},
['res_food_b'] = {
basicInfo = {
amountToAdd = 200000, -- Adds food to your status bar (require esx_status)
animationDictEat = "bzzz@restaurant@eat",
animationNameEat = "bzzz_restaurant_eat",
animationDictChewing = "facials@gen_male@base",
animationNameChewing = "eating_1"
},
firstProp = {
boneIndex = 18905,
propName = "bzzz_restaurant_food_b",
xPos = 0.08, yPos = -0.04, zPos = 0.07, xRot = -30.0, yRot = 10.0, zRot = 0.0
},
secondProp = {
boneIndex = 57005,
propName = "bzzz_restaurant_fork_b",
xPos = 0.1, yPos = 0.05, zPos = 0.0, xRot = -117.0, yRot = -68.0, zRot = -43.0
}
},
['res_food_c'] = {
basicInfo = {
amountToAdd = 200000, -- Adds food to your status bar (require esx_status)
animationDictEat = "bzzz@restaurant@eat",
animationNameEat = "bzzz_restaurant_eat",
animationDictChewing = "facials@gen_male@base",
animationNameChewing = "eating_1"
},
firstProp = {
boneIndex = 18905,
propName = "bzzz_restaurant_food_c",
xPos = 0.08, yPos = -0.04, zPos = 0.07, xRot = -30.0, yRot = 10.0, zRot = 0.0
},
secondProp = {
boneIndex = 57005,
propName = "bzzz_restaurant_fork_c",
xPos = 0.1, yPos = 0.05, zPos = 0.0, xRot = -117.0, yRot = -68.0, zRot = -43.0
}
},
['res_food_d'] = {
basicInfo = {
amountToAdd = 200000, -- Adds food to your status bar (require esx_status)
animationDictEat = "bzzz@restaurant@eat",
animationNameEat = "bzzz_restaurant_eat",
animationDictChewing = "facials@gen_male@base",
animationNameChewing = "eating_1"
},
firstProp = {
boneIndex = 18905,
propName = "bzzz_restaurant_food_d",
xPos = 0.08, yPos = -0.04, zPos = 0.07, xRot = -30.0, yRot = 10.0, zRot = 0.0
},
secondProp = {
boneIndex = 57005,
propName = "bzzz_restaurant_fork_d",
xPos = 0.1, yPos = 0.05, zPos = 0.0, xRot = -117.0, yRot = -68.0, zRot = -43.0
}
},
['res_food_e'] = {
basicInfo = {
amountToAdd = 200000, -- Adds food to your status bar (require esx_status)
animationDictEat = "bzzz@restaurant@eat",
animationNameEat = "bzzz_restaurant_eat",
animationDictChewing = "facials@gen_male@base",
animationNameChewing = "eating_1"
},
firstProp = {
boneIndex = 18905,
propName = "bzzz_restaurant_food_e",
xPos = 0.08, yPos = -0.04, zPos = 0.07, xRot = -30.0, yRot = 10.0, zRot = 0.0
},
secondProp = {
boneIndex = 57005,
propName = "bzzz_restaurant_fork_e",
xPos = 0.1, yPos = 0.05, zPos = 0.0, xRot = -117.0, yRot = -68.0, zRot = -43.0
}
},
['res_food_f'] = {
basicInfo = {
amountToAdd = 200000, -- Adds food to your status bar (require esx_status)
animationDictEat = "bzzz@restaurant@eat",
animationNameEat = "bzzz_restaurant_eat",
animationDictChewing = "facials@gen_male@base",
animationNameChewing = "eating_1"
},
firstProp = {
boneIndex = 18905,
propName = "bzzz_restaurant_food_f",
xPos = 0.08, yPos = -0.04, zPos = 0.07, xRot = -30.0, yRot = 10.0, zRot = 0.0
},
secondProp = {
boneIndex = 57005,
propName = "bzzz_restaurant_fork_a",
xPos = 0.1, yPos = 0.05, zPos = 0.0, xRot = -117.0, yRot = -68.0, zRot = -43.0
}
},
['res_food_g'] = {
basicInfo = {
amountToAdd = 200000, -- Adds food to your status bar (require esx_status)
animationDictEat = "bzzz@restaurant@eat",
animationNameEat = "bzzz_restaurant_eat",
animationDictChewing = "facials@gen_male@base",
animationNameChewing = "eating_1"
},
firstProp = {
boneIndex = 18905,
propName = "bzzz_restaurant_food_g",
xPos = 0.08, yPos = -0.04, zPos = 0.07, xRot = -30.0, yRot = 10.0, zRot = 0.0
},
secondProp = {
boneIndex = 57005,
propName = "bzzz_restaurant_fork_d",
xPos = 0.1, yPos = 0.05, zPos = 0.0, xRot = -117.0, yRot = -68.0, zRot = -43.0
}
},
['res_food_h'] = {
basicInfo = {
amountToAdd = 200000, -- Adds food to your status bar (require esx_status)
animationDictEat = "bzzz@restaurant@eat",
animationNameEat = "bzzz_restaurant_eat",
animationDictChewing = "facials@gen_male@base",
animationNameChewing = "eating_1"
},
firstProp = {
boneIndex = 18905,
propName = "bzzz_restaurant_food_h",
xPos = 0.08, yPos = -0.04, zPos = 0.07, xRot = -30.0, yRot = 10.0, zRot = 0.0
},
secondProp = {
boneIndex = 57005,
propName = "bzzz_restaurant_fork_f",
xPos = 0.1, yPos = 0.05, zPos = 0.0, xRot = -117.0, yRot = -68.0, zRot = -43.0
}
},
['res_food_i'] = {
basicInfo = {
amountToAdd = 200000, -- Adds food to your status bar (require esx_status)
animationDictEat = "bzzz@restaurant@eat",
animationNameEat = "bzzz_restaurant_eat",
animationDictChewing = "facials@gen_male@base",
animationNameChewing = "eating_1"
},
firstProp = {
boneIndex = 18905,
propName = "bzzz_restaurant_food_i",
xPos = 0.08, yPos = -0.04, zPos = 0.07, xRot = -30.0, yRot = 10.0, zRot = 0.0
},
secondProp = {
boneIndex = 57005,
propName = "bzzz_restaurant_fork_h",
xPos = 0.11, yPos = 0.05, zPos = -0.02, xRot = 78.0, yRot = 150.0, zRot = 188.0
}
},
['res_food_j'] = {
basicInfo = {
amountToAdd = 200000, -- Adds food to your status bar (require esx_status)
animationDictEat = "bzzz@restaurant@eat",
animationNameEat = "bzzz_restaurant_eat",
animationDictChewing = "facials@gen_male@base",
animationNameChewing = "eating_1"
},
firstProp = {
boneIndex = 18905,
propName = "bzzz_restaurant_food_j",
xPos = 0.08, yPos = -0.04, zPos = 0.07, xRot = -30.0, yRot = 10.0, zRot = 0.0
},
secondProp = {
boneIndex = 57005,
propName = "bzzz_restaurant_material_shrimp_a",
xPos = 0.14, yPos = 0.06, zPos = -0.05, xRot = 24.0, yRot = 282.0, zRot = 176.0
}
},
['res_food_k'] = {
basicInfo = {
amountToAdd = 200000, -- Adds food to your status bar (require esx_status)
animationDictEat = "bzzz@restaurant@eat",
animationNameEat = "bzzz_restaurant_eat",
animationDictChewing = "facials@gen_male@base",
animationNameChewing = "eating_1"
},
firstProp = {
boneIndex = 18905,
propName = "bzzz_restaurant_food_k",
xPos = 0.08, yPos = -0.04, zPos = 0.07, xRot = -30.0, yRot = 10.0, zRot = 0.0
},
secondProp = {
boneIndex = 57005,
propName = "bzzz_restaurant_fork_e",
xPos = 0.1, yPos = 0.05, zPos = 0.0, xRot = -117.0, yRot = -68.0, zRot = -43.0
}
},
['res_food_l'] = {
basicInfo = {
amountToAdd = 200000, -- Adds food to your status bar (require esx_status)
animationDictEat = "bzzz@restaurant@eat",
animationNameEat = "bzzz_restaurant_eat",
animationDictChewing = "facials@gen_male@base",
animationNameChewing = "eating_1"
},
firstProp = {
boneIndex = 18905,
propName = "bzzz_restaurant_food_l",
xPos = 0.08, yPos = -0.04, zPos = 0.07, xRot = -30.0, yRot = 10.0, zRot = 0.0
},
secondProp = {
boneIndex = 57005,
propName = "bzzz_restaurant_fork_g",
xPos = 0.1, yPos = 0.05, zPos = 0.0, xRot = -117.0, yRot = -68.0, zRot = -43.0
}
},

},

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View file

@ -0,0 +1,14 @@
INSERT INTO `items` (`name`, `label`, `weight`) VALUES
('res_food_a', 'Schnitzel with fries', 1),
('res_food_b', 'Schnitzel with croquettes', 1),
('res_food_c', 'Spaghetti', 1),
('res_food_d', 'Grilled fish', 1),
('res_food_e', 'Steak with potatoes', 1),
('res_food_f', 'Steak with fries', 1),
('res_food_g', 'Lobster', 1),
('res_food_h', 'Eggs with toast', 1),
('res_food_i', 'Sushi', 1),
('res_food_j', 'Shrimps with sauce', 1),
('res_food_k', 'Chicken with potatoes', 1),
('res_food_l', 'Vegetarian salad', 1)
;

View file

@ -0,0 +1,237 @@
-- insert bzzz_usableitems into Config.Items
-- "res_food_a" already exists in the config
FoodPlates = { -- Food which uses special animation for eating, like when you eating from plate or box :D chewing is included too
['res_food_a'] = {
basicInfo = {
amountToAdd = 200000, -- Adds food to your status bar (require esx_status)
animationDictEat = "bzzz@restaurant@eat",
animationNameEat = "bzzz_restaurant_eat",
animationDictChewing = "facials@gen_male@base",
animationNameChewing = "eating_1"
},
firstProp = {
boneIndex = 18905,
propName = "bzzz_restaurant_food_a",
xPos = 0.08, yPos = -0.04, zPos = 0.07, xRot = -30.0, yRot = 10.0, zRot = 0.0
},
secondProp = {
boneIndex = 57005,
propName = "bzzz_restaurant_fork_a",
xPos = 0.1, yPos = 0.05, zPos = 0.0, xRot = -117.0, yRot = -68.0, zRot = -43.0
}
},
['res_food_b'] = {
basicInfo = {
amountToAdd = 200000, -- Adds food to your status bar (require esx_status)
animationDictEat = "bzzz@restaurant@eat",
animationNameEat = "bzzz_restaurant_eat",
animationDictChewing = "facials@gen_male@base",
animationNameChewing = "eating_1"
},
firstProp = {
boneIndex = 18905,
propName = "bzzz_restaurant_food_b",
xPos = 0.08, yPos = -0.04, zPos = 0.07, xRot = -30.0, yRot = 10.0, zRot = 0.0
},
secondProp = {
boneIndex = 57005,
propName = "bzzz_restaurant_fork_b",
xPos = 0.1, yPos = 0.05, zPos = 0.0, xRot = -117.0, yRot = -68.0, zRot = -43.0
}
},
['res_food_c'] = {
basicInfo = {
amountToAdd = 200000, -- Adds food to your status bar (require esx_status)
animationDictEat = "bzzz@restaurant@eat",
animationNameEat = "bzzz_restaurant_eat",
animationDictChewing = "facials@gen_male@base",
animationNameChewing = "eating_1"
},
firstProp = {
boneIndex = 18905,
propName = "bzzz_restaurant_food_c",
xPos = 0.08, yPos = -0.04, zPos = 0.07, xRot = -30.0, yRot = 10.0, zRot = 0.0
},
secondProp = {
boneIndex = 57005,
propName = "bzzz_restaurant_fork_c",
xPos = 0.1, yPos = 0.05, zPos = 0.0, xRot = -117.0, yRot = -68.0, zRot = -43.0
}
},
['res_food_d'] = {
basicInfo = {
amountToAdd = 200000, -- Adds food to your status bar (require esx_status)
animationDictEat = "bzzz@restaurant@eat",
animationNameEat = "bzzz_restaurant_eat",
animationDictChewing = "facials@gen_male@base",
animationNameChewing = "eating_1"
},
firstProp = {
boneIndex = 18905,
propName = "bzzz_restaurant_food_d",
xPos = 0.08, yPos = -0.04, zPos = 0.07, xRot = -30.0, yRot = 10.0, zRot = 0.0
},
secondProp = {
boneIndex = 57005,
propName = "bzzz_restaurant_fork_d",
xPos = 0.1, yPos = 0.05, zPos = 0.0, xRot = -117.0, yRot = -68.0, zRot = -43.0
}
},
['res_food_e'] = {
basicInfo = {
amountToAdd = 200000, -- Adds food to your status bar (require esx_status)
animationDictEat = "bzzz@restaurant@eat",
animationNameEat = "bzzz_restaurant_eat",
animationDictChewing = "facials@gen_male@base",
animationNameChewing = "eating_1"
},
firstProp = {
boneIndex = 18905,
propName = "bzzz_restaurant_food_e",
xPos = 0.08, yPos = -0.04, zPos = 0.07, xRot = -30.0, yRot = 10.0, zRot = 0.0
},
secondProp = {
boneIndex = 57005,
propName = "bzzz_restaurant_fork_e",
xPos = 0.1, yPos = 0.05, zPos = 0.0, xRot = -117.0, yRot = -68.0, zRot = -43.0
}
},
['res_food_f'] = {
basicInfo = {
amountToAdd = 200000, -- Adds food to your status bar (require esx_status)
animationDictEat = "bzzz@restaurant@eat",
animationNameEat = "bzzz_restaurant_eat",
animationDictChewing = "facials@gen_male@base",
animationNameChewing = "eating_1"
},
firstProp = {
boneIndex = 18905,
propName = "bzzz_restaurant_food_f",
xPos = 0.08, yPos = -0.04, zPos = 0.07, xRot = -30.0, yRot = 10.0, zRot = 0.0
},
secondProp = {
boneIndex = 57005,
propName = "bzzz_restaurant_fork_a",
xPos = 0.1, yPos = 0.05, zPos = 0.0, xRot = -117.0, yRot = -68.0, zRot = -43.0
}
},
['res_food_g'] = {
basicInfo = {
amountToAdd = 200000, -- Adds food to your status bar (require esx_status)
animationDictEat = "bzzz@restaurant@eat",
animationNameEat = "bzzz_restaurant_eat",
animationDictChewing = "facials@gen_male@base",
animationNameChewing = "eating_1"
},
firstProp = {
boneIndex = 18905,
propName = "bzzz_restaurant_food_g",
xPos = 0.08, yPos = -0.04, zPos = 0.07, xRot = -30.0, yRot = 10.0, zRot = 0.0
},
secondProp = {
boneIndex = 57005,
propName = "bzzz_restaurant_fork_d",
xPos = 0.1, yPos = 0.05, zPos = 0.0, xRot = -117.0, yRot = -68.0, zRot = -43.0
}
},
['res_food_h'] = {
basicInfo = {
amountToAdd = 200000, -- Adds food to your status bar (require esx_status)
animationDictEat = "bzzz@restaurant@eat",
animationNameEat = "bzzz_restaurant_eat",
animationDictChewing = "facials@gen_male@base",
animationNameChewing = "eating_1"
},
firstProp = {
boneIndex = 18905,
propName = "bzzz_restaurant_food_h",
xPos = 0.08, yPos = -0.04, zPos = 0.07, xRot = -30.0, yRot = 10.0, zRot = 0.0
},
secondProp = {
boneIndex = 57005,
propName = "bzzz_restaurant_fork_f",
xPos = 0.1, yPos = 0.05, zPos = 0.0, xRot = -117.0, yRot = -68.0, zRot = -43.0
}
},
['res_food_i'] = {
basicInfo = {
amountToAdd = 200000, -- Adds food to your status bar (require esx_status)
animationDictEat = "bzzz@restaurant@eat",
animationNameEat = "bzzz_restaurant_eat",
animationDictChewing = "facials@gen_male@base",
animationNameChewing = "eating_1"
},
firstProp = {
boneIndex = 18905,
propName = "bzzz_restaurant_food_i",
xPos = 0.08, yPos = -0.04, zPos = 0.07, xRot = -30.0, yRot = 10.0, zRot = 0.0
},
secondProp = {
boneIndex = 57005,
propName = "bzzz_restaurant_fork_h",
xPos = 0.11, yPos = 0.05, zPos = -0.02, xRot = 78.0, yRot = 150.0, zRot = 188.0
}
},
['res_food_j'] = {
basicInfo = {
amountToAdd = 200000, -- Adds food to your status bar (require esx_status)
animationDictEat = "bzzz@restaurant@eat",
animationNameEat = "bzzz_restaurant_eat",
animationDictChewing = "facials@gen_male@base",
animationNameChewing = "eating_1"
},
firstProp = {
boneIndex = 18905,
propName = "bzzz_restaurant_food_j",
xPos = 0.08, yPos = -0.04, zPos = 0.07, xRot = -30.0, yRot = 10.0, zRot = 0.0
},
secondProp = {
boneIndex = 57005,
propName = "bzzz_restaurant_material_shrimp_a",
xPos = 0.14, yPos = 0.06, zPos = -0.05, xRot = 24.0, yRot = 282.0, zRot = 176.0
}
},
['res_food_k'] = {
basicInfo = {
amountToAdd = 200000, -- Adds food to your status bar (require esx_status)
animationDictEat = "bzzz@restaurant@eat",
animationNameEat = "bzzz_restaurant_eat",
animationDictChewing = "facials@gen_male@base",
animationNameChewing = "eating_1"
},
firstProp = {
boneIndex = 18905,
propName = "bzzz_restaurant_food_k",
xPos = 0.08, yPos = -0.04, zPos = 0.07, xRot = -30.0, yRot = 10.0, zRot = 0.0
},
secondProp = {
boneIndex = 57005,
propName = "bzzz_restaurant_fork_e",
xPos = 0.1, yPos = 0.05, zPos = 0.0, xRot = -117.0, yRot = -68.0, zRot = -43.0
}
},
['res_food_l'] = {
basicInfo = {
amountToAdd = 200000, -- Adds food to your status bar (require esx_status)
animationDictEat = "bzzz@restaurant@eat",
animationNameEat = "bzzz_restaurant_eat",
animationDictChewing = "facials@gen_male@base",
animationNameChewing = "eating_1"
},
firstProp = {
boneIndex = 18905,
propName = "bzzz_restaurant_food_l",
xPos = 0.08, yPos = -0.04, zPos = 0.07, xRot = -30.0, yRot = 10.0, zRot = 0.0
},
secondProp = {
boneIndex = 57005,
propName = "bzzz_restaurant_fork_g",
xPos = 0.1, yPos = 0.05, zPos = 0.0, xRot = -117.0, yRot = -68.0, zRot = -43.0
}
},

},

View file

@ -0,0 +1 @@
I'm sorry if it's not clear. If you have a problem, be sure to contact me :)