Examples
CreateThread(function()
local text, timeHeld\n
while earlySpawnTimer > 0 and isDead do
Wait(0)
text = _U('respawn_available_in', secondsToClock(earlySpawnTimer))\n
DrawGenericTextThisFrame()
BeginTextCommandDisplayText('STRING')
AddTextComponentSubstringPlayerName(text)
EndTextCommandDisplayText(0.5, 0.8)
end\n
while bleedoutTimer > 0 and isDead do
Wait(0)
text = _U('respawn_bleedout_in', secondsToClock(bleedoutTimer))
if not Config.EarlyRespawnFine then
text = text .. _U('respawn_bleedout_prompt')
if IsControlPressed(0, 38) and timeHeld > 120 then
local inJail = exports['SickJail']:GetJailTime()
if inJail then
exports['SickJail']:DeathJailLogin()
break
else
RemoveItemsAfterRPDeath()
break
end
end
elseif Config.EarlyRespawnFine and canPayFine then
text = text .. _U('respawn_bleedout_fine', ESX.Math.GroupDigits(Config.EarlyRespawnFineAmount))
if IsControlPressed(0, 38) and timeHeld > 120 then
local inJail = exports['SickJail']:GetJailTime()
if inJail then
exports['SickJail']:DeathJailLogin()
break
else
TriggerServerEvent('esx_ambulancejob:payFine')
RemoveItemsAfterRPDeath()
break
end
end
end
if IsControlPressed(0, 38) then
timeHeld += 1
else
timeHeld = 0
end
DrawGenericTextThisFrame()
BeginTextCommandDisplayText('STRING')
AddTextComponentSubstringPlayerName(text)
EndTextCommandDisplayText(0.5, 0.8)
if bleedoutTimer < 1 and isDead then
RemoveItemsAfterRPDeath()
end
end)Built In Medic System:
Send To Jail
Example of sending players to jail and what is needed!
Last updated