12.10.2015, 14:07
Quote:
|
But I need to make like a callback that will be called every time player swings a melee weapon. If I used it with let's say OnPlayerUpdate and check player animation, it would spam the callback as long as the animation is running
|
I mean, a player can't swing a bat without hitting KEY_FIRE, he has to. So, you can do something like:
pawn Код:
OnPlayerKeyStateChange(playerid, oldkeys, newkeys)
{
if(PRESSED(KEY_FIRE)) {
if(GetPlayerAnimationIndex(playerid) > 0) {
//...


