SA-MP Forums Archive
How can i make when player still have only 10 hp to say hi :)? - 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 make when player still have only 10 hp to say hi :)? (/showthread.php?tid=462633)



How can i make when player still have only 10 hp to say hi :)? - Kapone21 - 07.09.2013

I need a example to do this:
When player have 10 hp to say HI ( Sendclientmessage) ... only that give me example where to put when have 10 hp to do something


Re: How can i make when player still have only 10 hp to say hi :)? - Scenario - 07.09.2013

https://sampwiki.blast.hk/wiki/OnPlayerTakeDamage
https://sampwiki.blast.hk/wiki/GetPlayerHealth
https://sampwiki.blast.hk/wiki/Scripting_Basics#Variables


Re: How can i make when player still have only 10 hp to say hi :)? - SeniorGamer - 08.09.2013

pawn Код:
public OnPlayerUpdate(playerid)
{
    new Float:health;
    GetPlayerHealth(playerid,health);
    if (health < 10.0)
    {
        SendClientMessage(playerid, COLOR_RED, "Hi."); //Sending the message
        SetPlayerHealth(playerid, 11); //Setting hp to 11 so it wont spam him with the message
    }
    return 1;
}