Problem with a loop
#1

Ok i got a timer which loops

and it makes if player is on foot he performs a animation

but after i get out of the animation it doesnt continue the loop with the timer

Код:
SetTimerEx("LazyWalk",200000,1,"d",playerid);//Start of the effect
Код:
public LazyWalk(playerid)
{
new playerState = GetPlayerState(playerid);
if(playerState == PLAYER_STATE_ONFOOT)
	{
ApplyAnimation(playerid,"ped","WALK_fatold",4.1,1,1,1,1,1);
	}
}]
Reply
#2

Can you explain more what you wanna to do?
Reply
#3

Your function gets called each 200 seconds meaning if you go out of the animation it will be applied again after at the latest 200 seconds. Suppose you just didn't wait long enough.
Reply
#4

Your loops set only to be 1 second long, if you want it to be continuous, change it to this.
Код:
ApplyAnimation(playerid,"ped","WALK_fatold",4.1,1,1,1,1,0);
Or change it to run however many milliseconds you want it to run, ex:
Код:
ApplyAnimation(playerid,"ped","WALK_fatold",4.1,1,1,1,1,200000);
And yeah your timer is running every 200 seconds, if you want it to run more often try changing it to a value like 10000 or 5000
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)