Help with anims - 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: Help with anims (
/showthread.php?tid=461768)
Help with anims -
eemalekorraks - 03.09.2013
Hello ladies and gent's I have currently made an animation called crack!
So currently only pressing RMB will get me out of the anim, how could I make it so every key would exit the anim?
Heres the code:
Код:
if (strcmp("/crack", cmdtext, true, 6) == 0) {
LoopingAnim(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
return 1;
Help is much apprecciated and rep for the helper.
Regards, Eemale
Re: Help with anims -
eemalekorraks - 03.09.2013
I still need help :P ... bump!
Re: Help with anims -
TonyII - 03.09.2013
pawn Код:
new bool:doingAnim[MAX_PLAYERS char];
//Under your animation cmd
doingAnim{playerid} = true;
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (newkeys & KEY_FIRE)
{
if (doingAnim{playerid})
{
ClearAnimations(playerid);
doingAnim{playerid} = false;
}
}
return 1;
}
EDIT:
If you want it to be RMB, just simply replace KEY_FIRE with KEY_AIM
Re: Help with anims -
eemalekorraks - 04.09.2013
Yes but is there a way or a callback for ALL KEYS?
So if ANY key on your keyboard is pressed it would cancel the anim.
Also when I do the anim it says "SPACE to stop the anim" textdraw how would I remove that?