SHARE
TWEET

Untitled

a guest Jun 25th, 2019 56 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. #include <hamsandwich>
  6.  
  7. #define TASKID 1234
  8.  
  9. new hudtimer, cvar, hudhandler, mp_freezetime, value
  10. new
  11. gcv_warmup_respawn,
  12. gcv_warmup_respawn_delay;
  13.        
  14. public plugin_init()
  15. {
  16.     gcv_warmup_respawn       = register_cvar("warmup_respawn",       "0"  );
  17.     gcv_warmup_respawn_delay = register_cvar("warmup_respawn_delay", "0.2");
  18.        
  19.     register_message(get_user_msgid("TextMsg") ,"message_TextMsg") 
  20.    
  21.     register_event("CurWeapon","switchweapon","be","1=1","2!29")
  22.    
  23.     cvar = register_cvar("warmup_timer", "60")
  24.    
  25.     hudhandler = CreateHudSyncObj()
  26. }
  27.  
  28. public plugin_cfg()
  29. {
  30.     mp_freezetime = get_cvar_pointer("mp_freezetime")
  31.    
  32.     set_task(10.0, "read_vars")
  33. }
  34.  
  35. public read_vars()
  36. {  
  37.     value = get_pcvar_num(mp_freezetime)
  38. }
  39.  
  40. public message_TextMsg(const MsgId, const MsgDest, const MsgEntity,id)
  41. {  
  42.     static message[64]
  43.     get_msg_arg_string(2, message, charsmax(message))
  44.    
  45.     if(equal(message, "#Game_Commencing"))
  46.     {
  47.         hudtimer = get_pcvar_num(cvar)
  48.        
  49.         if(hudtimer == -1)
  50.             return
  51.        
  52.         ChatColor(id, "!g[CSGO.PUBZONE.RO]- !nRunda de incalzire a inceput...!n!");
  53.         set_msg_arg_string(2, message)
  54.        
  55.         set_task(1.0, "restart", TASKID, _, _, "b")    
  56.         set_pcvar_num(mp_freezetime, 0)    
  57.     }
  58.     if(equal(message, "#Game_will_restart_in"))
  59.     {
  60.          ChatColor(id, "!g[CSGO.PUBZONE.RO]- !nRunda de incalzire sa terminat...!n!");
  61.     }
  62. }
  63.  
  64. public restart()
  65. {          
  66.     if(hudtimer <= 0)
  67.     {
  68.         remove_task(TASKID)
  69.         set_cvar_num("sv_restartround", 1)
  70.         set_pcvar_num(mp_freezetime, value)    
  71.     }
  72.     else
  73.     {
  74.         set_hudmessage(255,255,255,-1.0,0.9,0,6.0,1.0,0.1,0.2) 
  75.         ShowSyncHudMsg(0, hudhandler, "[Warump se termina  in %i secunde ]", hudtimer)
  76.        
  77.     }  
  78.     hudtimer--
  79. }
  80.  
  81. public switchweapon(id)
  82. {
  83.     if(task_exists(TASKID))
  84.     {
  85.         engclient_cmd(id, "weapon_knife")
  86.     }
  87. }
  88. public forward_ham_player_killed_pre(victim)
  89. {
  90.     if (get_pcvar_num(gcv_warmup_respawn))
  91.     {
  92.         set_task(get_pcvar_float(gcv_warmup_respawn_delay), "respawn_player", victim);
  93.     }
  94.     return PLUGIN_CONTINUE;
  95. }
  96.  
  97. public respawn_player(id)
  98. {
  99.     ExecuteHam(Ham_CS_RoundRespawn, id);
  100. }
  101. stock ChatColor(const id, const input[], any:...) {
  102.     new count = 1, players[32];
  103.     static msg[191];
  104.     vformat(msg, 190, input, 3);
  105.    
  106.     replace_all(msg, 190, "!g", "^4"); // verde
  107.     replace_all(msg, 190, "!n", "^1"); // galben/alb/negru
  108.     replace_all(msg, 190, "!t", "^3"); // rosu/albastru/gri
  109.     replace_all(msg, 190, "!t2", "^0"); // rosu2/albastru2/gri2
  110.    
  111.     if (id) players[0] = id; else get_players(players, count, "ch");
  112.     {
  113.         for (new i = 0; i < count; i++)
  114.             {
  115.             if (is_user_connected(players[i]))
  116.                 {
  117.                 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
  118.                 write_byte(players[i]);
  119.                 write_string(msg);
  120.                 message_end();
  121.             }
  122.         }
  123.     }
  124. }
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