Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  knife-firs.-ound.amxx
Language: C/C++
Code:
#include <amxmodx>



#define PLUGIN "WarmUp Round"

#define VERSION "1.0"

#define AUTHOR "Alka"



new bool:WarmUp;

new Seconds = 60;



public plugin_init() {

     

     register_plugin(PLUGIN, VERSION, AUTHOR);

     

     register_event("CurWeapon", "Current_Weapon", "be", "1=1", "2!29");

     

     WarmUp = true;

     

     set_task(60.0, "RemoveWarmUp", 123);

     set_task(1.0, "ShowCountDown", 1234,_,_,"b",_);

}



public Current_Weapon(id)

{

     if(WarmUp)

     {

          engclient_cmd(id, "weapon_knife");

     }

}



public ShowCountDown()

{

     set_hudmessage(255, 255, 255, -1.0, -1.0, 0, 6.0, 1.0, 0.1, 0.1, 2);

     show_hudmessage(0, "WarmUp Round: %d seconds left.", Seconds);

     

     Seconds--;

     

     if(Seconds <= 0)

     {

          if(task_exists(1234))

               remove_task(1234);

          

          server_cmd("sv_restart 1");

          return;

     }

}



public RemoveWarmUp()

     WarmUp = false;
Comments: