HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /* AMXX Mod script.
  2. *
  3. *
  4. * Client List v.1.1 by KoMeHDaHT.
  5. *
  6. *
  7. * Description:
  8. * Prints in console numbers and names of the players with their IP-adress, Steam-ID, current ping.
  9. * Players may get the client list even in spectator mode.
  10. *
  11. * CVARS:
  12. * No CVars for this plugin.
  13. *
  14. */
  15.  
  16.  
  17. #include <amxmodx>
  18. #include <amxmisc>
  19.  
  20. public plugin_init()
  21. {
  22. register_plugin("Client List", "1.1", "KoMeHDaHT")
  23. register_concmd("amx_showlist", "client_list", -1, "- Gets client list")
  24. }
  25.  
  26. public client_list(id,level,cid)
  27. {
  28. if (!cmd_access(id,level,cid,1))
  29. return PLUGIN_HANDLED
  30.  
  31. new authid[35], user_ip[32], name[32], user_ping, user_loss, text[64], bot_ping[32]
  32.  
  33. new maxplayers = get_maxplayers()
  34.  
  35. console_print(id, "Client List:^n# NEV IP AUTHID PING")
  36.  
  37. for(new j=1; j <= maxplayers; j++)
  38. {
  39. if(is_user_connected(j))
  40. {
  41. get_user_name(j, name, 31)
  42. get_user_ip(j, user_ip, 31, 1)
  43. get_user_authid(j, authid, 34)
  44. get_user_ping(j, user_ping, user_loss)
  45. if(is_user_bot(j))
  46. {
  47. user_ip = "SERVER_IP_LAN"
  48. authid = "NONE"
  49. bot_ping = "BOT"
  50. format(text, 63, "%2d %-18s %-14s %-10s %-8d", j, name, user_ip, authid, bot_ping)
  51. }
  52. else
  53. {
  54. format(text, 63, "%2d %-18s %-14s %-10s %-8d", j, name, user_ip, authid, user_ping)
  55. }
  56. console_print(id, text)
  57. }
  58. }
  59. return PLUGIN_CONTINUE
  60. }