19.09.2010, 01:12
Have fun with Injured people
pawn Код:
#include <a_samp>
#define COLOR_RED 0xAA3333AA
new Injured[MAX_PLAYERS];
forward Bleeding(playerid);
forward InjuredCheck(playerid);
public OnFilterScriptInit()
{
SetTimer("Bleeding",25000,1); // Bleeding every 25 seconds
SetTimer("InjuredCheck",24000,1); //Check every 24 second if the player is injured..
return 1;
}
public InjuredCheck(playerid)
{
new Float:health;
GetPlayerHealth(playerid,health);
if(health < 46)
{
Injured[playerid]=1;
}
else
{
if(health > 46)
{
Injured[playerid]=0;
}
}
return 1;
}
public Bleeding(playerid)
{
if (Injured[playerid] == 1)
{
SetPlayerHealth(playerid,-10);
}
return 1;
}