Help me please
#1

public Health()
{
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(gPlayerSpawned[i] == 1)
{
new Float:health;
GetPlayerHealth(i, health);
if(health < 30)
{
if(IsPlayerInAnyVehicle(i))
{
RemovePlayerFromVehicle(i);
ApplyAnimation(i, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
GameTextForPlayer(i, "~r~Voce esta morrendo chame um medico !", 5000, 3);
}
ApplyAnimation(i, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
GameTextForPlayer(i, "~r~Voce esta morrendo chame um medico !", 5000, 3);
}
}
}
}
return 1;
}

i create this command for if the player have 30 or - on life he go to anim crack but he take 20 on life and dont go =X i need help please
Reply
#2

Use PAWN tags next time.

Try this, also make sure the function is actually being called.
pawn Код:
public Health()
{
  for(new i; i<MAX_PLAYERS; i++)
  {
    if(IsPlayerConnected(i))
    {
      if(gPlayerSpawned == 1)
      {
        new Float:health;
        GetPlayerHealth(i, health);
       
              if(health < 30)
        {
                    if(IsPlayerInAnyVehicle(i))
                    {
                        RemovePlayerFromVehicle(i);
                        ApplyAnimation(i, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
                        GameTextForPlayer(i, "~r~Voce esta morrendo chame um medico !", 5000, 3);
          }
                    else
                    {
                    ApplyAnimation(i, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
          GameTextForPlayer(i, "~r~Voce esta morrendo chame um medico !", 5000, 3);
                    }
        }
      }
    }
  }
  return 1;
}
Reply
#3

C:\DOCUME~1\IGOR\Desktop\FINAL_~1\FINAL_~1\GAMEMO~ 1\crpnew.pwn(1391) : error 033: array must be indexed (variable "gPlayerSpawned")
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)