How to make this explotion now kill you
#1

Hello, how do i make that this explotion doesnt kill you, but just take away
like 30% of your health? i have been looking at the samp explotion list.
but some of the explotions does not even show, and some other creates fire
and it must not create fire.

pawn Код:
if(luck <= 29)
                    {
                        new string[85];
                        new Float:x, Float:y, Float:z;
                        GetPlayerPos(playerid, x, y, z);
                        CreateExplosion(x, y, z, 5, 10.0);
                        PlayerInfo[playerid][pFishSkill] += 1;
                        Fishes[playerid][pTempFishName] = 0;
                        SendClientMessage(playerid, COLOR_GREY, "   You caught an undetonated sea mine!");
                        format(string, sizeof(string), "* %s reels in an undetonated sea mine!", RemoveUnderScore(playerid));
                        ProxDetector(30.0, playerid, string, COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED);
                        RemovePlayerAttachedObject(playerid,0);
                        FishCaught[playerid] = 0;
                        Fishing[playerid] = 0;
                        KillTimer(fishtimer[playerid]);
                        return 1;
                    }
Reply
#2

Set a PVar for the player and give him the lost health back in OnPlayerTakeDamage if the PVar is true.
Reply
#3

Quote:
Originally Posted by GangstaSunny
Посмотреть сообщение
Set a PVar for the player and give him the lost health back in OnPlayerTakeDamage if the PVar is true.
Quote:
Originally Posted by GangstaSunny
Посмотреть сообщение
Set a PVar for the player and give him the lost health back in OnPlayerTakeDamage if the PVar is true.
It wont work if you set player health after the explosion because once the player health reaches 0%,there is no way the player can survive.

In my opinion the best way is to check the players near the coordinates of the explosion (before explosion) and set their health to more than 100.
Reply
#4

Use this:
https://sampforum.blast.hk/showthread.php?tid=225350

If you're using a streamer, include it before including that.
Same thing with foreach/y_iterate.

If it gives a "foreach_depricated" warning, edit the include and change all (Only 2)
Код:
foreach(Player, i)
to
Код:
foreach(new i : Player)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)