hlmod.hu
https://hlmod.hu/

/admin paranccsal írja ki chatbe az adminokat
https://hlmod.hu/viewtopic.php?f=9&t=23044
Oldal: 1 / 1

Szerző:  ReC0iiL [2015.12.17. 19:37 ]
Hozzászólás témája:  /admin paranccsal írja ki chatbe az adminokat

ha /admin beírom akkor írja ki chatbe az adminokat és tudjam színezni a chat szöveget olyan kéne köszönöm..

Szerző:  kengurumancs [2015.12.17. 19:56 ]
Hozzászólás témája:  Re: /admin paranccsal írja ki chatbe az adminokat

  1. #define ADMIN_CHECK ADMIN_KICK
  2. #define prefix [........]
  3.  
  4. static const COLOR[] = "^x04" //green
  5. static const COLOR_TEAM[] = "^x03" //csapat szin
  6. static const COLOR_YELLOW[] = "^x01" //sarga
  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. }
  19.  
  20. public handle_say(id) {
  21.     new said[192]
  22.     read_args(said,192)
  23.     if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/admin") != -1 )
  24.         set_task(0.1,"print_adminlist",id)
  25.     return PLUGIN_CONTINUE
  26. }
  27.  
  28. public print_adminlist(user)
  29. {
  30.     new adminnames[33][32]
  31.     new message[256]
  32.     new id, count, x, len
  33.  
  34.     for(id = 1 ; id <= maxplayers ; id++)
  35.         if(is_user_connected(id))
  36.             if(get_user_flags(id) & ADMIN_CHECK)
  37.                 get_user_name(id, adminnames[count++], 31)
  38.  
  39.     len = format(message, 255, "%s Jelenlevo adminok: ",COLOR)
  40.     if(count > 0) {
  41.         for(x = 0 ; x < count ; x++) {
  42.             len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
  43.             if(len > 96 ) {
  44.                 print_message(prefix, user, message)
  45.                 len = format(message, 255, "%s ",COLOR_TEAM)
  46.             }
  47.         }
  48.         print_message(user, message)
  49.     }
  50.     else {
  51.         len += format(message[len], 255-len, "Nincs jelen admin.")
  52.         print_message(prefix, user, message)
  53.     }
  54.  
  55. }
  56.  
  57. print_message(id, msg[]) {
  58.     message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
  59.     write_byte(id)
  60.     write_string(msg)
  61.     message_end()
  62. }

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