Bool problem?
#1

Hello everyone, I've tried scripting something, but seems like it doesn't work as expected.
I was wondering why, as it compiles fine?

So, this is the code:
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(deagledm[playerid] == 1)
    {
        if(issuerid != INVALID_PLAYER_ID && weaponid == 24 && bodypart == 9)
        {
            SetPlayerHealth(playerid, 0);
            SendClientMessage(playerid, COLOR_FIREBRICK, "** A bullet came straight into your head, you was killed by a headshot. **");
        }
        if(issuerid != INVALID_PLAYER_ID && weaponid == 24 && bodypart == 3)
        {
            SetPlayerHealth(playerid, 149);
        }
        if(issuerid != INVALID_PLAYER_ID && weaponid == 24 && bodypart == 4)
        {
            SetPlayerHealth(playerid, 149);
        }
        if(issuerid != INVALID_PLAYER_ID && weaponid == 24 && bodypart == 5)
        {
            SetPlayerHealth(playerid, 149);
        }
        if(issuerid != INVALID_PLAYER_ID && weaponid == 24 && bodypart == 6)
        {
            SetPlayerHealth(playerid, 149);
        }
        if(issuerid != INVALID_PLAYER_ID && weaponid == 24 && bodypart == 7)
        {
            SetPlayerHealth(playerid, 149);
        }
        if(issuerid != INVALID_PLAYER_ID && weaponid == 24 && bodypart == 8)
        {
            SetPlayerHealth(playerid, 149);
        }
       
    }
    else return 0;
    return 1;
}
But it keeps taking the players health down, and eventually kills him after 3 bullets?
Why does it happen, and how do I fix that? Thanks in advance!
Reply


Messages In This Thread
Bool problem? - by CesarLT - 09.06.2014, 18:12
Re: Bool problem? - by CesarLT - 09.06.2014, 21:01
Re: Bool problem? - by KtotheYle - 10.06.2014, 04:04
Re: Bool problem? - by Threshold - 10.06.2014, 04:27

Forum Jump:


Users browsing this thread: 1 Guest(s)