HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /* Plugin generated by AMXX-Studio */
  2. //credits to Hawk552 for helping me, and getting the plugin 2 work (THX MAN :D:D)
  3.  
  4. #include <amxmodx>
  5. #include <amxmisc>
  6. #include <fun>
  7.  
  8. #define PLUGIN "Kill X Times"
  9. #define VERSION "1.0a"
  10. #define AUTHOR "Doombringer"
  11.  
  12. public plugin_init()
  13. {
  14. register_plugin(PLUGIN, VERSION, AUTHOR)
  15. register_concmd("amx_kill", "killplayer", ADMIN_SLAY, "<nev> [hanyszor]")
  16. }
  17.  
  18. public killplayer(id, level, cid)
  19. {
  20. if (!cmd_access(id, level, cid, 2))
  21. return PLUGIN_HANDLED
  22.  
  23. new arg[32],Times[32]
  24.  
  25. read_argv(1, arg, 31)
  26.  
  27. new player = cmd_target(id, arg, 4)
  28.  
  29. read_argv(2, Times, 31)
  30.  
  31. new Xtimes = str_to_num(Times)
  32.  
  33. if (!player)
  34. return PLUGIN_HANDLED
  35.  
  36. kill(player,Xtimes) // added by Hawk552
  37.  
  38. client_print(player,print_chat,"[AMXX] Te megleszel ölve %s alkalommal!",Xtimes)
  39.  
  40. return PLUGIN_HANDLED
  41. }
  42.  
  43. /* --------- Hawk552 START --------- */
  44.  
  45. public kill(id,times)
  46. {
  47. new Float:count
  48. for(count = 0.1;count <= times;count++)
  49. {
  50. set_task(count,"slayplayer",id)
  51. set_task(count+1,"spawnplayer",id)
  52. }
  53. }
  54.  
  55. public slayplayer(id)
  56. {
  57. user_kill(id);
  58. }
  59.  
  60. public spawnplayer(id)
  61. {
  62. set_task(0.5,"spawn_user",id)
  63. set_task(0.7,"spawn_user",id)
  64.  
  65. set_task(0.9,"give_stuff",id)
  66. }
  67.  
  68. public spawn_user(id)
  69. {
  70. spawn(id)
  71. }
  72.  
  73. public give_stuff(id)
  74. {
  75. if(is_running("cstrike"))
  76. {
  77. give_item(id,"item_suit")
  78. give_item(id,"weapon_knife")
  79. }
  80. else
  81. return PLUGIN_CONTINUE
  82. }
  83. /* -------- Hawk552 END --------- */