HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /********************************************************************************
  2.  * *
  3.  * Impulse 101 blocker for AMXX *
  4.  * ============================ *
  5.  * *
  6.  * Version 0.1 - Last modified on 13th January, 2009. *
  7.  * Plugin by Adam Reece, http://www.reece-eu.net/ *
  8.  * *
  9.  * Thanks to all the regulars at #amxmodx (GameSurge) for their bug support <3 *
  10.  * *
  11.  ********************************************************************************
  12.  * *
  13.  * This plugin will block players using the 'impulse 101' command while cheat *
  14.  * mode (sv_cheats 1) is off. Currently, 'impulse 101' wrongly works on Sven *
  15.  * Co-op 4 regardless of cheat mode being on or off, leading to map exploits. *
  16.  * *
  17.  ********************************************************************************/
  18.  
  19. /* Includes */
  20.  
  21. #include <amxmodx>
  22. #include <amxmisc>
  23. #include <engine>
  24.  
  25.  
  26. /* Plugin Information */
  27.  
  28. #define PLUGIN_NAME "Impulse 101 Blocker"
  29. #define PLUGIN_SHORT "Impulse 101 Blocker"
  30. #define PLUGIN_VER "0.1"
  31.  
  32.  
  33. /* Messages */
  34.  
  35. #define MSG_I101_BLOCKED "Nem hasznalhatod az 'impulse 101' a cheat mod kivan kapcsolva."
  36. #define MSG_I101_BLOCKED_ADMINS "Egy admin blokkolta az 'impulse 101' cheat parancsot."
  37.  
  38.  
  39. /* Globals */
  40.  
  41. new p_cheatMode
  42.  
  43.  
  44. /* Functions */
  45.  
  46. public plugin_init()
  47. {
  48. register_plugin(PLUGIN_SHORT, PLUGIN_VER, "Adam Reece")
  49.  
  50. register_impulse(101, "block")
  51.  
  52. p_cheatMode = register_cvar("sv_cheats", "0")
  53. }
  54.  
  55. public block(id, level, cid)
  56. {
  57. if (get_pcvar_num(p_cheatMode) == 0)
  58. {
  59. new name[32]
  60. new authID[36]
  61.  
  62. get_user_name(id, name, 31)
  63. get_user_authid(id, authID, 35)
  64.  
  65. client_print(id, print_chat, "%s", MSG_I101_BLOCKED)
  66. log_message("%s: %s %s (%s).", PLUGIN_NAME, MSG_I101_BLOCKED_ADMINS, name, authID)
  67.  
  68. for (new i = 0; i < get_playersnum(); i++)
  69. {
  70. if (is_user_admin(i) && i != id)
  71. client_print(i, print_chat, "%s: %s %s (%s).", PLUGIN_NAME, MSG_I101_BLOCKED_ADMINS, name, authID)
  72. }
  73.  
  74. return PLUGIN_HANDLED
  75. }
  76.  
  77. return PLUGIN_CONTINUE
  78. }
  79.