19.09.2011, 12:05
pawn Код:
new playerCounts[ MAX_PLAYERS ] = { 0, ... }, timer[ MAX_PLAYERS ];
public OnPlayerDisconnect( playerid, reason )
return KillTimer( timer[ playerid ] );
COMMAND:twominutes( playerid, params[ ] )
{
if ( playerCounts[ playerid ] > 0 ) return 0;
timer[ playerid ] = SetTimerEx( "TWO", 1000, true, "i", playerid );
return 1;
}
forward TWO( playerid );
public TWO( playerid )
{
playerCounts[ playerid ] ++;
if ( playerCounts[ playerid ] >= 200 )
{
playerCounts[ playerid ] = 0;
GameTextForPlayer( playerid, "~W~COUNT END", 1000, 3 );
KillTimer( timer[ playerid ] );
}
new txt[ 18 ];
format( txt, 30, "%d seconds left", 200 - playerCounts[ playerid ] );
// 200
GameTextForPlayer( playerid, txt, 1000, 3 );
return 1;
}
edit: fixed missing arguments