Timer issue
#1

Sorry for so many questions but I am trying to learn, why isn't this working?

Код:
LegShott = SetTimerEx("LegShot", 12000, true, "i", playerid);
Код:
forward LegShot(playerid);
public LegShot(playerid)
{
    ApplyAnimation(playerid, "PED", "FALL_COLLAPSE", 4.0, 0, 1, 1, 0, 1050, 1);
    //SetTimerEx("LegShotUn", 500, false, "i", playerid);
	return 1;
}
KillTimer(LegShott);
Reply
#2

PHP код:
LegShott SetTimerEx("LegShot"12000false"i"playerid); 
Reply
#3

Quote:
Originally Posted by Yaa
Посмотреть сообщение
PHP код:
LegShott SetTimerEx("LegShot"12000false"i"playerid); 
Mhm... Just.. omfg........


OP:
What's not working? If it's the animation.
Make the forcesync variable in ApplyAnimation to 1,
https://sampwiki.blast.hk/wiki/ApplyAnimation
Reply
#4

What you should do is make the "LegShott" an array with a size of MAX_PLAYERS like this:
Код:
new LegShott[MAX_PLAYERS];
And do
Код:
LegShott[playerid] = SetTimerEx...
Also you can remove the time (that 1050 thing) from the animation as it's not needed. Everything else seems to be OK though.
Reply
#5

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
What you should do is make the "LegShott" an array with a size of MAX_PLAYERS like this:
Код:
new LegShott[MAX_PLAYERS];
And do
Код:
LegShott[playerid] = SetTimerEx...
Also you can remove the time (that 1050 thing) from the animation as it's not needed. Everything else seems to be OK though.
Yes, it is needed because it won't work otherwise..



Quote:
Originally Posted by Luicy.
Посмотреть сообщение
Mhm... Just.. omfg........


OP:
What's not working? If it's the animation.
Make the forcesync variable in ApplyAnimation to 1,
https://sampwiki.blast.hk/wiki/ApplyAnimation
But it is 1..
Reply
#6

Quote:
Originally Posted by AndreiWow
Посмотреть сообщение
Yes, it is needed because it won't work otherwise..
No, you don't need it. The time could also end the animation too early. It will play the animation once without the time.
Reply
#7

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
No, you don't need it. The time could also end the animation too early. It will play the animation once without the time.
I had 1 instead of 1050 and the anim wasnt playing
Reply
#8

Quote:
Originally Posted by AndreiWow
Посмотреть сообщение
I had 1 instead of 1050 and the anim wasnt playing
Yes, because you set the time to 1 millisecond so it instantly stops the animation.
Go here: https://sampwiki.blast.hk/wiki/ApplyAnimation and check what the wiki says about the time parameter.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)