19.09.2010, 01:36
Finally i've thing about it a little, and the only way to work exactly (Remove 10points of HP every 25 seconds, if the player have life <= 45 is this one:
So try this for the final result.
pawn Код:
#include <a_samp>
#define COLOR_RED 0xAA3333AA
forward InjuredCheck(playerid);
public OnFilterScriptInit()
{
SetTimer("InjuredCheck",25000,1); //Check every 25 second if the player is injured and make him bleed..
return 1;
}
public InjuredCheck(playerid)
{
new Float:health;
GetPlayerHealth(playerid,health);
if(health < 46)
{
GivePlayerHealth(playerid,-10);
}
return 1;
}
//GivePlayerHealth Fuction (thanks to aircombat)
stock GivePlayerHealth(playerid,Float:Health)
{
new Float:health; GetPlayerHealth(playerid,health);
SetPlayerHealth(playerid,health+Health);
}