19.09.2010, 00:08
Was messing around trying to make a working bleeding script so that when a players health is lower than 45 they will gradually lose health. No errors in the script but when I went into the game and went under 45 health nothing happend.
This is like my first time scripting PAWN so I don't know what's wrong with it. I may be adding a whole heap of shit that isn't necassary so please correct me where I went wrong and such.
Thanks in advance.
This is like my first time scripting PAWN so I don't know what's wrong with it. I may be adding a whole heap of shit that isn't necassary so please correct me where I went wrong and such.
Код:
#include <a_samp>
#if defined FILTERSCRIPT
#define COLOR_RED 0xAA3333AA
new Injured[MAX_PLAYERS];
public OnFilterScriptInit()
{
SetTimer("Bleeding",25000,1); // Bleeding every 25 seconds
return 1;
}
forward Injured(playerid);
public Injured(playerid)
{
if(health <= 45)
{
Injured[playerid]=1
}
return 1;
}
forward Bleeding(playerid);
public Bleeding(playerid)
{
if Injured[playerid]=1
{
new Float:health;
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, health-10)
{
else if Injured[playerid]=0
}
}
return 1;
}
forward OnPlayerLogin(playerid);
public OnPlayerLogin(playerid)
{
new Float:health;
GetPlayerHealth(playerid, health);
{
if(health <= 45)
{
Injured[playerid]=1
{
else if(health >= 45)
{
Injured[playerid]=0
}
}
}
}
return 1;
}
#endif



