Skip to content

Commit

Permalink
Update v1.5.2
Browse files Browse the repository at this point in the history
* Fixed a Bug where you can't press the hotkey with visn_are
* Fixed a Bug where the 3dText is still on the screen
  • Loading branch information
Musiker15 committed May 27, 2024
1 parent 8779559 commit 9f14f45
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 18 deletions.
20 changes: 4 additions & 16 deletions client.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
local isDead, OnlineMedics, medicCalled, medicOnRoad, triedToRevive, wasRevived = false, 5, false, false, false, false
local taskVehicle, taskNPC, taskBlip = nil, nil, nil
local isControlPressed = (Config.VisnAre or Config.OSPAmbulance) and IsDisabledControlPressed or IsControlJustPressed

AddEventHandler('esx:onPlayerDeath', function(data)
isDead = true
triedToRevive = false
end)

--[[ AddEventHandler('esx:onPlayerSpawn', function()
playerRevived = function()
isDead = false
medicCalled = false
medicOnRoad = false
Expand All @@ -17,20 +18,7 @@ end)
end

leaveTarget()
end) ]]

AddEventHandler('playerSpawned', function()
isDead = false
medicCalled = false
medicOnRoad = false

if wasRevived then
wasRevived = false
TriggerServerEvent('msk_aimedic:removeMoney')
end

leaveTarget()
end)
end

RegisterNetEvent('msk_aimedic:refreshMedics')
AddEventHandler('msk_aimedic:refreshMedics', function(medics)
Expand All @@ -47,7 +35,7 @@ CreateThread(function()
if not medicCalled and not triedToRevive then
drawGenericText(Translation[Config.Locale]['input']:format(Config.Hotkey.label, comma(Config.RevivePrice)))

if IsControlJustPressed(0, Config.Hotkey.key) then
if isControlPressed(0, Config.Hotkey.key) then
medicCalled = true
advancedNotification(Translation[Config.Locale]['medic_send']:format(Config.Medic.npcName), 'Los Santos', 'Medical Department', 'CHAR_CALL911')
startAIMedic()
Expand Down
4 changes: 3 additions & 1 deletion config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Config.botColor = "6205745" -- https://www.mathsisfun.com/hexadecimal-decimal-co
Config.botName = "MSK Scripts"
Config.botAvatar = "https://i.imgur.com/PizJGsh.png"
----------------------------------------------------------------
Config.Hotkey = {key = 38, label = 'E'}
Config.Hotkey = {key = 38, label = 'E'} -- G = 47
Config.SpawnRadius = 150 -- default: 150 meters
Config.DrivingStyle = 786475 -- default: 786475 // https://vespura.com/fivem/drivingstyle/
----------------------------------------------------------------
Expand Down Expand Up @@ -59,4 +59,6 @@ Config.ReviveTrigger = function()
else
TriggerEvent('esx_ambulancejob:revive')
end

playerRevived() -- Do NOT delete this!
end
2 changes: 1 addition & 1 deletion fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ games { 'gta5' }
author 'Musiker15 - MSK Scripts'
name 'msk_aimedic'
description 'AI Medic NPC'
version '1.5.1'
version '1.5.2'

lua54 'yes'

Expand Down

0 comments on commit 9f14f45

Please sign in to comment.