Advertisement
Trsak

Untitled

Mar 25th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. Citizen.CreateThread(function()
  2. while true do
  3. Citizen.Wait(0)
  4.  
  5. for k in pairs(arms) do
  6.  
  7. local plyCoords = GetEntityCoords(GetPlayerPed(-1), false)
  8. local dist = Vdist(plyCoords.x, plyCoords.y, plyCoords.z, arms[k].x, arms[k].y, arms[k].z)
  9.  
  10. if dist <= 0.5 then
  11. hintToDisplay('Press ~INPUT_CONTEXT~ to exercise your ~g~arms')
  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~exersice~w~...")
  18. Citizen.Wait(1000)
  19.  
  20. if membership == true then
  21. local playerPed = GetPlayerPed(-1)
  22. TaskStartScenarioInPlace(playerPed, "world_human_muscle_free_weights", 0, true)
  23. Citizen.Wait(30000)
  24. ClearPedTasksImmediately(playerPed)
  25. ESX.ShowNotification("You need to rest ~r~60 seconds ~w~before doing another exercise.")
  26.  
  27. --TriggerServerEvent('esx_gym:trainArms') ## COMING SOON...
  28.  
  29. training = true
  30. elseif membership == false then
  31. ESX.ShowNotification("You need a membership in order to do a ~r~exercise")
  32. end
  33. elseif training == true then
  34. ESX.ShowNotification("You need to rest...")
  35.  
  36. resting = true
  37.  
  38. CheckTraining()
  39. end
  40. end
  41. end
  42. end
  43. end
  44. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement