Advertisement
Guest User

Untitled

a guest
Feb 11th, 2018
399
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. -- this module define the emotes menu
  2.  
  3. local cfg = module("cfg/emotes")
  4. local lang = vRP.lang
  5.  
  6. local emotes = cfg.emotes
  7.  
  8. local function ch_emote(player,choice)
  9. local emote = emotes[choice]
  10. if emote then
  11. vRPclient.playAnim(player,{emote[1],emote[2],emote[3]})
  12. end
  13. end
  14.  
  15. -- add emotes menu to main menu
  16.  
  17. vRP.registerMenuBuilder("main", function(add, data)
  18. local choices = {}
  19. choices[lang.emotes.title()] = {function(player, choice)
  20. -- build emotes menu
  21. local menu = {name=lang.emotes.title(),css={top="75px",header_color="rgba(0,125,255,0.75)"}}
  22. local user_id = vRP.getUserId(player)
  23.  
  24. if user_id ~= nil then
  25. -- add emotes to the emote menu
  26. for k,v in pairs(emotes) do
  27. if vRP.hasPermissions(user_id, v.permissions or {}) then
  28. menu[k] = {ch_emote}
  29. end
  30. end
  31. end
  32.  
  33. -- clear current emotes
  34. menu[lang.emotes.clear.title()] = {function(player,choice)
  35. vRPclient.stopAnim(player,{true}) -- upper
  36. vRPclient.stopAnim(player,{false}) -- full
  37. end, lang.emotes.clear.description()}
  38.  
  39. vRP.openMenu(player,menu)
  40. end}
  41. add(choices)
  42. end)
  43.  
  44. --stop emote med Z
  45.  
  46. Citizen.CreateThread(function()
  47. while true do
  48. Citizen.Wait(0)
  49. if (IsControlPressed(1, 90)) then
  50. ClearPedTasksImmediately(GetPlayerPed(-1))
  51. end
  52. end
  53. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement