SHARE
TWEET

SMA WARMUP PUBZONE

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