[FilterScript] [FS] Simple Count Down - 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: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] [FS] Simple Count Down (
/showthread.php?tid=91884)
Re: [FS] Simple Count Down -
nenadninja - 19.12.2009
good job
Re: [FS] Simple Count Down -
Willstah - 21.12.2009
wheres the pastebin?
Re: [FS] Simple Count Down -
Striker_Moe - 21.12.2009
I dont understand all the people yelling "nice" in here.
This snippet is completely inefficent, its using 6 timers only for counting WHILE it could be done with one single timer. Meh.
Hereґs a example.
Code:
new counts;
forward timer1();
new counter1;
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/count", cmdtext, true, 10) == 0)
{
if(countspam[playerid]==0)
{
counts = 6;
counter1 = SetTimer("timer1",1000,true);
// SetTimer("countspam2",120000,0); Optional.
}
else
{
SendClientMessage(playerid,COLOR_BLUE, "Please wait before using this Command again.");
}
return 1;
}
return 0;
}
public timer1()
{
counts--;
if(counts == 5)
{
GameTextForAll("5",2000,3);
}
if(counts == 4)
{
GameTextForAll("4",2000,3);
}
if(counts == 3)
{
GameTextForAll("3",2000,3);
}
if(counts == 2)
{
GameTextForAll("2",2000,3);
}
if(counts == 1)
{
GameTextForAll("1",2000,3);
}
if(counts == 0)
{
GameTextForAll("~w~GO!",2000,3);
KillTimer(counter1);
}
return 1;
}
Clean, nice and efficent. And not using 6 timers.
Re: [FS] Simple Count Down -
braduz - 10.02.2010
Make sure it dont have the dreaded - glitch
e.g:
/countdown -10
forever countup untill you restart your server
Re: [FS] Simple Count Down -
caribe88 - 10.02.2010
nice

one suggestion could you to it with a timer that you can only use it every 5 seconds?? because some players abuse with it
Thanks
Re: [FS] Simple Count Down -
$t3ve - 09.10.2010
Ok, good. I've edited it that it works for the player chat box.
Re: [FS] Simple Count Down -
Toni - 09.10.2010
Good job. Want a cookie?! But seriously you just bumped a 8 month old topic.