Disconnect when player is dead

Disconnect when player is dead, lose money, black money, weapons, inventory items

i try find this script is possible?

Such a script doesn’t exist. You’d have to create it yourself.

  1. Track the players health
  2. If it is under 100 (aka “dead”) trigger a server event that deletes all data from database
  3. DropPlayer()

i dont understand this :s

Take a look on the native list. Eg;

-- CLIENT
if getPedHealthPercent() == 0 then
SQLDeleteData()
TriggerServerEvent("kickPlayer")
end

-- SERVER
RegisterServerEvent("kickPlayer")
AddEventHandler("kickPlayer", function()
dropPlayer(source, "Kick Message Here")
end)

That is not tested as I’m on my phone but thats an idea for you…

It did not work: s

I need a script that blocks ALT + F4 because when the player dies, they are supposed to call the ambulance not to lose the items / money / weapons, but they prefer to use ALT + F4 to reconnect when they come back alive at the place where they died

Blocking it isn’t possible since it’s a Windows command but you could probably make a script that looks for those keys pressed at the same time then you can do what you want with it.

I’m still new, but would it be possible to create a script like this?

When the player dies when leaving the game loses everything?

FAXES posted something similar to what you want earlier. Try implementing it to see what you can come up with. We can’t help you if you haven’t attempted to help yourself.

Omg. 100 is 0?? You might have just solved my injured script I’m working on…