Animations - 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)
+--- Thread: Animations (
/showthread.php?tid=299924)
Animations -
tliamg - 27.11.2011
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.
Re: Animations -
Jake__ - 27.11.2011
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;
}
Re: Animations -
MP2 - 27.11.2011
What.
https://sampwiki.blast.hk/wiki/GetPlayerAnimationIndex
Re: Animations -
Jake__ - 27.11.2011
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.