[Dev-Resource] Mythic Hospital (Body Part Damage & Healing)

Is the event and everything firing off when they check in?

If props aren’t despawned during an action using my progress bar, it means the callback isn’t working correctly so the cleanup function to delete props isn’t called. Usually caused by improperly name resource for mythic_progbar (If you want to rename it, you have to change the NUI callback addresses in the JavaScript)

I have some problems with this script…

Of 70 players, sometimes there are people who never got injuried.

Anothers injuried only with 1 jump without hitting.

They also enter in checkin, go to the bed, finish service and again injuried before get out of hospital.

Adding damage modifier like this

Citizen.CreateThread(function()
    while true do
	N_0x4757f00bc6323cfe(GetHashKey("WEAPON_UNARMED"), 0.1)
	SetPlayerHealthRechargeMultiplier(PlayerId(), 0.0)
	Wait(0)
    end
end)

breaks sprinting after healing in bed. Any ideas what is going on??

What should i edit so people can only get injured if they get shot with a gun. I just don`t want the possibility of getting injured when falling from somewhere or getting hit by a car and etc…

More info as to if there’s errors or not would be great, as at its core it’s all revolving around a native call. I don’t have any access to testing on OneSync servers with people so it’s not been tested to that extent.

No idea tbh, if you remove the sprint modifying stuff does it still break it?

On a side note, why are you calling SetPlayerHealthRechargeMultiplier every frame when it just needs to be called once?

Easiest thing to do is just remove the weapons from the tables at the top of Wound.lua. Additionally can add checks for weapons / weapon classes and skip damaging limbs if the damaging weapon was from those.

I want to leave the weapon damage… I want to remove the damage thats caused by getting hit by a car or falling from a big building.

Mhm, there’s weapons hashes for that which are passed through to the bone damage native which is how you get them. If you don’t want them to inflict damage, remove them from the weapons list and they won’t be checked.

    [`WEAPON_FALL`] = WeaponClasses['OTHER'], -- Fall
    [`WEAPON_HIT_BY_WATER_CANNON`] = WeaponClasses['OTHER'], -- Water Cannon
    [`WEAPON_RAMMED_BY_CAR`] = WeaponClasses['OTHER'], -- Rammed
    [`WEAPON_RUN_OVER_BY_CAR`] = WeaponClasses['OTHER'], -- Ran Over

This is what I done to resolve this issue. I am using the ESX version.
Comment out the exports line in the hospital client/main.lua around line 151
Add the single TriggerEvent line directly below it, see example image

The damage and bleeding seems pretty severe. In testing after getting hit by a car I rag doll after only a few seconds. Is there a way to reduce the effects of bleeding out and blacking out? Even just damage severity in general. What I want is for the bleed to be a very small incremental drain on health that forces players to seek medical attention rather than something that kills them.

It’s meant to be more severe the higher the bleed level is, it’s doing 4 * bleed level (Which can be 1-4).

If you want to nerf that, in wound.lua it’s defined through ;

local bleedDamage = tonumber(isBleeding) * 4

And blacking out happens every 5 minutes that you’re bleeding, can be changed in the same thread that that above definition is.

				if blackoutTimer >= 10 then
					exports['mythic_notify']:DoCustomHudText('inform', 'You Suddenly Black Out', 5000)
					SetFlash(0, 0, 100, 7000, 100)
						
					DoScreenFadeOut(500)
					while not IsScreenFadedOut() do
						Citizen.Wait(0)
					end
			
					if not IsPedRagdoll(player) and IsPedOnFoot(player) and not IsPedSwimming(player) then
						ShakeGameplayCam('SMALL_EXPLOSION_SHAKE', 0.08) -- change this float to increase/decrease camera shake
						SetPedToRagdollWithFall(PlayerPedId(), 10000, 12000, 1, GetEntityForwardVector(player), 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
					end
			
					Citizen.Wait(5000)
					DoScreenFadeIn(500)
					blackoutTimer = 0
				end

I’ll have to look at the black out timer. But I did change the multiplier from 4 to .25 and death seemed almost instant. I even tested it while spectating someone so I could watch their HP numerically. It would drop from 140 to 0 instantly without any incremental decreases. I’m not sure if the person died from bleeding or they blacked out. I tested this before making my original post. But do you think I just didn’t decrease it enough?

For frame of reference I was punching someone. Once seemed to be fine gave some time for bleeding out. But if I punched them twice they would die within minute and 3 times they would be dead within 20 seconds

I hope you can give me some info how to change the rate you get damage. When you get hit once with a fist you wont get any bleeding etc. But when you get hit 2/3 times you get a little bleeding.

Its really annoying that you need to get healing every single time someone hits you.

You cannot press E while dead to check in. Any idea why not?

I have enabled the control while dead in my ambulance job and have enabled to use the progress bar while dead.

useWhileDead = true

So spent some time and made it all nice looking with peds and stuff.

Once you check-in the ER takes over and spawn a doctor for your player to follow into the back room. Your ped will auto follow them in and then you will be on the bed and will walk out to the lobby after you have been treated.

3 Likes

@Alzar

2 things.

You cannot press E while dead to check in. Any idea why not?

I have enabled the control while dead in my ambulance job and have enabled to use the progress bar while dead.

useWhileDead = true

Also if multiple people check in at the same time, or one checks in after the other has checked in, the other person isn’t lying on a bed. Any idea why?

1 Like

Hi, Can anyone help me with syncing injuries into my database to make them persistent. Also the damage of the player to match with there heath bar.

Urr, tbh not sure. Will look into that this weekend.

It doesn’t show them in bed as in they’re not playing an animation? No idea, GTA’s animations have been the bane of my existence. I’ll try to look into it this weekend as well.

I checked in, wait for progbar to finish then nothing. I am just with clipboard and there is no transition to bed, any fix? i checked whole thread I have the ESX version. I am not in birds eye view, and no errors show on server side or client.

Did you install all the req. scripts?

That did not work @Alzar and @RZ_Prodiction_Offici, im sorry.
So what happends is that player need to duck and stand up when healed.
Instead of fixing it by not having to duck and stand up for the anim to work, how about just force the player to a ducking position once healed? Then when standing up, the limp resets. Or will that just create the same problem?

If this works, maybe someone has an idea of how to write it. I tried yesterday but when testing I can’t stand up, after forcing player to duck…