HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <geoip>
  4. #include <colorchat>
  5.  
  6. #define PLUGIN "Country Checker"
  7. #define VERSION "1.0"
  8. #define AUTHOR "undisputed"
  9.  
  10. new const allowed_country[][] = {
  11. //"Slovenia",
  12. //"United States",
  13. //"China",
  14. //"Russian Federation",
  15. //"Denmark",
  16. //"Iceland",
  17. //"Ireland",
  18. //"Latvia",
  19. //"Lithuania",
  20. //"Finland",
  21. //"Northern",
  22. //"Sweden",
  23. //"France",
  24. //"Netherlands",
  25. //"Albania",
  26. //"Croatia",
  27. //"Cyprus",
  28. //"Greece",
  29. //"Italy",
  30. //"Portugal",
  31. //"Spain",
  32. //"Belarus",
  33. //"Poland",
  34. //"Russia",
  35. //"Canada",
  36. //"Mexico",
  37. //"Cuba",
  38. //"Guatemala",
  39. //"Jamaica",
  40. //"Argentina",
  41. //"Bolivia",
  42. //"Brazil",
  43. //"Chile",
  44. //"Colombia",
  45. //"Ecuador",
  46. //"Paraguay",
  47. //"Peru",
  48. //"Uruguay",
  49. //"Venezuela",
  50. //"Georgia",
  51. //"Iran",
  52. //"Iraq",
  53. //"Israel",
  54. //"Jordan",
  55. //"Kuwait",
  56. //"Lebanon",
  57. //"Palestinian Territories",
  58. //"Saudi Arabia",
  59. //"Syria",
  60. //"Turkey",
  61. //"Yemen",
  62. //"Afghanistan",
  63. //"Bangladesh",
  64. //"India",
  65. //"Kazakhstan",
  66. //"Nepal",
  67. //"Pakistan",
  68. //"Sri Lanka",
  69. //"Japan",
  70. //"North Korea",
  71. //"South Korea",
  72. //"Taiwan",
  73. //"Cambodia",
  74. //"Indonesia",
  75. //"Laos",
  76. //"Malaysia",
  77. //"Myanmar",
  78. //"Philippines",
  79. //"Singapore",
  80. //"Thailand",
  81. //"Vietnam",
  82. //"Australia",
  83. //"Fiji",
  84. //"New Zealand",
  85. //"Algeria",
  86. //"Egypt",
  87. //"Ghana",
  88. //"Ivory Coast",
  89. //"Libya",
  90. //"Morocco",
  91. //"Nigeria",
  92. //"Tunisia",
  93. //"Ethiopia",
  94. //"Kenya",
  95. //"Somalia",
  96. //"Sudan",
  97. //"Tanzania",
  98. //"Uganda",
  99. //"Angola",
  100. //"Botswana",
  101. //"Madagascar",
  102. //"Mozambique",
  103. //"Namibia",
  104. //"South Africa",
  105. //"Zambia",
  106. //"Zimbabwe"
  107. "Ukraine",
  108. "Austria",
  109. "Serbia",
  110. "Slovakia",
  111. "Germany",
  112. "Romania",
  113. "Hungary"//A tömb utolsó eleme!
  114. }
  115.  
  116. public plugin_init()
  117. {
  118. register_plugin(PLUGIN, VERSION, AUTHOR)
  119. }
  120. public client_putinserver(id)
  121. {
  122. new steamid[35];
  123. get_user_authid(id,steamid,charsmax(steamid));
  124.  
  125. if(equal(steamid,"HLTV"))
  126. {
  127. //Ez az unban kód ellen hatásos.
  128. server_cmd("kick #%d ^"HLTV is disabled on this server.^"",get_user_userid(id));
  129. }
  130. else
  131. {
  132. new ip[32];
  133. get_user_ip(id,ip,charsmax(ip),1);
  134. if(!equal(ip,"127.0.0.1") && !is_user_bot(id))
  135. {
  136. new country[64],name[32],num=0;
  137. geoip_country(ip,country);
  138. get_user_name(id,name,charsmax(name));
  139. for(new i=0; i < sizeof(allowed_country); i++) {
  140. if(containi(country,allowed_country[i]) != -1) {
  141. num++;
  142. }
  143. }
  144. if(num == 0){
  145. server_cmd("kick #%d ^"Your country (%s) is disabled on this server.^"",get_user_userid(id),country);
  146. }
  147.  
  148. }
  149. }
  150. }
  151.