Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function deathCheck(attacker, attackerweapon, bodypart, loss)
- local pHealth = getElementHealth(source)
- if (pHealth <=15) and (pHealth >= 5) then
- outputChatBox("*You're near death and will be completely lifeless soon, Type /acceptdeath or wait for Medics!", source, 255, 0, 0, false)
- setPedAnimation(source, "ped", "KO_shot_stom", 3000, false, false, false)
- setTimer(setPedAnimation, 3000, 1, source, "ped", "KO_shot_stom", -1, false, false, false)
- addCommandHandler("acceptdeath", killHim)
- setElementData(source, "injured", true)
- end
- if (bodypart == 9 ) then
- killPed(source)
- end
- end
- addEventHandler("onPlayerDamage", getRootElement(), deathCheck)
- function killHim(source)
- killPed(source)
- removeCommandHandler("acceptdeath")
- end
- function checkHp()
- local players = getElementsByType("player")
- for theKey,thePlayer in ipairs(players) do
- if (getElementData(thePlayer, "injured") == true ) and (getElementHealth(thePlayer >= 20) then
- setElementData(thePlayer, "injured", false)
- end
- end
- end
- setTimer(checkHp, 1000, 0)
Add Comment
Please, Sign In to add comment