Check is player loses health
#1

I need a function or something that check's if a certain player loses health.

So far I couldn't do that.

For example, if payer loses health ---- do something..

Thanks!
Reply
#2

There are many filterscripts with useful callbacks and even a plugin if i'm correct. Search for "OnPlayerLoseHealth".
Reply
#3

I believe the callback you are thinking of Don Correlli, is in YUP.
Anyways, if you don't want to use more callbacks, just use OnPlayerUpdate
pawn Код:
//global
new
  Float:g_fUpdateHealth;
//OnPlayerUpdate
public OnPlayerUpdate(playerid)
{
  new
    Float:fUpdateHealth;
  if( fUpdateHealth != g_fUpdateHealth );
  {
    //health has changed
  }
  return true;
}
Reply
#4

Quote:
Originally Posted by lrZ^ aka LarzI
I believe the callback you are thinking of Don Correlli, is in YUP.
Anyways, if you don't want to use more callbacks, just use OnPlayerUpdate
pawn Код:
//global
new
  Float:g_fUpdateHealth;
//OnPlayerUpdate
public OnPlayerUpdate(playerid)
{
  new
    Float:fUpdateHealth;
  if( fUpdateHealth != g_fUpdateHealth );
  {
    //health has changed
  }
  return true;
}
Do you have any idea how often onplayerupdate is called? yes A LOT per seconds.
Wouldn't recommend this.
Reply
#5

But i want to detect if player loses health onder the OnPlayerKeyStateChange, and that is already a plublic function..
Reply
#6

Quote:
Originally Posted by hipy
Quote:
Originally Posted by lrZ^ aka LarzI
I believe the callback you are thinking of Don Correlli, is in YUP.
Anyways, if you don't want to use more callbacks, just use OnPlayerUpdate
pawn Код:
//global
new
  Float:g_fUpdateHealth;
//OnPlayerUpdate
public OnPlayerUpdate(playerid)
{
  new
    Float:fUpdateHealth;
  if( fUpdateHealth != g_fUpdateHealth );
  {
    //health has changed
  }
  return true;
}
Do you have any idea how often onplayerupdate is called? yes A LOT per seconds.
Wouldn't recommend this.
20-30 times in one second.
You have to divide 1 with 25 so 40-50 ms.
Reply
#7

And about my question? Anything?!
Reply
#8

Anything?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)