Prevent OnPlayerDeath to step in
#2

Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
        if((0 <= weaponid <= 46) || weaponid == 54)
        {
                if(BODY_PART_TORSO <= bodypart <= BODY_PART_HEAD) Damage[playerid][(bodypart - 3)][weaponid]++;
        }

        new Float:health;
        GetPlayerHealth(playerid,health);

		if(25.0 < health < 35.0 && PlayerInfo[playerid][pLowSkillNotified] == 0)
        {
		        SCM(playerid, COLOR_LIGHTRED, "> Low health, shooting skills at medium.");
		        PlayerInfo[playerid][pLowSkillNotified] = 1;
        }
        if(20.0 < health < 25.0 && PlayerInfo[playerid][pLowSkillNotified] == 1)
        {
		        SCM(playerid, COLOR_LIGHTRED, "> Very low health, shooting skills at low.");
		        PlayerInfo[playerid][pLowSkillNotified] = 2;
        }
        if(15.0 < health <= 20.0 && PlayerInfo[playerid][pBrutally] == 0 && DeadNotify[playerid] == 0)
        {
		        SCM(playerid, COLOR_LIGHTRED, "You are brutally wounded, you may wait for a medic or write /acceptdeath.");
				new stringdamage[128];
				new stringdamage2[128];
                format(stringdamage, sizeof(stringdamage), "(( This player is brutally wounded. He has been hit %d times\n/damages %d ))", CountDamages(playerid), playerid);
                strcat(stringdamage, stringdamage2);

                DamageShot[playerid] = Create3DTextLabel(stringdamage, 0xFF8080FF, 30.0, 40.0, 0.0, 20.0, 0, 0);
                Attach3DTextLabelToPlayer(DamageShot[playerid], playerid, 0.0, 0.0, 0.0);

                FreezePlayer(playerid);
		        OnAnim{playerid} = true;
		        ApplyAnimation(playerid,"PARACHUTE","FALL_skyDive_DIE",3.5,0,0,0,1,0);

		        SetIntVar(playerid, "JustDied", 1);
		        PlayerInfo[playerid][pBrutally] = 1;
		        DeadNotify[playerid] = 1;
        }
        if(health <= 15.0 && PlayerInfo[playerid][pBrutally] == 1 && DeadNotify[playerid] == 1)
        {
		        SCM(playerid, COLOR_LIGHTRED, "You are dead now. You can use /respawnme in 60 seconds.");
				new stringdamage[128];
				new stringdamage2[128];
                format(stringdamage, sizeof(stringdamage), "(( THIS PLAYER IS DEAD ))");
                strcat(stringdamage, stringdamage2);

                DamageShot[playerid] = Create3DTextLabel(stringdamage, 0xFF8080FF, 30.0, 40.0, 0.0, 20.0, 0, 0);
                Attach3DTextLabelToPlayer(DamageShot[playerid], playerid, 0.0, 0.0, 0.0);

                FreezePlayer(playerid);
		        OnAnim{playerid} = true;
		        ApplyAnimation(playerid,"PARACHUTE","FALL_skyDive_DIE",3.5,0,0,0,1,0);

		        SetIntVar(playerid, "JustDied", 2);
		        PlayerInfo[playerid][pBrutally] = 2;
		        DeadNotify[playerid] = 2;
        }
        return 1;
}
if(20.0 < health < 25.0 && PlayerInfo[playerid][pLowSkillNotified] == 1)

i don't know why you using this varaible && PlayerInfo[playerid][pLowSkillNotified] == 1

but use statement like edited above i hope it will help you.
Reply


Messages In This Thread
Prevent OnPlayerDeath to step in - by AidanRO - 15.05.2016, 09:06
Re: Prevent OnPlayerDeath to step in - by MBilal - 15.05.2016, 10:06

Forum Jump:


Users browsing this thread: 1 Guest(s)