Removing damages
#10

I know you didn't want a code, but it's easier for me to explain you with the example code (read the // comments):

PHP код:
if (PlayerHealth 10.0// fix the conditions
//< open braces
    
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 
0// return 0; to avoid damage before closing braces
}// close brace of the conditional statement 
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)