30.12.2016, 00:25
Hello. I'm having troubles with animations.
I pre-load all the animation libraries using this:
https://sampforum.blast.hk/showthread.php?tid=568189
Then, when I execute an ApplyAnimation, not works at all. I have a taser and bean bullet system, and I've to apply the animation when the player gets in touch with the bullet. Here is the code:
First time the Animation is not applied. Sometimes I can see the animation playing during 1 second or less...
Second, the player who gets the damage stays on foot, no animation is applied.
Anyone can help me? Thanks!
I pre-load all the animation libraries using this:
https://sampforum.blast.hk/showthread.php?tid=568189
Then, when I execute an ApplyAnimation, not works at all. I have a taser and bean bullet system, and I've to apply the animation when the player gets in touch with the bullet. Here is the code:
Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) { if (hittype == BULLET_HIT_TYPE_PLAYER) { if(PlayerInfo[playerid][pFaction] == 1 && Beans[playerid] == 1 && weaponid == 25) { if(Freezed[hitid] == 0) { ClearAnimations(hitid); ApplyAnimation(hitid, "SWEET", "LaFin_Sweet", 4.1, 0, 1, 1, 1, 0); TogglePlayerControllable(hitid, 0); Freezed[hitid] = 1; SetTimerEx("BeansBullet", 10000, false, "i", hitid); } return 0; } else if(Taser[playerid] == 1 && GetPlayerWeapon(playerid) == 23) { if(Tased[hitid] == 1) return 1; new Float:x, Float:y, Float:z; GetPlayerPos(hitid, x, y, z); ClearAnimations(hitid); ApplyAnimation(hitid, "PED", "KO_skid_front",4.1,0,1,1,1,0); SetTimerEx("RemoveTaserEffects", 5000, 0, "i", hitid); TogglePlayerControllable(hitid, 0); Tased[hitid] = 1; return 0; } } return 1; }
Second, the player who gets the damage stays on foot, no animation is applied.
Anyone can help me? Thanks!