HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /*
  2. * Plugin: Continent Players
  3. * Version: 1.1
  4. * Author: RaZzoR
  5. *
  6. * Copyright © 2013, RaZzoR. All rights reserved!
  7. *
  8. * Requied Module: GeoIP Extended
  9. * LINK: https://forums.alliedmods.net/showthread.php?t=95665&highlight=geoip
  10. *
  11. * ==============================================
  12. *
  13. * Cvar: CP_Continent "EU"
  14. *
  15. * AF - Africa
  16. * AS - Asia
  17. * EU - Europe
  18. * NA - North America
  19. * OC - Oceania
  20. * SA - South America
  21. *
  22. */
  23.  
  24. #include <amxmodx>
  25. #include <amxmisc>
  26. #include <geoip>
  27.  
  28. new continent_cvar
  29.  
  30. public plugin_init()
  31. {
  32. register_plugin("Continent Players", "1.1", "RaZzoR")
  33. continent_cvar = register_cvar("CP_Continent", "EU")
  34. }
  35.  
  36. public client_connect(id)
  37. {
  38. new ip[32], authid[32], ContinentCode[3]
  39.  
  40. get_user_ip(id, ip, charsmax(ip), 1)
  41. geoip_continent_code(ip, ContinentCode)
  42. get_user_authid(id, authid, charsmax(authid))
  43.  
  44. new cvar[24]
  45. get_pcvar_string(continent_cvar, cvar, charsmax(cvar))
  46.  
  47. if(!equali(ContinentCode, "cvar"))
  48. server_cmd("kick %s ^"Your Continent NOT ALLOWED on THIS Server (%s)^"", authid, ContinentCode)
  49. }