SA-MP Forums Archive
Help reduce damage from bazooka close - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help reduce damage from bazooka close (/showthread.php?tid=519148)



Help reduce damage from bazooka close - Freak@ - 13.06.2014

wanted help from you to create a system that when the player shooting someone with a rocket up close and decrease the damage it possible? tried to do so it worked to lessen the damage of the sniper bazooka not giving ta: S.

pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
    if (weaponid == 34)//We check whether the player is with a sniper ...
    {
        new Float:fX,Float:fY,Float:fZ;
        GetPlayerPos(playerid, fX, fY, fZ);//We will store the position of the shooter.
        if (IsPlayerInRangeOfPoint(damagedid, 50.0, fX, fY, fZ))//Check if the player who took the damage is within 20 meters from the shooter.
        {

            new Float:health;
            GetPlayerHealth(damagedid, health);
            SetPlayerHealth(damagedid, health - 1.0);
       }
       }
       if (weaponid == 36)//We check whether the player is with a bazooka
       {
          new Float:fX,Float:fY,Float:fZ;
          GetPlayerPos(playerid, fX, fY, fZ);//We will store the position of the shooter.
          if (IsPlayerInRangeOfPoint(damagedid, 20.0, fX, fY, fZ))// Check if the player who took the damage is within 20 meters from the shooter.
          {
            new Float:health;
            GetPlayerHealth(damagedid, health);
            SetPlayerHealth(damagedid, health - 1.0);
       }
    }
    return 1;
}



Re: Help reduce damage from bazooka close - SilentSoul - 13.06.2014

https://sampforum.blast.hk/showthread.php?tid=330005


Re: Help reduce damage from bazooka close - Freak@ - 13.06.2014

I checked but seems to have decreased weapon id 36


Re: Help reduce damage from bazooka close - Freak@ - 13.06.2014

?


Re: Help reduce damage from bazooka close - Manyula - 13.06.2014

Try the weaponid 51.
https://sampwiki.blast.hk/wiki/Weapons


Re: Help reduce damage from bazooka close - Freak@ - 13.06.2014

Quote:
Originally Posted by Manyula
Посмотреть сообщение
Only a death icon, can not be used in GivePlayerWeapon etc. okay?


Re: Help reduce damage from bazooka close - Faisal_khan - 13.06.2014

Weapon id 36 is WEAPON_HEATSEEKER and for WEAPON_ROCKETLAUNCHER i.e. your bazoka, the weapon id is 35.


Re: Help reduce damage from bazooka close - Freak@ - 13.06.2014

Quote:
Originally Posted by Faisal_khan
Посмотреть сообщение
Weapon id 36 is WEAPON_HEATSEEKER and for WEAPON_ROCKETLAUNCHER i.e. your bazoka, the weapon id is 35.
but id have to reduce damage 35


Re: Help reduce damage from bazooka close - maramizo - 13.06.2014

Quote:
Originally Posted by Freak@
Посмотреть сообщение
but id have to reduce damage 35
Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
    if (weaponid == 34)//We check whether the player is with a sniper ...
    {
        new Float:fX,Float:fY,Float:fZ;
        GetPlayerPos(playerid, fX, fY, fZ);//We will store the position of the shooter.
        if (IsPlayerInRangeOfPoint(damagedid, 50.0, fX, fY, fZ))//Check if the player who took the damage is within 20 meters from the shooter.
        {

            new Float:health;
            GetPlayerHealth(damagedid, health);
            SetPlayerHealth(damagedid, health - 1.0);
       }
       }
       if (weaponid == 35)//We check whether the player is with a bazooka
       {
          new Float:fX,Float:fY,Float:fZ;
          GetPlayerPos(playerid, fX, fY, fZ);//We will store the position of the shooter.
          if (IsPlayerInRangeOfPoint(damagedid, 20.0, fX, fY, fZ))// Check if the player who took the damage is within 20 meters from the shooter.
          {
            new Float:health;
            GetPlayerHealth(damagedid, health);
            SetPlayerHealth(damagedid, health - 1.0);
       }
    }
    return 1;
}



Re: Help reduce damage from bazooka close - Freak@ - 13.06.2014

the life is not diminished with the bazooka: s id 35