Help please! System of a damage
#1

Hello, I had very important question on a damaga. It is possible to clean somehow standard damage completely? My functions not correctly work. Tazer, shouldn't cause a loss in general, but at first the standard loss from the weapon is taken away, and then quickly restores value health. Sometimes, isn't in time. And if at the player about 10 health, he in general kills him. Question: how to disconnect a standard loss? That only my functions worked, whether there is any way? I want to make approximate function of a loss as on the LS-RP project. Thanks!

PHP код:
public OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart)
{
    if(
== weaponid && PlayerInfo[issuerid][pStrength] != 0)
    {
        new 
strength PlayerInfo[issuerid][pStrength]*2;
        
GivePlayerHealth(playerid, -strength);
    }
    else if(
== weaponid && PlayerInfo[issuerid][pStrength] != 0)
    {
        new 
strength PlayerInfo[issuerid][pStrength]*3;
        
GivePlayerHealth(playerid, -strength);
    }
    else if((
>= weaponid <= 15) && PlayerInfo[issuerid][pStrength] != 0)
    {
        new 
strength PlayerInfo[issuerid][pStrength]*4;
        
GivePlayerHealth(playerid, -strength);
    }
    if((
<= weaponid <= 46) || weaponid == 53)
    {
        
PlayerInfo[playerid][pHits] ++;
        if(
BODY_PART_TORSOd <= bodypart <= BODY_PART_HEADdDamage[playerid][(bodypart 3)][weaponid]++;
        if(
bodypart == BODY_PART_LEFT_LEG || bodypart == BODY_PART_RIGHT_LEGStartPlayerInjury(playerid);
        
    }
    if(
PlayerIsWounded(playerid))
    {
        
SetPlayerHealth(playerid25.0);
    }
    return 
1;

OnPlayerShootPlayer
PHP код:
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
    new 
Float:armour;
    
GetPlayerArmour(Targetarmour);
    new 
weapon GetWeaponHolding(Shooter);
    if(
PlayerHoldingWeapon(Shooter23) && TazerActive{Shooter})
    {
        if(!
Tazed{Target})
        {
            
GivePlayerHealth(TargetHealthLost);
            
SetPlayerArmour(Targetarmour+ArmourLost);
            
FreezePlayer(Target);
            
OnPlayAnim(Target"PARACHUTE""FALL_skyDive_DIE"4.000010);
            
Tazed{Target} = true;
            
SetTimerEx("SetUnTazed"15000false"i"Target);
        }
        else
        {
            
GivePlayerHealth(TargetHealthLost);
            
SetPlayerArmour(Targetarmour+ArmourLost);
        }
    }
    else if(
PlayerHoldingWeapon(Shooter25) && RubberActive{Shooter})
    {
        if(!
Tazed{Target})
        {
            
GivePlayerHealth(TargetHealthLost);
            
SetPlayerArmour(Targetarmour+ArmourLost);
            
FreezePlayer(Target);
            
OnPlayAnim(Target"SWEET""Sweet_injuredloop"4.010010);
            
Tazed{Target} = true;
            
SetTimerEx("SetUnTazed"30000false"i"Target);
        }
        else
        {
            
GivePlayerHealth(TargetHealthLost);
            
SetPlayerArmour(Targetarmour+ArmourLost);
        }
    }
    else if(
PlayerHoldingWeapon(Shooter41) && CopDuty{Shooter})
    {
        
GivePlayerHealth(TargetHealthLost+0.5);
        if(
armour 0)
        {
            
SetPlayerArmour(Targetarmour+ArmourLost+1.0);
        }
    }
    else if(
weapon == 24 || weapon == 30 || weapon == 31 || weapon == 34 || weapon == 25 || weapon == 29 || weapon == 28 || weapon == 32 || weapon == 33 || weapon == 34)
    {
        if(
GetWorld(Shooter) == GetWorld(Target))
        {
            if(
IsPlayerAimingTargetBodyPart(ShooterTarget1)) // BODY_PART_HEAD
            
{
                
DoDamage(Target1GetPlayerWeapon(Shooter));
            }
            else if(
IsPlayerAimingTargetBodyPart(ShooterTarget2)) // BODY_PART_TORSO
            
{
                
DoDamage(Target2GetPlayerWeapon(Shooter));
            }
            else if(
IsPlayerAimingTargetBodyPart(ShooterTarget3)) // BODY_PART_LEGS
            
{
                
DoDamage(Target3GetPlayerWeapon(Shooter));
            }
        }
    }
    return 
1;

Reply


Messages In This Thread
Help please! System of a damage - by Wist - 17.12.2015, 20:32
Re: Help please! System of a damage - by Wist - 20.12.2015, 13:36
Re: Help please! System of a damage - by Sebz - 20.12.2015, 14:09
Re: Help please! System of a damage - by Shoulen - 20.12.2015, 14:09
Re: Help please! System of a damage - by Wist - 20.12.2015, 15:09
Re: Help please! System of a damage - by Nero_3D - 20.12.2015, 17:41

Forum Jump:


Users browsing this thread: 1 Guest(s)