Countdown doesn't work correctly!
#4

Quote:
Originally Posted by Basicz
Посмотреть сообщение
I would do :

pawn Код:
new Count = 0, countTimer[ MAX_PLAYERS ];

forward Countdown( playerid );
public Countdown( playerid )
{
    new
        Float: Pos[ 3 ]
    ;

    GetPlayerPos( playerid, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ] );

    for ( new p = GetMaxPlayers( ), i; i < p; i ++ )
    {
        if ( !IsPlayerConnected( i ) )
            continue;

        if ( !IsPlayerInRangeOfPoint( i, 2.0, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ] ) )
            continue;

        if ( Count < 5 )
            Count ++;

        if ( Count == 5 )
            KillTimer( countTimer[ playerid ] ), GameTextForPlayer( i, "~r~GO GO GO!", 2500, 3 );

        new gametextFormat[ 5 ];

        format( gametextFormat, 5, "~r~%d", Count );

        GameTextForPlayer( i, gametextFormat, 2500, 3 );
    }

    return 1;
}

// Command

COMMAND:count( playerid, params[ ] )
{
    // Messages thingy

    Count = 0;

    countTimer[ playerid ] = SetTimerEx( "Countdown", 1000, true, "i", playerid );
 
    return 1;
}
EDIT: Added an area check
WTF O.o didn't undarstood anything but k, gotta try xD
Reply


Messages In This Thread
Countdown doesn't work correctly! - by [WSF]ThA_Devil - 04.09.2011, 09:46
AW: Countdown doesn't work correctly! - by Nero_3D - 04.09.2011, 09:55
Re: Countdown doesn't work correctly! - by Basicz - 04.09.2011, 09:59
Re: Countdown doesn't work correctly! - by [WSF]ThA_Devil - 04.09.2011, 10:01
Re: Countdown doesn't work correctly! - by Basicz - 04.09.2011, 10:05
Re: Countdown doesn't work correctly! - by [WSF]ThA_Devil - 04.09.2011, 10:07
Re: Countdown doesn't work correctly! - by iMonk3y - 04.09.2011, 10:07
Re: Countdown doesn't work correctly! - by [WSF]ThA_Devil - 04.09.2011, 10:16
Re: Countdown doesn't work correctly! - by Basicz - 04.09.2011, 10:16
Re: Countdown doesn't work correctly! - by [WSF]ThA_Devil - 04.09.2011, 10:50

Forum Jump:


Users browsing this thread: 1 Guest(s)