Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Citizen.CreateThread(function()
- while true do
- Citizen.Wait(0)
- for k in pairs(situps) do
- local plyCoords = GetEntityCoords(GetPlayerPed(-1), false)
- local dist = Vdist(plyCoords.x, plyCoords.y, plyCoords.z, situps[k].x, situps[k].y, situps[k].z)
- if dist <= 1.2 then
- hintToDisplay('Press ~INPUT_CONTEXT~ to do some ~g~situps')
- if IsControlJustPressed(0, Keys['E']) then
- if training == false then
- TriggerServerEvent('esx_gym:checkChip')
- ESX.ShowNotification("Preparing the ~g~exercise~w~...")
- Citizen.Wait(1000)
- if membership == true then
- inGym = true
- isGymming = true
- local playerPed = GetPlayerPed(-1)
- RequestAnimDict("amb@world_human_sit_ups@male@enter")
- RequestAnimDict("amb@world_human_sit_ups@male@base")
- RequestAnimDict("amb@world_human_sit_ups@male@exit")
- RequestAnimDict("amb@world_human_sit_ups@male@idle_a")
- while not HasAnimDictLoaded("amb@world_human_sit_ups@male@enter")do
- Wait(100)
- end
- while not HasAnimDictLoaded("amb@world_human_sit_ups@male@base")do
- Wait(100)
- end
- while not HasAnimDictLoaded("amb@world_human_sit_ups@male@idle_a")do
- Wait(100)
- end
- while not HasAnimDictLoaded("amb@world_human_sit_ups@male@exit")do
- Wait(100)
- end
- if isGymming == true then
- TaskPlayAnim(GetPlayerPed(-1), 'amb@world_human_sit_ups@male@enter' ,'enter' ,8.0, -8.0, -1, 0, 0, false, false, false )
- Wait(4000)
- if isGymming == true then
- TaskPlayAnim(GetPlayerPed(-1), 'amb@world_human_sit_ups@male@base' ,'base' ,8.0, -8.0, -1, 0, 0, false, false, false )
- Wait(15000)
- if isGymming == true then
- TaskPlayAnim(GetPlayerPed(-1), 'amb@world_human_sit_ups@male@idle_a' ,'idle_a' ,8.0, -8.0, -1, 0, 0, false, false, false )
- Wait(15000)
- if isGymming == true then
- TaskPlayAnim(GetPlayerPed(-1), 'amb@world_human_sit_ups@male@idle_a' ,'idle_c' ,8.0, -8.0, -1, 0, 0, false, false, false )
- Wait(15000)
- if isGymming == true then
- TaskPlayAnim(GetPlayerPed(-1), 'amb@world_human_sit_ups@male@exit' ,'exit' ,8.0, -8.0, -1, 0, 0, false, false, false )
- Wait(6000)
- ClearPedTasks(GetPlayerPed(-1))
- inGym = false
- isGymming = false
- end
- end
- end
- end
- end
- --TriggerServerEvent('esx_gym:trainSitups') ## COMING SOON...
- training = true
- resting = true
- CheckTraining()
- elseif membership == false then
- ESX.ShowNotification("You need a membership in order to do a ~r~exercise")
- end
- elseif training == true then
- ESX.ShowNotification("You need to rest...")
- end
- end
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement