SHARE
TWEET

WARMUP KNIFE SMA-BUN

a guest Jun 25th, 2019 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <amxmisc>
  5.  
  6. #define PLUGIN "Knife Warmup"
  7. #define VERSION "1.1"
  8. #define AUTHOR "CSGO.PUBZONE.RO"
  9.  
  10. #define TASKID 1234
  11.  
  12. new hudtimer, cvar, hudhandler, mp_freezetime, value
  13.  
  14. public plugin_init()
  15. {
  16.     register_plugin(PLUGIN, VERSION, AUTHOR)
  17.        
  18.     register_message(get_user_msgid("TextMsg") ,"message_TextMsg") 
  19.    
  20.     register_event("CurWeapon","switchweapon","be","1=1","2!29")
  21.    
  22.     cvar = register_cvar("warmup_timer", "60")
  23.    
  24.     hudhandler = CreateHudSyncObj()
  25. }
  26.  
  27. public plugin_cfg()
  28. {
  29.     mp_freezetime = get_cvar_pointer("mp_freezetime")
  30.    
  31.     set_task(10.0, "read_vars")
  32. }
  33.  
  34. public read_vars()
  35. {  
  36.     value = get_pcvar_num(mp_freezetime)
  37. }
  38.  
  39. public message_TextMsg(const MsgId, const MsgDest, const MsgEntity,id)
  40. {  
  41.     static message[64]
  42.     get_msg_arg_string(2, message, charsmax(message))
  43.    
  44.     if(equal(message, "#Game_Commencing"))
  45.     {
  46.         hudtimer = get_pcvar_num(cvar)
  47.        
  48.         if(hudtimer == -1)
  49.             return
  50.        
  51.         ChatColor(id, "!g[CSGO.PUBZONE.RO]- !nRunda de incalzire a inceput...!n!");
  52.         set_msg_arg_string(2, message)
  53.        
  54.         set_task(1.0, "restart", TASKID, _, _, "b")    
  55.         set_pcvar_num(mp_freezetime, 0)    
  56.     }
  57.     if(equal(message, "#Game_will_restart_in"))
  58.     {
  59.          ChatColor(id, "!g[CSGO.PUBZONE.RO]- !nRunda de incalzire sa terminat...!n!");
  60.     }
  61. }
  62.  
  63. public restart()
  64. {          
  65.     if(hudtimer <= 0)
  66.     {
  67.         remove_task(TASKID)
  68.         set_cvar_num("sv_restartround", 1)
  69.         set_pcvar_num(mp_freezetime, value)    
  70.     }
  71.     else
  72.     {
  73.         set_hudmessage(255,255,255,-1.0,0.9,0,6.0,1.0,0.1,0.2) 
  74.         ShowSyncHudMsg(0, hudhandler, "[Warmup se termina  in %i secunde ]", hudtimer)
  75.        
  76.     }  
  77.     hudtimer--
  78. }
  79.  
  80. public switchweapon(id)
  81. {
  82.     if(task_exists(TASKID))
  83.     {
  84.         engclient_cmd(id, "weapon_knife")
  85.     }
  86. }
  87. stock ChatColor(const id, const input[], any:...) {
  88.     new count = 1, players[32];
  89.     static msg[191];
  90.     vformat(msg, 190, input, 3);
  91.    
  92.     replace_all(msg, 190, "!g", "^4"); // verde
  93.     replace_all(msg, 190, "!n", "^1"); // galben/alb/negru
  94.     replace_all(msg, 190, "!t", "^3"); // rosu/albastru/gri
  95.     replace_all(msg, 190, "!t2", "^0"); // rosu2/albastru2/gri2
  96.    
  97.     if (id) players[0] = id; else get_players(players, count, "ch");
  98.     {
  99.         for (new i = 0; i < count; i++)
  100.             {
  101.             if (is_user_connected(players[i]))
  102.                 {
  103.                 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
  104.                 write_byte(players[i]);
  105.                 write_string(msg);
  106.                 message_end();
  107.             }
  108.         }
  109.     }
  110. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top