OnPlayerStateChange Help
#1

Ok im trying to do if player holds walk button he walks if he lets go of the button he stops

someone help? P.S everything is already defined

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (HOLDING(KEY_WALK))
{
if(UsesWalk[playerid] == 1)
{
ApplyAnimation(playerid,"ped","WALK_gang1",4.1,1,1,1,1,1);
}

else if (RELEASED(KEY_WALK))
{
//Stops Walking
}



}
	return 1;
}
Reply
#2

i think this is what your looking for: ClearAnimations(playerid);
Reply
#3

ClearAnimations doesnt work on moving animations like walking i tried
Reply
#4

Apply a new anim then clear it?
Reply
#5

Doesnt work because when i hold the walk button it plays the animation but when i let go still carrys playing on its maybe because its looped

Anyway i tried a easier way is like when you walk you use a command like a idle animation to stop but when i use it your frozed and i dont know what parametres to put for it so you can walk when uve used it

Код:
ApplyAnimation(playerid,"ped","Idle_Gang1",4.1,1,1,1,1,1);
Reply
#6

I'm not sure either, but there should be a way to stop looping anims :S..
Reply
#7

Damn what about the parameters part?
Reply
#8

LOL i didnt ask about fighting styles homie
Reply
#9

you cant fix nothing
Reply
#10

Read about the function: https://sampwiki.blast.hk/wiki/ApplyAnimation try setting the loop to 1 sec or somthn.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)