Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Plugin generated by AMXX-Studio */
- #include < amxmodx >
- new g_iTimer;
- public plugin_init( )
- {
- register_plugin( "Map Timeleft & Restart 10 Sec", "v1.0", "+ColdWar" );
- g_iTimer = 11;
- set_task( 5.0, "Countdown", 292 );
- register_saycmd( "timeleft", "ClCmd_TimeLeft" );
- }
- public ClCmd_TimeLeft( client )
- {
- new timeleft = get_timeleft( );
- new minutes, seconds;
- minutes = timeleft / 60;
- seconds = timeleft % 60;
- client_print( client, print_chat, "[AMXX] Timeleft untill restart - %i:%i", minutes, seconds );
- }
- public Countdown( TaskID )
- {
- g_iTimer--;
- if( g_iTimer )
- {
- set_hudmessage( 0, 85, 255, -1.0, 0.31, 0, 6.0, 12.0 );
- show_hudmessage( 0, "The game will restart in %i seconds.", g_iTimer )
- new szNumber[ 12 ];
- num_to_word( g_iTimer, szNumber, sizeof szNumber - 1 );
- client_cmd( 0, "spk ^"vox/%s^"", szNumber );
- set_task( 1.0, "Countdown", 292 );
- }
- else
- set_cvar_num( "sv_restart", 1 );
- }
- stock register_saycmd( const cmd[], const function[], flags = -1, const info[] = "", FlagManager = -1 )
- {
- new i, j;
- new szString[ 64 ];
- new const szSayTypes[ ][ ] = { "say", "say_team" };
- new const szTypes[ ][ ] = { "/", "!", "." }
- for( i = 0 ; i < sizeof szSayTypes ; i ++ )
- {
- for( j = 0 ; j < sizeof szTypes ; j ++ )
- {
- formatex( szString, sizeof szString - 1, "%s %s%s", szSayTypes[ i ], szTypes[ j ], cmd );
- register_clcmd( szString, function, flags, info, FlagManager );
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement