Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //--------------------------------------------------------------------------------//
- #include <amxmodx>
- #include <fun>
- //--------------------------------------------------------------------------------//
- new roundcounter = 1 // Counts the rounds
- new playercounter = 0 // How much players are in the server
- new alrstarted = 0 // Check if round is already started
- //float: cvar_setroundtime // Sets the Round time
- //--------------------------------------------------------------------------------//
- public plugin_init()
- {
- register_plugin( "HLrounds", "1.0", "Sniper ll Mp3" )
- register_clcmd("sayteam /spec","hdead")
- register_cvar("amx_setroundtime", "50.0")
- set_task( 10.0, "StatusCheck", 0, "", 0, "b" )
- }
- //--------------------------------------------------------------------------------//
- public StatusCheck(id)
- {
- if(playercounter >= 2 && alrstarted == 0)
- {
- //client_print(id,print_chat,"Players = %d [Enaugh players starting the game...]",playercounter)
- set_hudmessage(0, 255, 0, -1.0, 0.37, 0, 6.0, 12.0)
- show_hudmessage(id, "[Round %d Started]",roundcounter)
- alrstarted = 1
- set_task( get_cvar_float("amx_setroundtime") - 13.0, "TaskCommands1")
- set_task( get_cvar_float("amx_setroundtime") - 12.0, "TaskCommands2")
- set_task( get_cvar_float("amx_setroundtime") - 11.0, "TaskCommands3")
- set_task( get_cvar_float("amx_setroundtime") - 10.0, "TaskCommands4")
- set_task( get_cvar_float("amx_setroundtime") - 9.0, "TaskCommands5")
- set_task( get_cvar_float("amx_setroundtime") - 8.0, "TaskCommands6")
- set_task( get_cvar_float("amx_setroundtime") - 5.0, "TaskCommands7")
- set_task( get_cvar_float("amx_setroundtime") - 4.0, "TaskCommands8")
- set_task( get_cvar_float("amx_setroundtime") - 3.0, "TaskCommands9")
- set_task( get_cvar_float("amx_setroundtime") - 2.0, "TaskCommands10")
- set_task( get_cvar_float("amx_setroundtime") - 1.0, "TaskCommands11")
- set_task( get_cvar_float("amx_setroundtime"), "TaskCommands12")
- }
- if(playercounter < 2)
- {
- client_print(0,print_chat,"[Waiting for more players]")
- }
- }
- public client_putinserver(id)
- {
- playercounter += 1
- }
- public client_disconnect(id)
- {
- playercounter -= 1
- }
- public hdead(id)
- {
- console_cmd(id,"spectate")
- }
- public TaskCommands6( id )
- {
- client_cmd( id, "sayteam /spec" )
- }
- public TaskCommands1( id )
- {
- client_print(id,print_chat,"Round ends in 5 seconds...")
- }
- public TaskCommands2( id )
- {
- client_print(id,print_chat,"Round ends in 4 seconds...")
- }
- public TaskCommands3( id )
- {
- client_print(id,print_chat,"Round ends in 3 seconds...")
- }
- public TaskCommands4( id )
- {
- client_print(id,print_chat,"Round ends in 2 seconds...")
- }
- public TaskCommands5( id )
- {
- client_print(id,print_chat,"Round ends in 1 second...")
- }
- public TaskCommands7( id )
- {
- set_hudmessage(0, 255, 0, -1.0, 0.37, 0, 6.0, 12.0)
- show_hudmessage(id, "[Round %d Ended]",roundcounter)
- client_print(id,print_chat,"New Round starts in 5 second...")
- }
- public TaskCommands8( id )
- {
- client_print(id,print_chat,"New Round starts in 4 second...")
- }
- public TaskCommands9( id )
- {
- client_print(id,print_chat,"New Round starts in 3 second...")
- }
- public TaskCommands10( id )
- {
- client_print(id,print_chat,"New Round starts in 2 second...")
- }
- public TaskCommands11( id )
- {
- client_print(id,print_chat,"New Round starts in 1 second...")
- }
- public TaskCommands12( id )
- {
- client_cmd( id, "sayteam /spec" )
- alrstarted = 0
- roundcounter += 1
- }
- //--------------------------------------------------------------------------------//
Add Comment
Please, Sign In to add comment