daily pastebin goal
20%
SHARE
TWEET

Untitled

a guest Jan 16th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function vRP.setHunger(user_id,value)
  2.   local data = vRP.getUserDataTable(user_id)
  3.   if data then
  4.     data.hunger = value
  5.     if data.hunger < 0 then data.hunger = 0
  6.     elseif data.hunger > 100 then data.hunger = 100  
  7.       TriggerServerEvent('InteractSound_SV:PlayWithinDistance', 5.0, 'grummeln', 1.0)
  8.       SetTextComponentFormat("STRING")                                                                             -- |
  9.       AddTextComponentString("Ich sollte vielleicht etwas essen")  -- Text als Button oben links                   -- |
  10.       DisplayHelpTextFromStringLabel(0, 0, 1, -1)                                                                 -- |
  11.     end
  12.  
  13.     -- update bar
  14.     local source = vRP.getUserSource(user_id)
  15.     vRPclient.setProgressBarValue(source, {"vRP:hunger",data.hunger})
  16.     if data.hunger >= 100 then
  17.       vRPclient.setProgressBarText(source,{"vRP:hunger",lang.survival.starving()})
  18.     else
  19.       vRPclient.setProgressBarText(source,{"vRP:hunger",""})
  20.     end
  21.   end
  22. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top