[Release] Hospital Healing And Revive With Injury System || Draco-Customs || Optimized Script ||

Modified New Healing/Revive System

Hello, If You Find Any problem Regarding This Script Feel Free To Contact in Post
This is Optimized Script With Multiple Combinations Of Codes. Best Alternative

Dependencies

Mythic Notify > GitHub - FlawwsX/mythic_notify: This is the most latest version of mythic notifications, before being taken down.

Features

Automaticly Injured When Fell From height Or Have Less Health Then You Must Have To Go To The Hospital For Checkin. With Check-in Health And Injures Can Also Restores. Dead Player Can Also Revives Himself From Here. No Need To Run Extra Scripts. New Check-in System

Config

Easy To Config
You Can Find Many Options in Config.lua

Usage

  1. Download The Script From Below
  2. Place it To Your Resources Folder
  3. Type start esx-Draco-Hospital in You Server.cfg
  4. Run The Server And Enjoy!!

Video Link

ScreenShots

Download Link

Click Here To Download

9 Likes

I have a few problems with me.

  1. The injured info is closed and spam is only processed once

  2. My money is withdrawn but I am not cured

  3. It would be better than the cash to only use the bank, otherwise the player would go into the red

1 Like

Citizen.CreateThread(function()
while true do
Wait(5)
if GetEntityHealth(GetPlayerPed(-1)) <= 160 then
exports[‘mythic_notify’]:DoHudText(‘error’, ‘You Are Injured, Go To The Hospital’)
setHurt()
elseif GetEntityHealth(GetPlayerPed(-1)) > 161 then
setNotHurt()
end
end
end)

function setHurt()
RequestAnimSet(“move_m@injured”)
SetPedMovementClipset(GetPlayerPed(-1), “move_m@injured”, true)
end

function setNotHurt()
ResetPedMovementClipset(GetPlayerPed(-1))
ResetPedWeaponMovementClipset(GetPlayerPed(-1))
ResetPedStrafeClipset(GetPlayerPed(-1))
end

Replace This Code With Current One in Cleint.lua at line 171

if you want the money go to ems society every time a player uses npc to be revive or heal add this

server.lua add this

if Config.GiveSocietyMoney then
TriggerEvent(‘esx_addonaccount:getSharedAccount’, Config.Society, function(account)
account.addMoney(Config.doctorPrice)
end)
end
end)

config.lua add this

Config.GiveSocietyMoney = true
Config.Society = ‘society_ambulance’

2 Likes

nice bro

1 Like

I did this without testing anything, if it works you can push it to the release if you want to

server.lua

RegisterServerEvent('draco-custom:money')
AddEventHandler('draco-custom:money', function()
    local _source = source
    local xPlayer = ESX.GetPlayerFromId(_source)
    local price = Config.doctorPrice
    local cash = xPlayer.getMoney() -- Get player money in cash
    local bank = xPlayer.getAccount('bank').money -- Get player bank balance

    if cash < price then
        xPlayer.removeAccountMoney('bank', Config.doctorPrice) -- Remove money from bank
        TriggerEvent('esx_addonaccount:getSharedAccount', 'society_'..Config.Society, function(account) -- If you don't want to give society money just delete lines 34 and 35
        account.addMoney(Config.doctorPrice / math.random(5))
        TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'success', text = '$'.. Config.doctorPrice ..' Money Detucted from your bank account'}) -- Alert
    end)
        elseif cash > price then
        xPlayer.removeMoney(Config.doctorPrice) -- Remove money from cash account
        TriggerEvent('esx_addonaccount:getSharedAccount', 'society_'..Config.Society, function(account) -- If you don't want to give society money just delete lines 40 and 41
        account.addMoney(Config.doctorPrice / math.random(5))
        TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'success', text = '$'.. Config.doctorPrice ..' Money Detucted from your cash account'}) -- Alert
        end)
        if cash and bank < price then
            TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'success', text = 'You don\' have enough money for this!'}) -- You don't have enough money for this alert
        end
    end
end)

config.lua

Config = {}

Config.Society = 'ambulance' -- JOB NAME

Config.EnableBlips = false
Config.EnablePeds = true

Config.DoctorLimit = false
Config.maxDoctor = 0
Config.doctorPrice = 5000
Config.Doctor = {
    {x = 328.74, y = -577.41, z = 43.32, heading = 168.56, type = 'legal'}
}
1 Like

ok :slight_smile:

how can i get NPC to revive dead users?

There is another script for this, you can implement those script together

What Are U talking About?

The animation will stop after using this script like dpemote

download the latest version now…
i Fixed The Issue

esx-Draco-Hospital.rar (3.6 KB)
I added 4 different places instead of one

So I put this into my server. The doctor appears and I am able interact but the problem I am having is that I get charged but I am not Healed or Revived. Any help would be much appreciated


Anyone know how to fix this??

It´s great thanks. But where can i get that hospital MLO/YMAP?