Liberty Unleashed

Scripting => Script Help => Topic started by: Kevin on February 10, 2013, 05:58:59 pm

Title: help
Post by: Kevin on February 10, 2013, 05:58:59 pm
how to count MESSAGES for example 3,2,1 race, now :'( :'( :'(
Title: Re: help
Post by: Mido_Pop on February 10, 2013, 06:11:04 pm
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 );
}

Title: Re: help
Post by: Kevin on February 10, 2013, 06:29:47 pm
thank mipo_pop because help me
Title: Re: help
Post by: Mido_Pop on February 10, 2013, 06:36:56 pm
thanks Mido_Pop because help me

 ;)  :)
Title: Re: help
Post by: Vortrex on February 11, 2013, 01:09:15 am
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:
Code: [Select]
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):
Code: [Select]
NewTimer( "CountDownTimer", 1500, 1, 1500, 5 );

EDIT:
OR, just use the command to start without a delay:
Code: [Select]
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).
Title: Re: help
Post by: Kevin on February 12, 2013, 08:41:57 pm
teacher thank ;) ;) ;)
Title: Re: help
Post by: Mido_Pop on February 13, 2013, 06:37:27 pm
Nice Vortrex  :-[ . :(