-RESOLVED-
#1

-RESOLVED-
Reply
#2

Hi,

Try this instead:
pawn Код:
forward DeathSystem();
public DeathSystem()
{
  for(new i; i<MAX_PLAYERS; i++)
  {
    if(IsPlayerConnected(i))
    {
      new Float:health;
      GetPlayerHealth(i, health);
      if(health < 10)
      {
        if(IsPlayerInAnyVehicle(i))
        {
          RemovePlayerFromVehicle(i);
        }
        TogglePlayerControllable(i, 0);
        ApplyAnimation( i, "INT_HOUSE", "BED_Loop_R", 4.0, 1, 0, 0, 0, 0 );
        ApplyAnimation( i, "INT_HOUSE", "BED_Loop_R", 4.0, 1, 0, 0, 0, 0 );
        PulseSystem[i] = 1;
      }
    }
  }
  return 1;
}
I have edited where you had:
pawn Код:
new Float:health;
if(GetPlayerHealth(i, health) < 10)
{...
to:

pawn Код:
new Float:health;
GetPlayerHealth(i, health);
if(health < 10)
{...
I believe that should work now. I also removed the extra code under IsPlayerInAnyVehicle because that should still be called regardless underneath.
Reply
#3

Nope. Don't work.
I had it like that, and then edited, and still wont work.
Reply
#4

Chris's code should work. What is the problem?
Reply
#5

How is DeathSystem being called? Have you added a timer for it?
Reply
#6

When I set my HP to 10 or 9, Nothing happens.
Reply
#7

Quote:
Originally Posted by yeswecanchange09
How is DeathSystem being called? Have you added a timer for it?
You're right.
You should have a timer to call the function.
Код:
OnGameModeInit()
{
    SetTimer("DeathSystem",2000,1);
    return 1;
}
Reply
#8

lol, That's it, I did this same thing before, so I knew my code was right(Before I posted)
But forgot I have to use a timer xD
Reply
#9

Don't edit your post with 'resolved' it might be usefull for other people who have the same problem.
Reply
#10

So they can look down at the replies. Which quoted this post.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)