Help crouched animation
#1

I trying to make a reload system... But i got a problem...
I take all reload animations, but the crouched animation is not working fine...
When player use the crouched animation he wake up!

Why? Whats i made worng?


Code example:
PHP код:
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK) { ApplyAnimation (playerid "PYTHON" "python_crouchreload" 4.0 500); }
else { 
ApplyAnimation (playerid "PYTHON" "python_reload" 4.0 500); } 
Reply
#2

It's supposed to be like that. You can't play an animation while you are crouched, playing any animation will make you stand up I guess.
Reply
#3

There is no way to use this crouch animation with no get up?
Reply
#4

Yeah.
Reply
#5

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
Yeah.
Are u sure? One time i saw a server where was animations with no get up...
Reply
#6

That anim was probably started when player was standing and it setted him in crouching position..
Reply
#7

What I made a time ago. I guess it's still working:
PHP код:
SetAnimationForWeapon(playeridweaponidcrounch=false// ApplyAnimation(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync);
{
     switch(
weaponid)
     {
           case 
22:
        {
            if(
crounchApplyAnimation(playerid"COLT45""python_crouchreload"4.1000, -111);
            else 
ApplyAnimation(playerid"COLT45""colt45_reload"4.1000, -111);
        }
        case 
23:
        {
            if(
crounchApplyAnimation(playerid"SILENCED""CrouchReload"4.1000, -111);
            else 
ApplyAnimation(playerid"SILENCED""Silence_reload"4.1000, -111);
        }
        case 
24:
        {
            if(
crounchApplyAnimation(playerid"PYTHON""python_crouchreload"4.1000, -111);
            else 
ApplyAnimation(playerid"PYTHON""python_reload"4.1000, -111);
        }
        case 
2527:
        {
            if(
crounchApplyAnimation(playerid"BUDDY""buddy_crouchreload"4.1000, -111);
            else 
ApplyAnimation(playerid"BUDDY""buddy_reload"4.1000, -111);
        }
        case 
26:
        {
            if(
crounchApplyAnimation(playerid"COLT45""colt45_crouchreload"4.1000, -111);
            else 
ApplyAnimation(playerid"COLT45""colt45_reload"4.1000, -111);
        }
        case 
29..313334:
        {
            if(
crounchApplyAnimation(playerid"RIFLE""RIFLE_crouchload"4.1000, -111);
            else 
ApplyAnimation(playerid"RIFLE""rifle_load"4.1000, -111);
        }
        case 
2832:
        {
            if(
crounchApplyAnimation(playerid"TEC""TEC_crouchreload"4.1000, -111);
            else 
ApplyAnimation(playerid"TEC""tec_reload"4.1000, -111);
        }
        default : return 
1;
    }
    return 
1;
}
IsCrounching(playerid) return (GetPlayerAnimationIndex(playerid) == 1159 || GetPlayerAnimationIndex(playerid) == 1274 true false); 
Reply
#8

Quote:
Originally Posted by Micko123
Посмотреть сообщение
That anim was probably started when player was standing and it setted him in crouching position..
Maybe thats the point...
I've tried it

Код:
forward ReloadWeaponAnim(playerid, gun); public ReloadWeaponAnim(playerid, gun) {
	if(gun == 24) {
		if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK) {
			ApplyAnimation (playerid , "PYTHON" , "python_crouchreload" , 4.0 , 0 , 0 , 0 , 0 , 500);
			SetTimerEx("Sentar", 500, 0, "i", playerid);
		}
		else { ApplyAnimation (playerid , "PYTHON" , "python_reload" , 4.0 , 0 , 0 , 0 , 0 , 500); }
	}
Код:
forward Sentar(playerid); public Sentar(playerid) {
	SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DUCK);
}
But not work...

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
What I made a time ago. I guess it's still working:
PHP код:
SetAnimationForWeapon(playeridweaponidcrounch=false// ApplyAnimation(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync);
{
     switch(
weaponid)
     {
           case 
22:
        {
            if(
crounchApplyAnimation(playerid"COLT45""python_crouchreload"4.1000, -111);
            else 
ApplyAnimation(playerid"COLT45""colt45_reload"4.1000, -111);
        }
        case 
23:
        {
            if(
crounchApplyAnimation(playerid"SILENCED""CrouchReload"4.1000, -111);
            else 
ApplyAnimation(playerid"SILENCED""Silence_reload"4.1000, -111);
        }
        case 
24:
        {
            if(
crounchApplyAnimation(playerid"PYTHON""python_crouchreload"4.1000, -111);
            else 
ApplyAnimation(playerid"PYTHON""python_reload"4.1000, -111);
        }
        case 
2527:
        {
            if(
crounchApplyAnimation(playerid"BUDDY""buddy_crouchreload"4.1000, -111);
            else 
ApplyAnimation(playerid"BUDDY""buddy_reload"4.1000, -111);
        }
        case 
26:
        {
            if(
crounchApplyAnimation(playerid"COLT45""colt45_crouchreload"4.1000, -111);
            else 
ApplyAnimation(playerid"COLT45""colt45_reload"4.1000, -111);
        }
        case 
29..313334:
        {
            if(
crounchApplyAnimation(playerid"RIFLE""RIFLE_crouchload"4.1000, -111);
            else 
ApplyAnimation(playerid"RIFLE""rifle_load"4.1000, -111);
        }
        case 
2832:
        {
            if(
crounchApplyAnimation(playerid"TEC""TEC_crouchreload"4.1000, -111);
            else 
ApplyAnimation(playerid"TEC""tec_reload"4.1000, -111);
        }
        default : return 
1;
    }
    return 
1;
}
IsCrounching(playerid) return (GetPlayerAnimationIndex(playerid) == 1159 || GetPlayerAnimationIndex(playerid) == 1274 true false); 
Same problem bro, using your anims after reload player get up
Reply
#9

After reload? What do you mean?
Remove animation after reloading?
PHP код:
forward noAnim(playerid);
public 
noAnim(playerid)
{
    if(
IsCrounching(playerid)) ApplyAnimation(playerid"PED""GUNCROUCHFWD"4.1000011);
    else 
ApplyAnimation(playerid"CARRY""crry_prtial"4.1000011);
    return 
1;

Reply
#10

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
After reload? What do you mean?
Remove animation after reloading?
PHP код:
forward noAnim(playerid);
public 
noAnim(playerid)
{
    if(
IsCrounching(playerid)) ApplyAnimation(playerid"PED""GUNCROUCHFWD"4.1000011);
    else 
ApplyAnimation(playerid"CARRY""crry_prtial"4.1000011);
    return 
1;

I'm sorry to this long time, i was with no computer...

If I use this:
Код:
		    if(IsCrounching(playerid)) 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);
In a command (with no aim, shotting, only a command to reload, stopped)
It's work fine

But if player is aim,shotting and end the bullets...
Player make a anim to fast, i even can see that, reload weapon too fast

If I use this:
Код:
		case 24:
		{
			if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK) { ApplyAnimation (playerid , "PYTHON" , "python_crouchreload" , 4.0 , 0 , 0 , 0 , 0 , 500); }
			else { ApplyAnimation (playerid , "PYTHON" , "python_reload" , 4.0 , 0 , 0 , 0 , 0 , 500); }
		}
In a command and when end the bullets (when aim/shotting) player use the animation crouched and after finish, player get up :O
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)