hlmod.hu
https://hlmod.hu/

admin
https://hlmod.hu/viewtopic.php?f=29&t=17818
Oldal: 1 / 1

Szerző:  longhorn [2014.10.29. 19:19 ]
Hozzászólás témája:  admin

nekem olyan plugin kéne, ha 1 játékos leakarja kérni az online adminokat a /admin parancssal, akkor csak a saját játékosnevüket dobja ki, mint online admin :D

Szerző:  babapiskóta.~ [2014.10.29. 20:20 ]
Hozzászólás témája:  Re: admin

tessséééék:D :
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2.  
  3. /*---------------EDIT ME------------------*/
  4. #define ADMIN_CHECK ADMIN_KICK
  5.  
  6. static const COLOR[] = "^x04" //green
  7. static const CONTACT[] = ""
  8. /*----------------------------------------*/
  9.  
  10. new maxplayers
  11. new gmsgSayText
  12.  
  13. public plugin_init() {
  14. register_plugin("Admin Check", "1.51", "OneEyed")
  15. maxplayers = get_maxplayers()
  16. gmsgSayText = get_user_msgid("SayText")
  17. register_clcmd("say", "handle_say")
  18. register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)
  19. }
  20.  
  21. public handle_say(id) {
  22. new said[192]
  23. read_args(said,192)
  24. if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/admin") != -1 )
  25. set_task(0.1,"print_adminlist",id)
  26. return PLUGIN_CONTINUE
  27. }
  28.  
  29. public print_adminlist(user)
  30. {
  31. new adminnames[33][32]
  32. new message[256]
  33. new contactinfo[256], contact[112]
  34. new id, count, x, len
  35.  
  36. for(id = 1 ; id <= maxplayers ; id++)
  37. if(is_user_connected(id))
  38. if(get_user_flags(id) & ADMIN_CHECK)
  39. get_user_name(id, adminnames[count++], 31)
  40.  
  41. len = format(message, 255, "%s ",COLOR)
  42. if(count > 0) {
  43. for(x = 0 ; x < count ; x++) {
  44. len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
  45. if(len > 96 ) {
  46. print_message(user, message)
  47. len = format(message, 255, "%s ",COLOR)
  48. }
  49. }
  50. print_message(user, message)
  51. }
  52. else {
  53. len += format(message[len], 255-len, "Nincs online admin.")
  54. print_message(user, message)
  55. }
  56.  
  57. get_cvar_string("amx_contactinfo", contact, 63)
  58. if(contact[0]) {
  59. format(contactinfo, 111, "%s Admin elérés: %s", COLOR, contact)
  60. print_message(user, contactinfo)
  61. }
  62. }
  63.  
  64. print_message(id, msg[]) {
  65. message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
  66. write_byte(id)
  67. write_string(msg)
  68. message_end()
  69. }
  70.  

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/