SA-MP Forums Archive
How Can I Unaffected By The Explosion - 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: How Can I Unaffected By The Explosion (/showthread.php?tid=453708)



How Can I Unaffected By The Explosion - XpDeviL - 26.07.2013

Hi,

As I said at the title, I want to my health will not decrease on any explosions. Is it possiple?



Re: How Can I Unaffected By The Explosion - Binx - 26.07.2013

Setting your health to 99999.


Re: How Can I Unaffected By The Explosion - Threshold - 26.07.2013

Depends on what explosion you use.

https://sampwiki.blast.hk/wiki/CreateExplosion
https://sampwiki.blast.hk/wiki/Explosion_List

If you're talking about explosions in general, you need to set your vehicle health very high or to infinite using SetPlayerHealth.


Re: How Can I Unaffected By The Explosion - wumpyc - 26.07.2013

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
set your vehicle health very high or to infinite using SetPlayerHealth.
Sir, no sir


Re: How Can I Unaffected By The Explosion - XpDeviL - 26.07.2013

No. I mean health will discrease on fall, shoot, fight etc.. It will not discrease only explosions.


Re: How Can I Unaffected By The Explosion - JimmyCh - 26.07.2013

Looking at the explosions list, type 1 does no physical blast and is visible, type 13 isn't visible, no physical blast, "Produces no special effects other than black burn effects on the ground, does no damage either."
Hope I helped.


Re: How Can I Unaffected By The Explosion - XpDeviL - 26.07.2013

Quote:
Originally Posted by JimmyCh
Посмотреть сообщение
Looking at the explosions list, type 1 does no physical blast and is visible, type 13 isn't visible, no physical blast, "Produces no special effects other than black burn effects on the ground, does no damage either."
Hope I helped.
On rocket or greande explosions? And only one person will unaffected. Others will die


Re: How Can I Unaffected By The Explosion - Threshold - 26.07.2013

Oops, not sure where I got 'Vehicle Health' from...
You cannot exactly alter an explosion from a weapon, but this is something that should help...

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
    switch(weaponid)
    {
        case 16, 35, 36, 39, 40, 51:
        {
            new Float:health;
            GetPlayerHealth(playerid, health);
            SetPlayerHealth(playerid, (health + amount));
        }
    }
    return 1;
}
This will work depending on the lagg between the server and the client. Hopefully many people won't die from excess explosions. I'm pretty sure this would work, I haven't exactly experimented with it.


Re: How Can I Unaffected By The Explosion - DeMoX - 26.07.2013

You can use this include : https://sampforum.blast.hk/showthread.php?pid=1068550#pid1068550
It does create explosion for one guy
so your code will be like this:
Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
      if(playerid != i)
      {
            CreateExplosionEx(i, Float:x, Float:y, Float:z, Float:radius, Float:maxdamage, type=EXPLOSION_TYPE_MEDIUM, reason=51, playsound=true)
      }
}



Re: How Can I Unaffected By The Explosion - XpDeviL - 26.07.2013

Quote:
Originally Posted by DeMoX
Посмотреть сообщение
You can use this include : https://sampforum.blast.hk/showthread.php?pid=1068550#pid1068550
It does create explosion for one guy
so your code will be like this:
Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
      if(playerid != i)
      {
            CreateExplosionEx(i, Float:x, Float:y, Float:z, Float:radius, Float:maxdamage, type=EXPLOSION_TYPE_MEDIUM, reason=51, playsound=true)
      }
}
Thank you it's useful.