Liberty Unleashed
Scripting => Script Help => Topic started by: Kevin on February 10, 2013, 05:58:59 pm
-
how to count MESSAGES for example 3,2,1 race, now :'( :'( :'(
-
You Mean This
function onPlayerCommand( player, cmd, text )
{
if ( cmd == "start" )
{
NewTimer( "Start", 1000, 1);
}
}
function Start()
{
BigMessage( "~y~ race will start in 3", 1500, 3 );
NewTimer( "Start1", 2000, 1);
}
function Start1()
{
BigMessage( "~y~ race will start in 2", 1500, 3 );
NewTimer( "Start2", 2000, 1);
}
function Start2()
{
BigMessage( "~y~ race will start in 1", 1500, 3 );
NewTimer( "Start3", 2000, 1);
}
function Start3()
{
BigMessage( "~y~ Go Go Go ", 3000, 3 );
}
-
thank mipo_pop because help me
-
thanks Mido_Pop because help me
;) :)
-
Mido, maybe it would help if you put your code into the appropriate BB tag?
Also, I think having 3 different functions for this is a bit "much" and this only allows for 3 "ticks" before ending.
Something like this would work a little better in my opinion:
function CountdownTimer( delay, currenttick )
{
if( currenttick > 0 )
{
BigMessage( "~y~ Race will start in " + currenttick, delay, 3 );
currenttick--;
return NewTimer( "CountDownTimer", delay, 1, delay, currenttick );
}
else
{
return BigMessage( "~y~ Go Go Go", delay, 3 );
}
}
To use, just start a timer. The one shown below will start a 5 tick countdown, each count occuring after 1500 milliseconds (one and a half second):
NewTimer( "CountDownTimer", 1500, 1, 1500, 5 );
EDIT:
OR, just use the command to start without a delay:
CountDownTimer( 1500, 5 );
EDITED AGAIN:
I forgot to change the message for the "Go Go Go" part, it was shown as the actual counting message lulz).
-
teacher thank ;) ;) ;)
-
Nice Vortrex :-[ . :(