Advertisement
CheezPuff

Humans Kill Count v1.0

May 9th, 2017
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.40 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <cstrike>
  5. #include <hamsandwich>
  6. #include <colorchat>
  7.  
  8. #define PLUGIN "Counter-Terrorists Kill Count"
  9. #define AUTHOR "CheezPuff"
  10.  
  11. #define KILL    25
  12. #define TASK_HUD 1994
  13.  
  14. new g_iKillCount[33]
  15.  
  16. public plugin_init()
  17. {
  18.     register_plugin(PLUGIN, "v1.0", AUTHOR)
  19.    
  20.     register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0")
  21.    
  22.     RegisterHam(Ham_Spawn, "player", "fw_PlayerRespawn", 1)
  23.     RegisterHam(Ham_Killed, "player", "fw_PlayerKilled", 1)
  24. }
  25.  
  26. public client_disconnect(id) // if you running server with lastest amx version 1.9.0 change this line - client_disconnect -> client_disconnected
  27. {
  28.     g_iKillCount[ id ] = 0;
  29. }
  30.  
  31. public Event_NewRound()
  32.     arrayset(g_iKillCount, 0, sizeof g_iKillCount)
  33.  
  34. public fw_PlayerRespawn(id)
  35. {
  36.     if(is_user_alive(id))
  37.     {
  38.         set_task(1.0, "KillHud", id+TASK_HUD, _, _, "b")
  39.     }
  40. }
  41.  
  42. public KillHud(id)
  43. {
  44.     id -= TASK_HUD
  45.    
  46.     if(is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT)
  47.     {
  48.         if(g_iKillCount[id] <= 15)
  49.         {
  50.             new PlayerInfoHud = CreateHudSyncObj()
  51.            
  52.             //set_hudmessage(255, 0, 0, 0.28, 0.86, 0, 6.0, 12.0)
  53.             //show_hudmessage(id, "")
  54.            
  55.             set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.86, 0, 3.0, 6.0, 0.0, 0.0, -1)
  56.             ShowSyncHudMsg(id, PlayerInfoHud,"Killed zombies: %d/15", g_iKillCount[id])
  57.         }
  58.     }
  59.     else
  60.     {
  61.         remove_task(id+TASK_HUD)
  62.     }
  63. }
  64.  
  65. public fw_PlayerKilled(iVictim, iKiller)  
  66. {
  67.     if (!is_user_alive(iKiller) || iVictim == iKiller) // בדיקה עם התוקף חי
  68.         return
  69.    
  70.     if(get_user_team(iKiller) == 2)
  71.     {
  72.         g_iKillCount[iKiller]++
  73.        
  74.         if(g_iKillCount[iKiller] == 15)
  75.         {
  76.             set_hudmessage(random_num(10,255), random(256), random(256), -1.0, 0.20, 0, 3.0, 6.0, 0.0, 0.0, -1)
  77.             show_hudmessage(iKiller, "You Reach 15/%d Kills of Zombie, Next round you will be in CT team", KILL)
  78.            
  79.             show_hudmessage(0, "%s killed 15 zombies and moved to CT team", szName( iKiller ))
  80.            
  81.             ColorChat(iKiller, NORMAL, "^4[Base Builder] ^1You Reach 15/15 Kills of Zombie, you stay as Humans next Round");
  82.             ColorChat(0, NORMAL,"^4[Base Builder] ^3%s^1 killed 15 zombies and moved to CT team", szName( iKiller ))
  83.            
  84.             cs_set_user_team( iKiller, CS_TEAM_CT );
  85.             ExecuteHamB( Ham_Spawn, iKiller );
  86.         }
  87.     }
  88. }
  89.  
  90. stock szName( const index )
  91. {
  92.     static szName[ 32 ];
  93.    
  94.     get_user_name( index, szName, charsmax( szName ) );
  95.    
  96.     return szName;
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement