Removing damages
#7

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.

OnPlayerWeaponShot
PHP код:
forward OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ);
public 
OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ)
{
    new 
DeathB;
    new 
DeathS[128];
    new 
Float:PlayerHealth;
    
GetPlayerHealth(hitidPlayerHealth);
    if (
hitid hittype 10)
    if(
Character[hitid][BrutalM] == 0)
        {
            
ClearPlayerWeapons(hitid);
            
GetPlayerPos(hitidBMPos[hitid][0], BMPos[hitid][1], BMPos[hitid][2]);
            
Character[hitid][BrutalM] = 1;
            
Character[hitid][CanAccept] = 0;
            
LegHit[hitid] = 0;

            
format(DTextSsizeof(DTextS), "(( %s is currently injured, type /damages %i for more info. ))"GetName(hitid), hitid);
            
label[hitid] = Create3DTextLabel(DTextSCOLOR_REDBMPos[hitid][0], BMPos[hitid][1], BMPos[hitid][2], 10.00);
            
Attach3DTextLabelToPlayer(label[hitid], hitid000.7);

            if(
Character[hitid][Level] <= 10)
            {
                
SetPlayerHealth(hitid25);
                 
ClearPlayerWeapons(hitid);
                
DeathB RandomEx(100500);
                
GivePlayerMoney(hitid, -DeathB);
                
format(DeathSsizeof(DeathS), "EMT: Your Medical bills are $%i."DeathB);
                
SCM(hitidCOLOR_LIGHTPINKDeathS);
                
SCM(hitidCOLOR_LIGHTRED"You were brutally wounded, now if a medic or anyone else doesn't save you, you'll die.");
                
SCM(hitidCOLOR_LIGHTRED"To accept death type /acceptdeath");
            }
            else if(
Character[hitid][Level] <= 20 && Character[playerid][Level] > 10)
            {
                
SetPlayerHealth(hitid25);
                
ClearPlayerWeapons(hitid);
                
DeathB RandomEx(100750);
                
GivePlayerMoney(hitid, -DeathB);
                
format(DeathSsizeof(DeathS), "EMT: Your Medical bills are $%i."DeathB);
                
SCM(hitidCOLOR_LIGHTPINKDeathS);
                
SCM(hitidCOLOR_LIGHTRED"You were brutally wounded, now if a medic or anyone else doesn't save you, you'll die.");
                
SCM(hitidCOLOR_LIGHTRED"To accept death type /acceptdeath");
            }
            else if(
Character[hitid][Level] <= 30 && Character[hitid][Level] > 20)
            {
                
SetPlayerHealth(hitid25);
                
ClearPlayerWeapons(hitid);
                
DeathB RandomEx(1001250);
                
GivePlayerMoney(hitid, -DeathB);
                
format(DeathSsizeof(DeathS), "EMT: Your Medical bills are $%i."DeathB);
                
SCM(hitidCOLOR_LIGHTPINKDeathS);
                
SCM(hitidCOLOR_LIGHTRED"You were brutally wounded, now if a medic or anyone else doesn't save you, you'll die.");
                
SCM(hitidCOLOR_LIGHTRED"To accept death type /acceptdeath");
            }
            else if(
Character[hitid][Level] > 30)
            {
                
SetPlayerHealth(hitid25);
                
ClearPlayerWeapons(hitid);
                
DeathB RandomEx(1001500);
                
GivePlayerMoney(hitid, -DeathB);
                
format(DeathSsizeof(DeathS), "EMT: Your Medical bills are $%i."DeathB);
                
SCM(hitidCOLOR_LIGHTPINKDeathS);
                
SCM(hitidCOLOR_LIGHTRED"You were brutally wounded, now if a medic or anyone else doesn't save you, you'll die.");
                
SCM(hitidCOLOR_LIGHTRED"To accept death type /acceptdeath");
                return 
1;
            }
        } 
OnPlayerTakeDamage
PHP код:
if(Character[playerid][BrutalM] == 1)
        {
            
GetPlayerPos(playeridDPos2[playerid][0], DPos2[playerid][1], DPos2[playerid][2]);
            
Delete3DTextLabel(label[playerid]);
            
label2[playerid] = Create3DTextLabel("(( THIS PLAYER IS NOW DEAD ))"COLOR_REDDPos2[playerid][0], DPos2[playerid][1], DPos2[playerid][2], 10.00);
            
Attach3DTextLabelToPlayer(label2[playerid], playerid000.7);
            
Character[playerid][Dead] = 1;
            
Character[playerid][BrutalM] = 0;
            
SCM(playeridCOLOR_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"999true);
            
RTimer SetTimerEx("RespawnTimer2"60000false"i"playerid);
        } 
Reply


Messages In This Thread
Removing damages - by aoky - 12.06.2017, 00:23
Re: Removing damages - by Toroi - 12.06.2017, 00:31
Re: Removing damages - by aoky - 12.06.2017, 00:40
Re: Removing damages - by Toroi - 12.06.2017, 00:49
Re: Removing damages - by Kane - 12.06.2017, 00:55
Re: Removing damages - by oSAINTo - 12.06.2017, 01:28
Re: Removing damages - by aoky - 12.06.2017, 01:52
Re: Removing damages - by Toroi - 12.06.2017, 01:56
Re: Removing damages - by aoky - 12.06.2017, 01:57
Re: Removing damages - by Toroi - 12.06.2017, 02:01

Forum Jump:


Users browsing this thread: 2 Guest(s)