Everything else works fine when adding new food, just thinking how to make the props properly on hand?
even the original esx basic needs with esx shops, when you drink water, the bottle is displaced in the hand.
this is how it looks now:
little thing.
RegisterNetEvent('esx_basicneeds:onEDrink')
AddEventHandler('esx_basicneeds:onEDrink', function(prop_name)
if not IsAnimated then
local prop_name = prop_name or 'prop_energy_drink'
IsAnimated = true
local playerPed = GetPlayerPed(-1)
Citizen.CreateThread(function()
local x,y,z = table.unpack(GetEntityCoords(playerPed))
prop = CreateObject(GetHashKey(prop_name), x, y, z+0.1, true, true, true)
AttachEntityToEntity(prop, playerPed, GetPedBoneIndex(playerPed, 18905), 0.12, 0.028, 0.001, 10.0, 175.0, 0.0, true, true, false, true, 1, true)
RequestAnimDict('mp_player_intdrink')
while not HasAnimDictLoaded('mp_player_intdrink') do
Wait(0)
end
TaskPlayAnim(playerPed, 'mp_player_intdrink', 'loop_bottle', 1.0, -1.0, 1000, 0, 1, true, true, true)
Wait(3000)
IsAnimated = false
ClearPedSecondaryTask(playerPed)
DeleteObject(prop)
end)
end
end)
1 Like
How do you add new food, I have added it to basic needs and in the database items and shops tables. But when I go onto vodka in inventory there is no use?
im having basically the same issue but i cant consume like water or eat bread
1 Like
I fixed it
sorry it esx_basicneeds wasn’t started in the resource
1 Like
Rafasta
November 11, 2018, 12:25pm
5
Im trying to fix a bug but the shops dont load
Did you fix it ? I have the same problem!
1 Like
LitkuReiska:
TaskPlayAnim(playerPed, 'mp_player_intdrink', 'loop_bottle', 1.0, -1.0, 1000, 0, 1, true, true, true)
you need to change these angels, like chane 1.0 and see effects,then change -1.0 and see effects and soo on
1 Like
I have adjusted the position. Its almost perfect. Enjoy guys!
RegisterNetEvent('esx_basicneeds:onDrink')
AddEventHandler('esx_basicneeds:onDrink', function(prop_name)
if not IsAnimated then
prop_name = prop_name or 'prop_ld_flow_bottle'
IsAnimated = true
Citizen.CreateThread(function()
local playerPed = PlayerPedId()
local x,y,z = table.unpack(GetEntityCoords(playerPed))
local prop = CreateObject(GetHashKey(prop_name), x, y, z + 0.2, true, true, true)
local boneIndex = GetPedBoneIndex(playerPed, 18905)
AttachEntityToEntity(prop, playerPed, boneIndex, 0.12, 0.005, 0.035, 960.0, 300.0, 0.0, true, true, false, true, 1, true)
ESX.Streaming.RequestAnimDict('mp_player_intdrink', function()
TaskPlayAnim(playerPed, 'mp_player_intdrink', 'loop_bottle', 1.0, -1.0, 2000, 0, 1, true, true, true)
Citizen.Wait(3000)
IsAnimated = false
ClearPedSecondaryTask(playerPed)
DeleteObject(prop)
end)
end)
end
end)
7 Likes