12.06.2017, 00:40
Yeah, I'm already doing that but it still kills the player.
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
new DeathB;
new DeathS[128];
new Float:PlayerHealth;
GetPlayerHealth(playerid, PlayerHealth);
if (PlayerHealth - amount < 5)
if(Character[playerid][BrutalM] == 0)
{
ClearPlayerWeapons(playerid);
GetPlayerPos(playerid, BMPos[playerid][0], BMPos[playerid][1], BMPos[playerid][2]);
Character[playerid][BrutalM] = 1;
Character[playerid][CanAccept] = 0;
LegHit[playerid] = 0;
format(DTextS, sizeof(DTextS), "(( %s is currently injured, type /damages %i for more info. ))", GetName(playerid), playerid);
label[playerid] = Create3DTextLabel(DTextS, COLOR_RED, BMPos[playerid][0], BMPos[playerid][1], BMPos[playerid][2], 10.0, 0);
Attach3DTextLabelToPlayer(label[playerid], playerid, 0, 0, 0.7);
if(Character[playerid][Level] <= 10)
{
ClearPlayerWeapons(playerid);
DeathB = RandomEx(100, 500);
GivePlayerMoney(playerid, -DeathB);
format(DeathS, sizeof(DeathS), "EMT: Your Medical bills are $%i.", DeathB);
SCM(playerid, COLOR_LIGHTPINK, DeathS);
SCM(playerid, COLOR_LIGHTRED, "You were brutally wounded, now if a medic or anyone else doesn't save you, you'll die.");
SCM(playerid, COLOR_LIGHTRED, "To accept death type /acceptdeath");
}
else if(Character[playerid][Level] <= 20 && Character[playerid][Level] > 10)
{
ClearPlayerWeapons(playerid);
DeathB = RandomEx(100, 750);
GivePlayerMoney(playerid, -DeathB);
format(DeathS, sizeof(DeathS), "EMT: Your Medical bills are $%i.", DeathB);
SCM(playerid, COLOR_LIGHTPINK, DeathS);
SCM(playerid, COLOR_LIGHTRED, "You were brutally wounded, now if a medic or anyone else doesn't save you, you'll die.");
SCM(playerid, COLOR_LIGHTRED, "To accept death type /acceptdeath");
}
else if(Character[playerid][Level] <= 30 && Character[playerid][Level] > 20)
{
ClearPlayerWeapons(playerid);
DeathB = RandomEx(100, 1250);
GivePlayerMoney(playerid, -DeathB);
format(DeathS, sizeof(DeathS), "EMT: Your Medical bills are $%i.", DeathB);
SCM(playerid, COLOR_LIGHTPINK, DeathS);
SCM(playerid, COLOR_LIGHTRED, "You were brutally wounded, now if a medic or anyone else doesn't save you, you'll die.");
SCM(playerid, COLOR_LIGHTRED, "To accept death type /acceptdeath");
}
else if(Character[playerid][Level] > 30)
{
ClearPlayerWeapons(playerid);
DeathB = RandomEx(100, 1500);
GivePlayerMoney(playerid, -DeathB);
format(DeathS, sizeof(DeathS), "EMT: Your Medical bills are $%i.", DeathB);
SCM(playerid, COLOR_LIGHTPINK, DeathS);
SCM(playerid, COLOR_LIGHTRED, "You were brutally wounded, now if a medic or anyone else doesn't save you, you'll die.");
SCM(playerid, COLOR_LIGHTRED, "To accept death type /acceptdeath");
return 0;
}
}
//there is more code here for the rest