SA-MP Forums Archive
Help! - 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! (/showthread.php?tid=284804)



Help! - [MKD]Max - 20.09.2011

i need help with include onplayershotonplayer how i can make other player not lose anything from his health ??!!! how please help! i realy want that


Re: Help! - Xyrex - 20.09.2011

You have to store the player health. When the player get damage you must restore his health.


Re: Help! - Stigg - 20.09.2011

Quote:
Originally Posted by [MKD]Max
Посмотреть сообщение
i need help with include onplayershotonplayer how i can make other player not lose anything from his health ??!!! how please help! i realy want that
Have you seen this:

https://sampforum.blast.hk/showthread.php?pid=937824#pid937824

Found with a little SEARCH. Should help you get started.


Re: Help! - DRIFT_HUNTER - 20.09.2011

You simply can reset players health every 1 sec to 999999hp
Or if you want make it like if players are same team than they cant shot each other than use SetPlayerTeam


Re: Help! - IceCube! - 20.09.2011

pawn Код:
PublicOnPlayer/......
{
      SetPlayerhHealth(target, 100);
}
What exactly do ou mean...


Re : Help! - timaoux - 21.09.2011

pawn Код:
forward OnPlayerShotPlayer(playerid);//somewhere on the script
new HealthTimer;//at the top of the script

HealthTimer = SetTimerEx("OnPlayerShotPlayer", 1000, true, "i", playerid);//in onplayerconnect


KillTimer(HealthTimer);//in onplayerdisconnect

public OnPlayerShotPlayer(playerid)//somewhere on the script
{
    new Float:Health;
    GetPlayerHealth(playerid, Health);
    if(Health < 950)
    {
        SetPlayerHealth(playerid, 100);
    }
    return 1;
}

this will set his health to 100 every 1 sec if his heal is lower than 950hp