Skip to content

Commit 8779559

Browse files
committed
Update v1.5.1
* Some Bugfixes
1 parent 2c24ca9 commit 8779559

File tree

5 files changed

+34
-45
lines changed

5 files changed

+34
-45
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,20 @@
1111
* Fee for reviving
1212
* Discord Logs
1313
* Support for visn_are
14+
* Support for osp_ambulance
15+
16+
## Important
17+
* Please remove the dependencies that you **don't** use in `fxmanifest.lua`!
1418

1519
## Requirements
1620
* [ESX Legacy](https://github.com/esx-framework/esx_core)
1721
* [esx_addonaccount](https://github.com/esx-framework/esx_addonaccount) - *(This is optional)*
18-
* [esx_ambulancejob](https://github.com/esx-framework/esx_ambulancejob) - *(not needed if you use visn_are)*
22+
23+
## Optional Requirements
24+
You'll need one of the Scripts below
25+
* [esx_ambulancejob](https://github.com/esx-framework/esx_ambulancejob) - *(not needed if you use visn_are or osp_ambulance)*
1926
* [visn_are](https://store.veryinsanee.space/package/5215195) - *(This is optional)*
27+
* [osp_ambulance](https://osp-development.tebex.io/package/6010694) - *(This is optional)*
2028

2129
## My other Scripts
2230
### Paid

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.4
1+
1.5.1

client.lua

Lines changed: 18 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,12 @@
11
local isDead, OnlineMedics, medicCalled, medicOnRoad, triedToRevive, wasRevived = false, 5, false, false, false, false
22
local taskVehicle, taskNPC, taskBlip = nil, nil, nil
33

4-
if Config.VisnAre then
5-
local visn_f = exports["visn_are"]:GetSharedFunctions()
6-
7-
visn_f.HookEventHandler('OnUnconsciousStateChanged', function(newState)
8-
if newState then -- Player is Dead
9-
isDead = true
10-
triedToRevive = false
11-
else -- Player was revived
12-
isDead = false
13-
medicCalled = false
14-
medicOnRoad = false
15-
16-
if wasRevived then
17-
wasRevived = false
18-
TriggerServerEvent('msk_aimedic:removeMoney')
19-
end
20-
21-
leaveTarget()
22-
end
23-
end)
24-
else
25-
AddEventHandler('esx:onPlayerDeath', function(data)
26-
isDead = true
27-
triedToRevive = false
28-
end)
29-
30-
AddEventHandler('esx:onPlayerSpawn', function()
31-
isDead = false
32-
medicCalled = false
33-
medicOnRoad = false
34-
35-
if wasRevived then
36-
wasRevived = false
37-
TriggerServerEvent('msk_aimedic:removeMoney')
38-
end
39-
40-
leaveTarget()
41-
end)
42-
end
4+
AddEventHandler('esx:onPlayerDeath', function(data)
5+
isDead = true
6+
triedToRevive = false
7+
end)
438

44-
--[[ AddEventHandler('playerSpawned', function()
9+
--[[ AddEventHandler('esx:onPlayerSpawn', function()
4510
isDead = false
4611
medicCalled = false
4712
medicOnRoad = false
@@ -54,6 +19,19 @@ end
5419
leaveTarget()
5520
end) ]]
5621

22+
AddEventHandler('playerSpawned', function()
23+
isDead = false
24+
medicCalled = false
25+
medicOnRoad = false
26+
27+
if wasRevived then
28+
wasRevived = false
29+
TriggerServerEvent('msk_aimedic:removeMoney')
30+
end
31+
32+
leaveTarget()
33+
end)
34+
5735
RegisterNetEvent('msk_aimedic:refreshMedics')
5836
AddEventHandler('msk_aimedic:refreshMedics', function(medics)
5937
OnlineMedics = medics

config.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Config.Society = {
3131
}
3232
----------------------------------------------------------------
3333
Config.VisnAre = GetResourceState("visn_are") ~= "missing"
34+
Config.OSPAmbulance = GetResourceState("osp_ambulance") ~= "missing"
3435
----------------------------------------------------------------
3536
Config.Jobs = {
3637
amount = 0,
@@ -47,12 +48,14 @@ Config.Medic = {
4748
}
4849
----------------------------------------------------------------
4950
Config.ProgressBar = function()
50-
exports.msk_core:ProgressStart(10000, 'Du wirst nun wiederbelebt...')
51+
exports.msk_core:ProgressStart(Config.ReviveDuration * 1000, 'Du wirst nun wiederbelebt...')
5152
end
5253

5354
Config.ReviveTrigger = function()
5455
if Config.VisnAre then
5556
TriggerEvent('visn_are:resetHealthBuffer')
57+
elseif Config.OSPAmbulance then
58+
TriggerEvent('hospital:client:Revive')
5659
else
5760
TriggerEvent('esx_ambulancejob:revive')
5861
end

fxmanifest.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ games { 'gta5' }
44
author 'Musiker15 - MSK Scripts'
55
name 'msk_aimedic'
66
description 'AI Medic NPC'
7-
version '1.4'
7+
version '1.5.1'
88

99
lua54 'yes'
1010

@@ -23,5 +23,5 @@ server_scripts {
2323
}
2424

2525
dependencies {
26-
'es_extended'
26+
'es_extended',
2727
}

0 commit comments

Comments
 (0)