What I made a time ago. I guess it's still working:
PHP код:
SetAnimationForWeapon(playerid, weaponid, crounch=false) // ApplyAnimation(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync);
{
switch(weaponid)
{
case 22:
{
if(crounch) ApplyAnimation(playerid, "COLT45", "python_crouchreload", 4.1, 0, 0, 0, -1, 1, 1);
else ApplyAnimation(playerid, "COLT45", "colt45_reload", 4.1, 0, 0, 0, -1, 1, 1);
}
case 23:
{
if(crounch) ApplyAnimation(playerid, "SILENCED", "CrouchReload", 4.1, 0, 0, 0, -1, 1, 1);
else ApplyAnimation(playerid, "SILENCED", "Silence_reload", 4.1, 0, 0, 0, -1, 1, 1);
}
case 24:
{
if(crounch) ApplyAnimation(playerid, "PYTHON", "python_crouchreload", 4.1, 0, 0, 0, -1, 1, 1);
else ApplyAnimation(playerid, "PYTHON", "python_reload", 4.1, 0, 0, 0, -1, 1, 1);
}
case 25, 27:
{
if(crounch) ApplyAnimation(playerid, "BUDDY", "buddy_crouchreload", 4.1, 0, 0, 0, -1, 1, 1);
else ApplyAnimation(playerid, "BUDDY", "buddy_reload", 4.1, 0, 0, 0, -1, 1, 1);
}
case 26:
{
if(crounch) ApplyAnimation(playerid, "COLT45", "colt45_crouchreload", 4.1, 0, 0, 0, -1, 1, 1);
else ApplyAnimation(playerid, "COLT45", "colt45_reload", 4.1, 0, 0, 0, -1, 1, 1);
}
case 29..31, 33, 34:
{
if(crounch) ApplyAnimation(playerid, "RIFLE", "RIFLE_crouchload", 4.1, 0, 0, 0, -1, 1, 1);
else ApplyAnimation(playerid, "RIFLE", "rifle_load", 4.1, 0, 0, 0, -1, 1, 1);
}
case 28, 32:
{
if(crounch) ApplyAnimation(playerid, "TEC", "TEC_crouchreload", 4.1, 0, 0, 0, -1, 1, 1);
else ApplyAnimation(playerid, "TEC", "tec_reload", 4.1, 0, 0, 0, -1, 1, 1);
}
default : return 1;
}
return 1;
}
IsCrounching(playerid) return (GetPlayerAnimationIndex(playerid) == 1159 || GetPlayerAnimationIndex(playerid) == 1274 ? true : false);