SA-MP Forums Archive
Please need help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Please need help (/showthread.php?tid=139249)



Please need help - AdrianX9 - 04.04.2010

I need a code for when a player get < 20 health he falls (i have the animation) and says a message: Necesitas ayuda

Please help help help


Re: Please need help - pmk1 - 04.04.2010

something like that: EDIT: sorry i didn't finish yet lol i posted by accident

Код:
//this under defines---------------------------------------------------------------------------
new gPlayerUsingLoopingAnim[MAX_PLAYERS];

LoopingAnim(playerid,animlib[],animname[], Float:Speed, looping, lockx, locky, lockz, lp)
{
  gPlayerUsingLoopingAnim[playerid] = 1;
  ApplyAnimation(playerid, animlib, animname, Speed, looping, lockx, locky, lockz, lp);
}
//-------------------------------------------------------------------------------------------

public OnPlayerUpdate(playerid)
{
  new Float:health;

  GetPlayerHealth(playerid,health);
  if (health < 20.0)
  {
  new string[256];
  LoopingAnim(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); // nice anim for this, but change it if you like.
  format(string, sizeof(string), "~p~ Necesitas ayuda!"); // color is purple
  GameTextForPlayer(playerid, string, 3000, 5); // 3000 is 3 second and 5 is the writiing style
  TogglePlayerControllable(playerid, false);

  return 1;
  }

	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	if(gPlayerUsingLoopingAnim[playerid]) {
		gPlayerUsingLoopingAnim[playerid] = 0;
	}

 	return 1;
}
i didn't test it though, tell me if it works. But i think you must do it as a filterscript


Re: Please need help - pmk1 - 04.04.2010

ok i tested it with a friend and it worked, you could only have a bug with the animation that you don't see it, but people around you see it. and while performing animation you can't kill the guy on the floor, so ask someone if they're able to do something so you can kill people on floor. You can still make a timer, so after 5 sec if the player on floor is not healed, he dies and the one who shot him to the floor still get the point. Oh and hey, you'll need a heal command, i let this job for you hehe


Re: Please need help - AdrianX9 - 04.04.2010

Ok thanks, i am coding with timer...etc
Thanks for the code


Re: Please need help - pmk1 - 04.04.2010

np


Re: Please need help - AdrianX9 - 04.04.2010

Ok nice but have a problem...

The message dont stop...
I need the message saw only once...
Please can you help me?


Re: Please need help - pmk1 - 04.04.2010

hmm i'll see but don't you prefer that it shows a coulpe of times be4 the guy dies?