Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include < amxmodx >
- #define PLUGIN "AutoRRound"
- #define VERSION "1.2"
- #define AUTHOR "syRex"
- #define HUD_MESSAGES
- #define MAX_COUNT 1
- new g_Count
- public plugin_precache() precache_generic("sound/autorestart/sunet.mp3");
- public plugin_init()
- {
- register_plugin( PLUGIN, VERSION, AUTHOR )
- register_event( "TextMsg", "event_gamecomencing", "a", "2&#Game_C" )
- register_event( "HLTV", "event_newround", "a", "1=0","2=0" )
- state START_FUNCTION
- }
- public event_gamecomencing() g_Count = 0
- public event_newround() < BLOCK_FUNCTION > { }
- public event_newround() < START_FUNCTION >
- {
- if(g_Count++ == MAX_COUNT) {
- server_cmd("sv_restart 1");
- new Players[32], Num;
- get_players(Players, Num);
- new iSeconds = 2;
- new x = clamp((iSeconds * (1<<12)), 0, 0xFFFF);
- for(new i = 0; i < Num; i++)
- {
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), _, Players[i]);
- write_short(x);
- write_short(x);
- write_short(0x0001);
- write_byte(0);
- write_byte(127);
- write_byte(255);
- write_byte(255);
- message_end();
- SendCMD("mp3 play sound/autorestart/sunet.mp3", Players[i]);
- }
- #if defined HUD_MESSAGES
- set_task(1.0, "show_messages");
- #endif
- state BLOCK_FUNCTION
- }
- }
- public show_messages() {
- Print(0, "^x04Live^x01 #^x04 Live^x01 #^x04 Live^x01 #^x04 Live");
- new Players = get_playersnum();
- new Max = get_maxplayers();
- Print(0, "^x04[Auto Restart]^x01 We have^x03 %d^x01 /^x03 %d^x01 players", Players, Max);
- new map[32];
- get_mapname(map, charsmax(map));
- Print(0, "^x04[Auto Restart]^x01 We're playing on^x03 %s", map);
- Print(0, "^x04Live^x01 #^x04 Live^x01 #^x04 Live^x01 #^x04 Live");
- }
- stock SendCMD(const text[], Player=0)
- {
- message_begin(MSG_ONE, 51, _, Player);
- write_byte(strlen(text) + 2);
- write_byte(10);
- write_string(text);
- message_end();
- }
- stock Print(const id, const input[], any:...) {
- new count = 1, players[32];
- static msg[191];
- vformat(msg, 190, input, 3);
- if(id) players[0] = id;
- else get_players(players, count, "ch"); {
- for(new i = 0; i < count; i++) {
- if(is_user_connected(players[i])) {
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
- write_byte(players[i]);
- write_string(msg);
- message_end();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement