Animations
#1

Hi, I need a function that checks whether the player is set to animation ApplyAnimation (playerid, "KISSING" , "Playa_Kiss_01", 4.1, 1, 0, 0, 0, 0), and if this is some kind of message is displayed and if it's not.

I've done this:

Код:
  new a = ApplyAnimation(playerid,"KISSING","Playa_Kiss_01", 4.1, 1, 0, 0, 0, 0);
			  if(a == 0)
			  {
                // NOTHING HAPPENS
     }
			  else{
			SendClientMessage(playerid, COLOR_GRAD2, "  test!");
			}
But does not work: (
Please help.
Reply
#2

Try this. Should work for you.

Код:
#include <a_samp>
#include <CMD>
#define SetPVarInt(%0,%1,0); DeletePVar(%0,%1);

main() // I added this here just for testing purposes.
{
	return 1;
}


CMD:animation(playerid, params[]) // You may change to STRCMP. I prefer using this.
{
	ApplyAnimation(playerid,"KISSING","Playa_Kiss_01", 4.1, 1, 0, 0, 0, 0);
	SendClientMessage(playerid, changeme, "You've applied the animation sucessfully.");
	SetPVarInt(playerid, "anim", 1); // Set the player variable to check if one has applied the animation
	if(GetPVarInt(playerid, "anim") == 0) // Checking pvariables
	{
	   	StopLoopingAnim(playerid);
	}
	else
	{
		SendClientMessage(playerid, changeme, "Test!");
	}
	return 1;
}
Reply
#3

What.

https://sampwiki.blast.hk/wiki/GetPlayerAnimationIndex
Reply
#4

Quote:
Originally Posted by MP2
Посмотреть сообщение
I have never seen that function.
Thanks for linking that. I don't typically use the wiki for functions, so I appreciate that for future reference.
That really is a lot easier than using pvariables, lol.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)