Timer issue - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Timer issue (
/showthread.php?tid=626690)
Timer issue -
AndreiWow - 18.01.2017
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);
Re: Timer issue -
Yaa - 18.01.2017
PHP код:
LegShott = SetTimerEx("LegShot", 12000, false, "i", playerid);
Re: Timer issue -
Luicy. - 18.01.2017
Quote:
Originally Posted by Yaa
PHP код:
LegShott = SetTimerEx("LegShot", 12000, false, "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
Re: Timer issue -
GoldenLion - 18.01.2017
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.
Re: Timer issue -
AndreiWow - 18.01.2017
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.
|
But it is 1..
Re: Timer issue -
GoldenLion - 18.01.2017
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.
Re: Timer issue -
AndreiWow - 18.01.2017
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
Re: Timer issue -
GoldenLion - 19.01.2017
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.