Disable most inputs when dead (unconscious can't speak, right?)

This commit is contained in:
ElPumpo
2018-10-30 23:58:00 +01:00
parent c2b1c1de8b
commit fab5f4d167
+16 -13
View File
@@ -48,6 +48,22 @@ AddEventHandler('playerSpawned', function()
end
end)
-- Disable most inputs when dead
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if IsDead then
DisableAllControlActions(0)
EnableControlAction(0, Keys['G'], true)
EnableControlAction(0, Keys['T'], true)
EnableControlAction(0, Keys['E'], true)
else
Citizen.Wait(500)
end
end
end)
function OnPlayerDeath()
IsDead = true
TriggerServerEvent('esx_ambulancejob:setDeathStatus', 1)
@@ -323,16 +339,3 @@ if Config.LoadIpl then
RequestIpl('Coroner_Int_on') -- Morgue
end)
end
-- String string
function stringsplit(inputstr, sep)
if sep == nil then
sep = "%s"
end
local t={} ; i=1
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
t[i] = str
i = i + 1
end
return t
end