[Release] Hunger/Thirst HUD V0.3.3 (Added inventory and food shops)

Hello I have a worry I managed to put the food script its works but on the other hand once put no more trade what to do?

I have the same problem :confused:

Any error message on the server side?

Working perfectly fine ! Great job and share !
Initialize at player creation the inventory (for exemple add 1botle and 1sandwich) prevent to gets some errors. (Just sayinā€™)

Yeeeey, thankā€™s for this script man.

I have just one problem, i canā€™t drink water, and i canā€™t eat. (Iā€™m french, sry for my English)

I know I need to add a line of code, but I donā€™t know where. Iā€™m not very good at it. Anyone can help me ?

Thankā€™s

Hi I have a problem with blips stores for food: http://prntscr.com/fapxkx | http://prntscr.com/fapxr3 and what is strange is that I replace the coordinates with better and so now I also have clothes shops that have gone http://prntscr.com/fapxwb while they yet I have not changed.
Sometimes I have practically all my list of right blips that have more name etc

Be sure that you have every } and ,
You have probably deleted one by mistake

I checked, i have no error i think, i pm you my script for the blips, if you can take a look in, if i don"t find the error because i don"t really know why its not working !!

http://prntscr.com/fau1hd iā€™ve this error when I buy a food or drink and i havenā€™t got it and money was not removed

Can you add alcohol and at the same time if itā€™s consumed a drunken effect? :slight_smile:

I got this, but theyā€™re is no drink animation before getting drunk :slight_smile:

function use(item)
    if (ITEMS[item].quantity - 1 >= 0) then
        -- Nice var swap for nothing
        TriggerEvent("player:looseItem", item, 1)
        -- Calling the Hunger/Thirst
        if ITEMS[item].type == 2 then
            TriggerEvent("food:eat", ITEMS[item])
        elseif ITEMS[item].type == 1 then
            TriggerEvent("food:drink", ITEMS[item])
        elseif ITEMS[item].type == 3 then
            Drunked()
            Citizen.Wait(2000)
            ClearPedTasks(GetPlayerPed(-1))
            Reality()
        else
            -- Any other type? Drugs??????
            Toxicated()
            Citizen.Wait(3000)
            ClearPedTasks(GetPlayerPed(-1))
            Reality()
        end
    end
end


--------------------------------------------------------
function Toxicated()
	  Citizen.Wait(5000)
	  DoScreenFadeOut(1000)
	  Citizen.Wait(1000)
	  ClearPedTasksImmediately(GetPlayerPed(-1))
	  SetTimecycleModifier("spectator5")
	  SetPedMotionBlur(GetPlayerPed(-1), true)
	  SetPedMovementClipset(GetPlayerPed(-1), "MOVE_M@DRUNK@SLIGHTLYDRUNK", true)
	  SetPedIsDrunk(GetPlayerPed(-1), true)
	  DoScreenFadeIn(1000)
end

function Reality()
  Citizen.Wait(50000)
  DoScreenFadeOut(1000)
  Citizen.Wait(1000)
  DoScreenFadeIn(1000)
  ClearTimecycleModifier()
  ResetScenarioTypesEnabled()
  ResetPedMovementClipset(GetPlayerPed(-1), 0)
  SetPedIsDrunk(GetPlayerPed(-1), false)
  SetPedMotionBlur(GetPlayerPed(-1), false)
end

--------------------------------------------------------------
function Drunked()
  RequestAnimSet("move_m@drunk@verydrunk")
  while not HasAnimSetLoaded("move_m@drunk@verydrunk") do
    Citizen.Wait(0)
  end

  TaskStartScenarioInPlace(GetPlayerPed(-1), "WORLD_HUMAN_DRUG_DEALER", 0, 1)
  DoScreenFadeOut(1000)
  Citizen.Wait(1000)
  ClearPedTasksImmediately(GetPlayerPed(-1))
  SetTimecycleModifier("spectator5")
  SetPedMotionBlur(GetPlayerPed(-1), true)
  SetPedMovementClipset(GetPlayerPed(-1), "move_m@drunk@verydrunk", true)
  SetPedIsDrunk(GetPlayerPed(-1), true)
  DoScreenFadeIn(1000)
  end

  function reality()
    DoScreenFadeOut(1000)
    Citizen.Wait(1000)
    DoScreenFadeIn(1000)
    ClearTimecycleModifier()
    ResetScenarioTypesEnabled()
    ResetPedMovementClipset(GetPlayerPed(-1), 0)
    SetPedIsDrunk(GetPlayerPed(-1), false)
    SetPedMotionBlur(GetPlayerPed(-1), false)
    -- Stop the toxication
    Citizen.Trace("Retour Ơ la rƩalitƩ.\n")
    end

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

Donā€™t forget to put type 3 in your database for the alcohols items.

Maybe have to change this for the drink animation :

"WORLD_HUMAN_DRUG_DEALER"
3 Likes

Perfect thank you bro, I try it tonight I will tell you the result :slight_smile:

1 Like

u add all this code on client right?

Change function use(item) on vdkinv.lua

1 Like

good to inventory but impossible to use item no error . possible to help plz

But frfuel script is not working anymore
Why ?

Same here help us :smiley:

For now, the only way to make both work at the same time is :

  • Connect
  • Disconnect
  • Reconnect.
1 Like

I do not understand :confused:

Thanks for the script.
Everything works but there is a conflict with the fr-fuel script.

  1. Do you know how to resolve this conflict between these two scripts?
  2. How to move the Food HUD (a few milimeters up)?