26.11.2010, 10:55
Here's my code. and my problem I'm having is, when some players log in, it will say "You are bleeding!" and then kill them. Doesn't make any sense to me. So maybe one of you guys can help.
pawn Код:
new string[256];
for(new j = 0; j<MAX_PLAYERS; j++)
{
if(IsPlayerConnected(j))
{
if(PlayerInfo[j][pToughPerk] == 1 && PlayerInfo[j][pAdmin] == 0)
{
if(gPlayerLogged[j] == 1)
{
new Float:health;
GetPlayerHealth(j, health);
if(health < 45)
{
GetPlayerHealth(j, health);
SetPlayerHealth(j, health - 5.0);
SendClientMessage(j, COLOR_RED, "You are bleeding!");
}
}
}
else if(PlayerInfo[j][pToughPerk] == 2 && PlayerInfo[j][pAdmin] == 0)
{
if(gPlayerLogged[j] == 1)
{
new Float:health;
GetPlayerHealth(j, health);
if(health < 35)
{
GetPlayerHealth(j, health);
SetPlayerHealth(j, health - 3.0);
SendClientMessage(j, COLOR_RED, "You are bleeding!");
}
}
}
else if(PlayerInfo[j][pToughPerk] == 3 && PlayerInfo[j][pAdmin] == 0)
{
if(gPlayerLogged[j] == 1)
{
new Float:health;
GetPlayerHealth(j, health);
if(health < 25)
{
GetPlayerHealth(j, health);
SetPlayerHealth(j, health - 2.0);
SendClientMessage(j, COLOR_RED, "You are bleeding!");
}
}
}
else
{
if(gPlayerLogged[j] == 1 && PlayerInfo[j][pAdmin] == 0)
{
new Float:health;
GetPlayerHealth(j, health);
if(health < 55)
{
GetPlayerHealth(j, health);
SetPlayerHealth(j, health - 7.0);
SendClientMessage(j, COLOR_RED, "You are bleeding!");
}
}
}