Added a animations menu

Thanks renaiku for the help with codding
This commit is contained in:
David Carneiro
2017-09-09 23:16:54 +01:00
committed by GitHub
parent 72b7f5225b
commit 9a87b35334
+233
View File
@@ -472,6 +472,7 @@ function OpenPoliceActionsMenu()
{label = _U('citizen_interaction'), value = 'citizen_interaction'},
{label = _U('vehicle_interaction'), value = 'vehicle_interaction'},
{label = _U('object_spawner'), value = 'object_spawner'},
{label = _U('animations'), value = 'animations'},
},
},
function(data, menu)
@@ -653,6 +654,238 @@ function OpenPoliceActionsMenu()
)
end
if data.current.value == 'animations' then
ESX.UI.Menu.Open(
'default', GetCurrentResourceName(), 'police_animations',
{
title = _U('police_animations'),
align = 'top-left',
elements = {
{label = _U('dotraffic'), value = 'traffic'},
{label = _U('take_note'), value = 'take_notes'},
{label = _U('dobinoculars'), value = 'binoculars'},
{label = _U('stand_by'), value = 'standbycop'},
{label = _U('stand_by_2'), value = 'standbycop2'},
{label = _U('stand_by_3'), value = 'standbycop3'},
{label = _U('crowd_control'), value = 'crowdcontrol'},
{label = _U('doinvestigate'), value = 'investigate'},
{label = _U('docrouch'), value = 'crouch'},
{label = _U('hang_out'), value = 'hangout'},
{label = _U('doleaning'), value = 'leaning'},
{label = _U('dosmoking'), value = 'smoking'},
{label = _U('dodrinking'), value = 'drinking'},
{label = _U('domobile'), value = 'mobile'},
{label = _U('aacoffe'), value = 'coffe'},
{label = _U('push_ups'), value = 'pushups'},
},
},
function(data2, menu2)
local playerPed = GetPlayerPed(-1)
if data2.current.value == 'traffic' then
Citizen.CreateThread(function()
TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_CAR_PARK_ATTENDANT", 0, true)
Wait(20000)
ClearPedTasksImmediately(playerPed)
TriggerEvent('esx:showNotification', _U('dealing_with_traffic'))
end)
end
if data2.current.value == 'take_notes' then
Citizen.CreateThread(function()
TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_CLIPBOARD", 0, true)
Wait(20000)
ClearPedTasksImmediately(playerPed)
TriggerEvent('esx:showNotification', _U('taking_notes'))
end)
end
if data2.current.value == 'binoculars' then
Citizen.CreateThread(function()
TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_BINOCULARS", 0, true)
Wait(20000)
ClearPedTasksImmediately(playerPed)
TriggerEvent('esx:showNotification', _U('use_binoculars'))
end)
end
if data2.current.value == 'standbycop' then
Citizen.CreateThread(function()
TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_COP_IDLES", 0, true)
Wait(20000)
ClearPedTasksImmediately(playerPed)
TriggerEvent('esx:showNotification', _U('standing_cop'))
end)
end
if data2.current.value == 'standbycop2' then
Citizen.CreateThread(function()
TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_GUARD_STAND", 0, true)
Wait(20000)
ClearPedTasksImmediately(playerPed)
TriggerEvent('esx:showNotification', _U('standing_cop_2'))
end)
end
if data2.current.value == 'standbycop3' then
Citizen.CreateThread(function()
TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_GUARD_PATROL", 0, true)
Wait(20000)
ClearPedTasksImmediately(playerPed)
TriggerEvent('esx:showNotification', _U('standing_cop_3'))
end)
end
if data2.current.value == 'crowdcontrol' then
Citizen.CreateThread(function()
TaskStartScenarioInPlace(playerPed, "CODE_HUMAN_POLICE_CROWD_CONTROL", 0, true)
Wait(20000)
ClearPedTasksImmediately(playerPed)
TriggerEvent('esx:showNotification', _U('do_crowd_control'))
end)
end
if data2.current.value == 'investigate' then
Citizen.CreateThread(function()
TaskStartScenarioInPlace(playerPed, "CODE_HUMAN_POLICE_INVESTIGATE", 0, true)
Wait(20000)
ClearPedTasksImmediately(playerPed)
TriggerEvent('esx:showNotification', _U('investigate_done'))
end)
end
if data2.current.value == 'crouch' then
Citizen.CreateThread(function()
TaskStartScenarioInPlace(playerPed, "CODE_HUMAN_MEDIC_KNEEL", 0, true)
Wait(20000)
ClearPedTasksImmediately(playerPed)
TriggerEvent('esx:showNotification', _U('kneel'))
end)
end
if data2.current.value == 'hangout' then
Citizen.CreateThread(function()
TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_HANG_OUT_STREET", 0, true)
Wait(20000)
ClearPedTasksImmediately(playerPed)
TriggerEvent('esx:showNotification', _U('hanging_out'))
end)
end
if data2.current.value == 'leaning' then
Citizen.CreateThread(function()
TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_LEANING", 0, true)
Wait(20000)
ClearPedTasksImmediately(playerPed)
TriggerEvent('esx:showNotification', _U('hanging_out'))
end)
end
if data2.current.value == 'smoking' then
Citizen.CreateThread(function()
TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_SMOKING", 0, true)
Wait(20000)
ClearPedTasksImmediately(playerPed)
TriggerEvent('esx:showNotification', _U('hanging_out'))
end)
end
if data2.current.value == 'drinking' then
Citizen.CreateThread(function()
TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_DRINKING", 0, true)
Wait(20000)
ClearPedTasksImmediately(playerPed)
TriggerEvent('esx:showNotification', _U('hanging_out'))
end)
end
if data2.current.value == 'mobile' then
Citizen.CreateThread(function()
TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_STAND_MOBILE", 0, true)
Wait(20000)
ClearPedTasksImmediately(playerPed)
TriggerEvent('esx:showNotification', _U('hanging_out'))
end)
end
if data2.current.value == 'coffe' then
Citizen.CreateThread(function()
TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_AA_COFFEE", 0, true)
Wait(20000)
ClearPedTasksImmediately(playerPed)
TriggerEvent('esx:showNotification', _U('hanging_out'))
end)
end
if data2.current.value == 'pushups' then
Citizen.CreateThread(function()
TaskStartScenarioInPlace(playerPed, "WORLD_HUMAN_PUSH_UPS", 0, true)
Wait(20000)
ClearPedTasksImmediately(playerPed)
TriggerEvent('esx:showNotification', _U('exercise'))
end)
end
end,
function(data2, menu2)
menu2.close()
end
)
end
end,
function(data, menu)