Making sure someone is dead?
#1

Alright, so I've made a system where if someone hits something while driving, and their vehicle takes damage, then they take a portion of damage too. However, I'm having some trouble with this. When the person's health gets to 0/-999.9, they don't properly die. Can someone please tell me how I can ensure they die.

Here's a snippet of relevant code

pawn Код:
if(damageAmount > 0.0)
{
    new Float:tmpFloat;
    GetPlayerHealth(i, tmpFloat);
    SetPlayerHealth(i, floatsub(tmpFloat, damageAmount));
    if((tmpFloat - damageAmount) <= 0.0) SetPlayerHealth(i, -999.99);
    else SetPlayerHealth(i, floatsub(tmpFloat, damageAmount));
}
Reply
#2

You could try dropping them from height, that usually works.
pawn Код:
if(damageAmount > 0.0)
{
    new Float:tmpFloat;
    GetPlayerHealth(i, tmpFloat);
    SetPlayerHealth(i, floatsub(tmpFloat, damageAmount));
    if((tmpFloat - damageAmount) <= 0.0)
    {
        new Float:x, Float:y, Float:z;
        SetPlayerHealth(i, -99999);
        GetPlayerPos(playerid, x, y, z);
        SetPlayerPos(playerid, x ,y, z + 10.0);
    }
    else SetPlayerHealth(i, floatsub(tmpFloat, damageAmount));
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)