timer textdraw?
#1

hey

is there any FS, tut or anything else with a timer textdraw? (so that you can see the time counting down..)

yeah..

is there one?
AND I HAVE SEARCHED
for 10 secs :P
Reply
#2

Better use gametext for that one.
Here's the one I use:

pawn Код:
//global
new
    g_tiCD,
    g_iCD = 5;
new
    bool:g_bCDStarted = false,
pawn Код:
//timer
public CountDown()
{
    GameTextForAll( "~r~Get ready!", 2000, 6 );
    g_iCD--;
    switch( g_iCD )
    {
        case 0:
        {
            GameTextForAll( "~g~GO!", 4000, 6 );
            PlaySoundForAll( 1057 );
            g_iCD = 5;
            KillTimer( g_tiCD );
            g_bCDStarted = false;
        }
        case 1:
        {
            GameTextForAll( "~w~1..", 950, 6 );
            PlaySoundForAll( 1056 );
        }
        case 2:
        {
            GameTextForAll( "~w~2..", 950, 6 );
            PlaySoundForAll( 1056 );
        }
        case 3:
        {
            GameTextForAll( "~w~3..", 950, 6 );
            PlaySoundForAll( 1056 );
        }
    }
}
pawn Код:
//command
CMD:cd(playerid, params[])
{
    if( g_bCDStarted )
        SendClientMessage( playerid, 0xFF0000ff, "**[ERROR] A countdown is already in progress." );
    else
    {
        g_tiCD = SetTimer( "CountDown", 1000, true );
        g_bCDStarted = true;
    }

    return true;
}
ZCMD is needed btw.

For strcmp:

pawn Код:
//command
if( !strcmp( cmdtext, "/cd", true ))
{
    if( g_bCDStarted )
        SendClientMessage( playerid, 0xFF0000ff, "**[ERROR] A countdown is already in progress." );
    else
    {
        g_tiCD = SetTimer( "CountDown", 1000, true );
        g_bCDStarted = true;
    }
    return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)