Advertisement
Guest User

Untitled

a guest
Sep 25th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.11 KB | None | 0 0
  1. Citizen.CreateThread(function()
  2. while true do
  3. Citizen.Wait(0)
  4.  
  5. for k in pairs(situps) do
  6.  
  7. local plyCoords = GetEntityCoords(GetPlayerPed(-1), false)
  8. local dist = Vdist(plyCoords.x, plyCoords.y, plyCoords.z, situps[k].x, situps[k].y, situps[k].z)
  9.  
  10. if dist <= 1.2 then
  11. hintToDisplay('Press ~INPUT_CONTEXT~ to do some ~g~situps')
  12.  
  13. if IsControlJustPressed(0, Keys['E']) then
  14. if training == false then
  15.  
  16. TriggerServerEvent('esx_gym:checkChip')
  17. ESX.ShowNotification("Preparing the ~g~exercise~w~...")
  18. Citizen.Wait(1000)
  19.  
  20. if membership == true then
  21. inGym = true
  22. isGymming = true
  23. local playerPed = GetPlayerPed(-1)
  24. RequestAnimDict("amb@world_human_sit_ups@male@enter")
  25. RequestAnimDict("amb@world_human_sit_ups@male@base")
  26. RequestAnimDict("amb@world_human_sit_ups@male@exit")
  27. RequestAnimDict("amb@world_human_sit_ups@male@idle_a")
  28. while not HasAnimDictLoaded("amb@world_human_sit_ups@male@enter")do
  29. Wait(100)
  30. end
  31. while not HasAnimDictLoaded("amb@world_human_sit_ups@male@base")do
  32. Wait(100)
  33. end
  34. while not HasAnimDictLoaded("amb@world_human_sit_ups@male@idle_a")do
  35. Wait(100)
  36. end
  37. while not HasAnimDictLoaded("amb@world_human_sit_ups@male@exit")do
  38. Wait(100)
  39. end
  40.  
  41. if isGymming == true then
  42. TaskPlayAnim(GetPlayerPed(-1), 'amb@world_human_sit_ups@male@enter' ,'enter' ,8.0, -8.0, -1, 0, 0, false, false, false )
  43. Wait(4000)
  44. if isGymming == true then
  45. TaskPlayAnim(GetPlayerPed(-1), 'amb@world_human_sit_ups@male@base' ,'base' ,8.0, -8.0, -1, 0, 0, false, false, false )
  46. Wait(15000)
  47. if isGymming == true then
  48. TaskPlayAnim(GetPlayerPed(-1), 'amb@world_human_sit_ups@male@idle_a' ,'idle_a' ,8.0, -8.0, -1, 0, 0, false, false, false )
  49. Wait(15000)
  50. if isGymming == true then
  51. TaskPlayAnim(GetPlayerPed(-1), 'amb@world_human_sit_ups@male@idle_a' ,'idle_c' ,8.0, -8.0, -1, 0, 0, false, false, false )
  52. Wait(15000)
  53. if isGymming == true then
  54. TaskPlayAnim(GetPlayerPed(-1), 'amb@world_human_sit_ups@male@exit' ,'exit' ,8.0, -8.0, -1, 0, 0, false, false, false )
  55. Wait(6000)
  56. ClearPedTasks(GetPlayerPed(-1))
  57. inGym = false
  58. isGymming = false
  59. end
  60. end
  61. end
  62. end
  63. end
  64. --TriggerServerEvent('esx_gym:trainSitups') ## COMING SOON...
  65.  
  66. training = true
  67. resting = true
  68. CheckTraining()
  69. elseif membership == false then
  70. ESX.ShowNotification("You need a membership in order to do a ~r~exercise")
  71. end
  72. elseif training == true then
  73. ESX.ShowNotification("You need to rest...")
  74. end
  75. end
  76. end
  77. end
  78. end
  79. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement