SA-MP Forums Archive
[HELP] Hold keys - 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: [HELP] Hold keys (/showthread.php?tid=223607)



[HELP] Hold keys - Daaviid - 09.02.2011

Hello everybody,

well, my question its how if player its holding SPRINT/SPACE, it apply sprint animation
and if he stop holding, it stop doing the animation.

I used:
if((newkeys & KEY_SPRINT))
{
ApplyAnimation(playerid,"PED","sprint_civi",4.1,1, 1,1,1,1,1);
}

And when i stop holding SPACE, the animation dont stop.

Thx,


Re: [HELP] Hold keys - Krx17 - 09.02.2011

Use an else statement under it with ClearAnimation.


Re: [HELP] Hold keys - Daaviid - 09.02.2011

Okay but the problem its, it apply the clearanimation when i press any buttons, so i cant climb objects.

Please, Any ideas?


Re: [HELP] Hold keys - Daaviid - 10.02.2011

Solved... i use

if (RELEASED( KEY_SPRINT ))
{
ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0);
}

Thanks anyway...