So, I did as you said with OnPlayerWeaponShot and tried both return 1; and 0; but anytime the player is shot - he just gets put into BrutalM and then Dead right after.
PHP код:
forward OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
new DeathB;
new DeathS[128];
new Float:PlayerHealth;
GetPlayerHealth(hitid, PlayerHealth);
if (hitid - hittype < 10)
if(Character[hitid][BrutalM] == 0)
{
ClearPlayerWeapons(hitid);
GetPlayerPos(hitid, BMPos[hitid][0], BMPos[hitid][1], BMPos[hitid][2]);
Character[hitid][BrutalM] = 1;
Character[hitid][CanAccept] = 0;
LegHit[hitid] = 0;
format(DTextS, sizeof(DTextS), "(( %s is currently injured, type /damages %i for more info. ))", GetName(hitid), hitid);
label[hitid] = Create3DTextLabel(DTextS, COLOR_RED, BMPos[hitid][0], BMPos[hitid][1], BMPos[hitid][2], 10.0, 0);
Attach3DTextLabelToPlayer(label[hitid], hitid, 0, 0, 0.7);
if(Character[hitid][Level] <= 10)
{
SetPlayerHealth(hitid, 25);
ClearPlayerWeapons(hitid);
DeathB = RandomEx(100, 500);
GivePlayerMoney(hitid, -DeathB);
format(DeathS, sizeof(DeathS), "EMT: Your Medical bills are $%i.", DeathB);
SCM(hitid, COLOR_LIGHTPINK, DeathS);
SCM(hitid, COLOR_LIGHTRED, "You were brutally wounded, now if a medic or anyone else doesn't save you, you'll die.");
SCM(hitid, COLOR_LIGHTRED, "To accept death type /acceptdeath");
}
else if(Character[hitid][Level] <= 20 && Character[playerid][Level] > 10)
{
SetPlayerHealth(hitid, 25);
ClearPlayerWeapons(hitid);
DeathB = RandomEx(100, 750);
GivePlayerMoney(hitid, -DeathB);
format(DeathS, sizeof(DeathS), "EMT: Your Medical bills are $%i.", DeathB);
SCM(hitid, COLOR_LIGHTPINK, DeathS);
SCM(hitid, COLOR_LIGHTRED, "You were brutally wounded, now if a medic or anyone else doesn't save you, you'll die.");
SCM(hitid, COLOR_LIGHTRED, "To accept death type /acceptdeath");
}
else if(Character[hitid][Level] <= 30 && Character[hitid][Level] > 20)
{
SetPlayerHealth(hitid, 25);
ClearPlayerWeapons(hitid);
DeathB = RandomEx(100, 1250);
GivePlayerMoney(hitid, -DeathB);
format(DeathS, sizeof(DeathS), "EMT: Your Medical bills are $%i.", DeathB);
SCM(hitid, COLOR_LIGHTPINK, DeathS);
SCM(hitid, COLOR_LIGHTRED, "You were brutally wounded, now if a medic or anyone else doesn't save you, you'll die.");
SCM(hitid, COLOR_LIGHTRED, "To accept death type /acceptdeath");
}
else if(Character[hitid][Level] > 30)
{
SetPlayerHealth(hitid, 25);
ClearPlayerWeapons(hitid);
DeathB = RandomEx(100, 1500);
GivePlayerMoney(hitid, -DeathB);
format(DeathS, sizeof(DeathS), "EMT: Your Medical bills are $%i.", DeathB);
SCM(hitid, COLOR_LIGHTPINK, DeathS);
SCM(hitid, COLOR_LIGHTRED, "You were brutally wounded, now if a medic or anyone else doesn't save you, you'll die.");
SCM(hitid, COLOR_LIGHTRED, "To accept death type /acceptdeath");
return 1;
}
}
PHP код:
if(Character[playerid][BrutalM] == 1)
{
GetPlayerPos(playerid, DPos2[playerid][0], DPos2[playerid][1], DPos2[playerid][2]);
Delete3DTextLabel(label[playerid]);
label2[playerid] = Create3DTextLabel("(( THIS PLAYER IS NOW DEAD ))", COLOR_RED, DPos2[playerid][0], DPos2[playerid][1], DPos2[playerid][2], 10.0, 0);
Attach3DTextLabelToPlayer(label2[playerid], playerid, 0, 0, 0.7);
Character[playerid][Dead] = 1;
Character[playerid][BrutalM] = 0;
SCM(playerid, COLOR_YELLOW, ">> You are now dead. You can use /respawnme after 60 seconds to respawn.");
Character[playerid][CanSpawn] = 0;
KillTimer(DeathT);
RespawnT = 60;
RespawnEx = SetTimer("RespawnTimer", 999, true);
RTimer = SetTimerEx("RespawnTimer2", 60000, false, "i", playerid);
}