[Half-Life AMXX] / adminchat.sma Repository:
ViewVC logotype

Diff of /adminchat.sma

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 17, Fri Nov 16 15:29:57 2007 UTC revision 44, Mon Oct 11 23:53:51 2010 UTC
# Line 44  Line 44 
44  new Float:g_Pos[4][] = {{0.0, 0.0}, {0.05, 0.55}, {-1.0, 0.2}, {-1.0, 0.7}}  new Float:g_Pos[4][] = {{0.0, 0.0}, {0.05, 0.55}, {-1.0, 0.2}, {-1.0, 0.7}}
45    
46  new amx_show_activity;  new amx_show_activity;
47    new g_AdminChatFlag = ADMIN_CHAT;
48    
49  public plugin_init()  public plugin_init()
50  {  {
51            new admin_chat_id
52    
53          register_plugin("Admin Chat", AMXX_VERSION_STR, "AMXX Dev Team")          register_plugin("Admin Chat", AMXX_VERSION_STR, "AMXX Dev Team")
54          register_dictionary("adminchat.txt")          register_dictionary("adminchat.txt")
55          register_dictionary("common.txt")          register_dictionary("common.txt")
56          register_clcmd("say", "cmdSayChat", ADMIN_CHAT, "@[@|@|@][w|r|g|b|y|m|c]<text> - displays hud message")          register_clcmd("say", "cmdSayChat", ADMIN_CHAT, "@[@|@|@][w|r|g|b|y|m|c]<text> - displays hud message")
57          register_clcmd("say_team", "cmdSayAdmin", 0, "@<text> - displays message to admins")          register_clcmd("say_team", "cmdSayAdmin", 0, "@<text> - displays message to admins")
58          register_concmd("amx_say", "cmdSay", ADMIN_CHAT, "<message> - sends message to all players")          register_concmd("amx_say", "cmdSay", ADMIN_CHAT, "<message> - sends message to all players")
59          register_concmd("amx_chat", "cmdChat", ADMIN_CHAT, "<message> - sends message to admins")          admin_chat_id = register_concmd("amx_chat", "cmdChat", ADMIN_CHAT, "<message> - sends message to admins")
60          register_concmd("amx_psay", "cmdPsay", ADMIN_CHAT, "<name or #userid> <message> - sends private message")          register_concmd("amx_psay", "cmdPsay", ADMIN_CHAT, "<name or #userid> <message> - sends private message")
61          register_concmd("amx_tsay", "cmdTsay", ADMIN_CHAT, "<color> <message> - sends left side hud message to all players")          register_concmd("amx_tsay", "cmdTsay", ADMIN_CHAT, "<color> <message> - sends left side hud message to all players")
62          register_concmd("amx_csay", "cmdTsay", ADMIN_CHAT, "<color> <message> - sends center hud message to all players")          register_concmd("amx_csay", "cmdTsay", ADMIN_CHAT, "<color> <message> - sends center hud message to all players")
# Line 63  Line 67 
67          {          {
68                  amx_show_activity = register_cvar("amx_show_activity", "2");                  amx_show_activity = register_cvar("amx_show_activity", "2");
69          }          }
70    
71            new str[1]
72            get_concmd(admin_chat_id, str, 0, g_AdminChatFlag, str, 0, -1)
73  }  }
74    
75  public cmdSayChat(id)  public cmdSayChat(id)
76  {  {
77          if (!access(id, ADMIN_CHAT))          if (!access(id, g_AdminChatFlag))
78          {          {
79                  return PLUGIN_CONTINUE                  return PLUGIN_CONTINUE
80          }          }
# Line 198  Line 205 
205          for (new i = 0; i < inum; ++i)          for (new i = 0; i < inum; ++i)
206          {          {
207                  // dont print the message to the client that used the cmd if he has ADMIN_CHAT to avoid double printing                  // dont print the message to the client that used the cmd if he has ADMIN_CHAT to avoid double printing
208                  if (players[i] != id && get_user_flags(players[i]) & ADMIN_CHAT)                  if (players[i] != id && get_user_flags(players[i]) & g_AdminChatFlag)
209                          client_print(players[i], print_chat, "%s", message)                          client_print(players[i], print_chat, "%s", message)
210          }          }
211    
# Line 229  Line 236 
236    
237          for (new i = 0; i < inum; ++i)          for (new i = 0; i < inum; ++i)
238          {          {
239                  if (access(players[i], ADMIN_CHAT))                  if (access(players[i], g_AdminChatFlag))
240                          client_print(players[i], print_chat, "%s", message)                          client_print(players[i], print_chat, "%s", message)
241          }          }
242    

Legend:
Removed from v.17  
changed lines
  Added in v.44

Contact
ViewVC Help
Powered by ViewVC 1.0.4