OnPlayerInfoChange not working ?
#7

I figured it out
This works..hope it ts not gonna be buggy when more players join

Код:
new Float:faPlayerHealth[MAX_PLAYERS];

public OnPlayerUpdate(playerid) //
{
	new Float:fHealth;

	GetPlayerHealth(playerid, fHealth);

	if(fHealth != faPlayerHealth[playerid])
	{
 	//SendClientMessage(playerid, 0xFF000096, "thingy1!");

	  // Player health has changed since last update from player -> server, so obviously thats the thing updated.
	  // Lets do further checks see if he've lost or gain health, anti health cheat? ;-)

	if(fHealth > faPlayerHealth[playerid])
 	{
  SendClientMessage(playerid, 0xFFFF0096, "You gained health!");
			/* He've gained health! Cheating? Write your own scripts here to figure how a player
			gained health! */
  	}
  else
  {
  new Float:health;
  
	if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
 	
  GetPlayerHealth(playerid,health);
  if (health < 70.0)
  {
  ApplyAnimation(playerid, "WUZI", "CS_Dead_Guy", 4.0, 0, 0, 0, 0, 0); // Dead Crawling
  SendClientMessage(playerid, 0xFF000096, "you better call an ambulance!"); /* He've lost health! */
  	//ApplyAnimation(playerid, "SWEET", "Sweet_injuredloop", 4.0, 0, 0, 0, 0, 0); // Injured
  }

 
	}

	faPlayerHealth[playerid] = fHealth;
	}


	return 1;
	}
Reply


Messages In This Thread
OnPlayerInfoChange not working ? - by boelie - 25.07.2009, 10:33
Re: OnPlayerInfoChange not working ? - by yezizhu - 25.07.2009, 10:47
Re: OnPlayerInfoChange not working ? - by boelie - 25.07.2009, 10:51
Re: OnPlayerInfoChange not working ? - by yezizhu - 25.07.2009, 11:16
Re: OnPlayerInfoChange not working ? - by boelie - 25.07.2009, 11:25
Re: OnPlayerInfoChange not working ? - by paytas - 25.07.2009, 11:35
Re: OnPlayerInfoChange not working ? - by boelie - 26.07.2009, 11:42

Forum Jump:


Users browsing this thread: 1 Guest(s)