Update readme.md

This commit is contained in:
Henric Backman
2020-05-12 09:57:59 +02:00
committed by GitHub
parent f2e9c55e8a
commit 11356de23e
+32 -27
View File
@@ -241,24 +241,26 @@ comment or delete
* esx_ambulancejob: (`esx_ambulancejob/client/main.lua`) * esx_ambulancejob: (`esx_ambulancejob/client/main.lua`)
### find: ### find:
```lua ```lua
AddEventHandler('playerSpawned', function() AddEventHandler('esx:onPlayerSpawn', function()
IsDead = false isDead = false
if FirstSpawn then if firstSpawn then
exports.spawnmanager:setAutoSpawn(false) -- disable respawn exports.spawnmanager:setAutoSpawn(false)
FirstSpawn = false firstSpawn = false
ESX.TriggerServerCallback('esx_ambulancejob:getDeathStatus', function(isDead) if Config.AntiCombatLog then
if isDead and Config.AntiCombatLog then while not PlayerLoaded do
while not PlayerLoaded do Citizen.Wait(1000)
Citizen.Wait(1000) end
end
ESX.ShowNotification(_U('combatlog_message')) ESX.TriggerServerCallback('esx_ambulancejob:getDeathStatus', function(shouldDie)
RemoveItemsAfterRPDeath() if shouldDie then
end ESX.ShowNotification(_U('combatlog_message'))
end) RemoveItemsAfterRPDeath()
end end
end)
end
end
end) end)
``` ```
@@ -266,18 +268,21 @@ end)
```lua ```lua
RegisterNetEvent('esx_ambulancejob:multicharacter') RegisterNetEvent('esx_ambulancejob:multicharacter')
AddEventHandler('esx_ambulancejob:multicharacter', function() AddEventHandler('esx_ambulancejob:multicharacter', function()
IsDead = false IsDead = false
if Config.AntiCombatLog then if firstSpawn then
while not PlayerLoaded do firstSpawn = false
Citizen.Wait(1000) if Config.AntiCombatLog then
end while not PlayerLoaded do
ESX.TriggerServerCallback('esx_ambulancejob:getDeathStatus', function(isDead) Citizen.Wait(1000)
if isDead and Config.AntiCombatLog then end
ESX.ShowNotification(_U('combatlog_message')) ESX.TriggerServerCallback('esx_ambulancejob:getDeathStatus', function(isDead)
RemoveItemsAfterRPDeath() if isDead and Config.AntiCombatLog then
end ESX.ShowNotification(_U('combatlog_message'))
end) RemoveItemsAfterRPDeath()
end end
end)
end
end
end) end)
``` ```