[RELEASE][ESX] Persistent Death

could you explaing how to fix this problem when you get killed it sets to from 0 to 1 when you connect again it sets to 0
no different if i wait 1 min or 5 min after alt+F4 when i logout it change back to 0 when i join again the server

Hi, the database sets is dead to 1 but when you relog in it doesn’t work.

When I die, in the database changes isDeath to 1, but when I give alt + f4 it goes back to 0 instantly, any solution?

Another asset has to be modifying the health of the player. If the health goes above 0 between when they alt F4 and when they disconnect, the DB will show alive.

Could it be the ambulancejob?

Shouldn’t be, I’m using ambulancejob without issue. What addons are you using? Seems like a frequent issue to people above, it’d be nice to narrow down what addon may be causing this.

I managed to solve this problem by deleting “local deathStatus = 0” on server.lua, but now the character is born dead, but he somehow revives and can walk (even with the death screen appearing)

Yeah, removing that breaks the logic of the code. deathStatus is determining if the player is dead (1 = true, 0 = false) to be able to save the correct integer to the database. Without the initial instantiation being 0, it’s possible you will update the database with a null value, which won’t work.

If you want to do anything with that, change it to:

if dead then
	local deathStatus = 1
else
    local deathStatus = 0
end

This totally sounds like a client side issue and not a server side issue. Something is making:

GetEntityHealth(GetPlayerPed(-1)) > 0

result in true somewhere between pressing ALT+F4 and disconnecting.

Yes, I did it, I explained myself wrong, sorry.
I’ll try to disable all the resources, and just leave the ambulance and test if it will work. If it works, I’ll try to figure out which resource is conflicting and put it here

1 Like

That’d be helpful. If I can get that resource, I’ll see if I can make a fix. I suspect a skin-related addon.

scorpio you want my anti f4 ambulance script ? i can send it to you

1 Like

if you have the resource knockout delet this .

and why you not send me ?

Heya Jager. I target your script a long time. in the hope your re release it. would it possible that you share it with me ?

I know that you are looking for a key script.
I have one, but you can not get it.
you always want to have everything but you give yourself nothing.

@Antonios, am I looking for key script ? wtf, i think i have all your scripts you got on your server or maybe even made or edited by me

@Pfann send me discord message

hahaha realy hahahaha

what’s the name of my server?

i do not need to know what you server name is lol

Hello SaltyGrandpa!
I love this, and i’ve been using it since the __source release.

I’m having som trouble though, there is a guy that allways spawns at the police station. And this happened after i added this source. Would appreciate if you could help me out!

Hi, i’m having problems with persistent death. Do you still have the script to prevent Alt + F4?