HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <hamsandwich>
  3.  
  4. #define PLUGIN "Anti Start-Kill"
  5. #define VERSION "1.0"
  6. #define AUTHOR "vato loco [GE-S]"
  7.  
  8. #define is_valid_player(%1) (1 <= %1 <= 32)
  9.  
  10. new g_sp_protect_on
  11. new g_sp_time
  12. new bool:g_bSpawnProtect
  13. new bool:g_bMapToProtect
  14.  
  15. public plugin_init()
  16. {
  17. register_plugin(PLUGIN, VERSION, AUTHOR)
  18. check_map()
  19.  
  20. g_sp_protect_on = register_cvar("sk_protect_on","1")
  21. g_sp_time = register_cvar("sk_protect_time", "2")
  22.  
  23. register_logevent("StartProtect", 2, "1=Round_Start")
  24. RegisterHam(Ham_TakeDamage, "player", "fw_HamTakeDamage",1)
  25. }
  26.  
  27. public check_map()
  28. {
  29. new MapName[32]
  30. get_mapname(MapName,31)
  31. if(containi(MapName,"aim_") != -1 || containi(MapName,"fy_") != -1 || containi(MapName,"awp_") != -1 || containi(MapName,"surf_") != -1)
  32. g_bMapToProtect = true
  33.  
  34. return PLUGIN_CONTINUE
  35. }
  36.  
  37. public StartProtect()
  38. {
  39. if(get_pcvar_num(g_sp_protect_on) && g_bMapToProtect)
  40. {
  41. g_bSpawnProtect = true
  42. set_task(get_pcvar_float(g_sp_time), "RemoveProtect")
  43. }
  44. }
  45.  
  46. public RemoveProtect()
  47. {
  48. g_bSpawnProtect = false
  49. }
  50.  
  51. public fw_HamTakeDamage(iVictim, iInflictor, iAttacker, Float:fDamage, iDamageType)
  52. {
  53. if (is_valid_player(iVictim) && g_bSpawnProtect)
  54. {
  55. new userID = get_user_userid(iAttacker)
  56. server_cmd("kick #%d ^"A Start Kill (SK) nem megengedett a szerveren! ^"", userID)
  57. }
  58. return HAM_IGNORED
  59. }