Probably a little better. I don't like using set_task().
Code:
#include <amxmodx>
#define MIN_PLAYERS 10
#define MAX_PLAYERS 32
#define LOOP_TIME 2.0
public plugin_init()
{
register_plugin( "Waiting players", "1.0", "Amxx Community" );
set_task( LOOP_TIME, "DisplayHUD", 0, _, _, "b" );
}
public DisplayHUD()
{
switch( get_playersnum() )
{
case 1 .. MIN_PLAYERS - 1 :
{
set_hudmessage( 0, 255, 0, 0.1, 0.5, 0, 6.0, 5.0, 0.1, 0.1, -1 );
show_hudmessage( 0, "! Waiting for other players..." );
}
case MIN_PLAYERS :
{
set_hudmessage(0, 255, 0, 0.1, 0.5, 0, 6.0, 5.0, 0.1, 0.1, -1 );
show_hudmessage( 0, "! Enough players has joined.Match started...");
}
case MIN_PLAYERS + 1 .. MAX_PLAYERS :
{
set_hudmessage(0, 255, 0, 0.1, 0.5, 0, 6.0, 5.0, 0.1, 0.1, -1 );
show_hudmessage( 0, "! Too many players on server...");
}
default : return;
}
}