Raised This Month: $51 Target: $400
 12% 

Std Admin Color Chat


Post New Thread Reply   
 
Thread Tools Display Modes
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 07-12-2005 , 15:19  
Reply With Quote #21

Oh, it's an abbreviation for "Standard". I see.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Bento
SourceMod Donor
Join Date: May 2005
Location: The Netherlands
Old 07-15-2005 , 11:13  
Reply With Quote #22

Can someone make this also with amx_say ????
__________________
Bento is offline
vandercal
Member
Join Date: Apr 2004
Location: Sweden
Old 07-15-2005 , 17:00  
Reply With Quote #23

New!! Version 1.1.0

amx_say command included due to request.

Cheers!
Martin
__________________
vandercal is offline
Cereal.Killer
Senior Member
Join Date: Jul 2004
Old 07-16-2005 , 07:06  
Reply With Quote #24

Bug Check:

Previous colored chat related plugins have had this, please let me know if you found a way around this:

Colored chat for teams, (Blue for CT, red for T) for both Team_say and say - Neither was logged by HLSW, in the sense of, the text cannot be read by it. Supposedly the chat is still logged into the SERVER logs.. but... Im not going to go into the server logs just to read the last 10-20 lines of chat..

Do you know if your chat is still logged? and/or visible by HLSW? - I know that HLSW already reads all admin commands in green.

Secondary note: if your plugin does indeed allow logging of all the chat, could you add on colors for the teams chat? (blue for CT, red for T) that would also still be logged by HLSW? (There is another plugin that does this, but does not allow HLSW text logging)

Thank you for your time.
Cereal.Killer is offline
vandercal
Member
Join Date: Apr 2004
Location: Sweden
Old 07-16-2005 , 08:09  
Reply With Quote #25

Quote:
Originally Posted by Cereal.Killer
Bug Check:

Previous colored chat related plugins have had this, please let me know if you found a way around this:

Colored chat for teams, (Blue for CT, red for T) for both Team_say and say - Neither was logged by HLSW, in the sense of, the text cannot be read by it. Supposedly the chat is still logged into the SERVER logs.. but... Im not going to go into the server logs just to read the last 10-20 lines of chat..

Do you know if your chat is still logged? and/or visible by HLSW? - I know that HLSW already reads all admin commands in green.
My plugin logs the chat the same way adminchat.amxx does and have been tested with HLSW. It even says it works in the first post ( ).

Quote:
Originally Posted by Cereal.Killer
Secondary note: if your plugin does indeed allow logging of all the chat, could you add on colors for the teams chat? (blue for CT, red for T) that would also still be logged by HLSW? (There is another plugin that does this, but does not allow HLSW text logging)
Not sure what you mean and my plugins doesnt have anything to do with the teams chatting around. Be more specific and dont forget to read the first post in the first page before posting.
__________________
vandercal is offline
Cereal.Killer
Senior Member
Join Date: Jul 2004
Old 07-16-2005 , 09:58  
Reply With Quote #26

Stupid changelog.. always stuff in there I miss.. forum puts it in a weird font for me.. sometimes I gloss over it

Anyway, regarding the second part there.. Im not sure how much more clear I can be..

I said, IF said plugin (Your plugin) does indeed LOG CORRECTLY TO HLSW (Which it does), THEN, can you add the capability of coloring NORMAL say and team_say chat, to players respective teams.

I then made a reference to another plugin, which DOES have colored team chat (Red for all T speak, and blue for all CT speak), but his plugin fails to log to HLSW.

I hope this clears that up.
Cereal.Killer is offline
Bento
SourceMod Donor
Join Date: May 2005
Location: The Netherlands
Old 07-16-2005 , 12:48  
Reply With Quote #27

Quote:
Originally Posted by vandercal
New!! Version 1.1.0

amx_say command included due to request.

Cheers!
Martin

WOHOO U ROCK!
__________________
Bento is offline
vandercal
Member
Join Date: Apr 2004
Location: Sweden
Old 07-16-2005 , 14:42  
Reply With Quote #28

Quote:
Originally Posted by Cereal.Killer
I said, IF said plugin (Your plugin) does indeed LOG CORRECTLY TO HLSW (Which it does), THEN, can you add the capability of coloring NORMAL say and team_say chat, to players respective teams.
Actually I dont have to. Since I dont touch the ordinary team_say or say it get logged automatically. This error you refer to happens only if you want to handle those messages. To be specific, I handle messages with 1 '@' or '#' as the first character. every other messages as say and team_say will work as it should.

I have also tested this in HLSW and team_say and say works as it should in there. I am running a CS 1.6 Server with amxmodx 1.01.

Hope this answers your question.
/ Martin
__________________
vandercal is offline
Bento
SourceMod Donor
Join Date: May 2005
Location: The Netherlands
Old 07-16-2005 , 15:18  
Reply With Quote #29

I tried to make it like amx_say was like before.. it was like:

(ADMIN) Theadminnamehere : the message

It compiled good, but ingame it only displays: (ADMIN) -=|RMK|=- Punani [NL] :

But theres no message.. plz help

Code:
//*************************************************************** //* Standard Admin Color Chat v. 1.1.0 for AMXX     * //* by Martin J. Van der Cal        * //*            * //* Standard admin chat in color       * //*            * //* Copyright (C) 2005, Martin J. Van der Cal                    * //* This plugin is under the GNU General Public License, read        * //* "Std Admin Color Chat Readme.doc" for further information.      * //*            * //* std_admin_color_chat.sma       * //*            * //*************************************************************** #include <amxmodx> #define MAX_MESSAGE_CHARS      256 #define MAX_COMMAND_CHARS      10 #define CHAR_RECOGNITION        '@'  // What character we look for when we decide if the message should go to the admins #define PM_RECOGNITION      '#'      // Character to look for when sending PMs // Error Codes #define TOO_MANY_MATCHED        -1 #define NONE_MATCHED            -2 // Future dictionary constants #define TELL_ADMIN_TEXT   "tells admins: " // the sender name will be before this text #define PM_TELL_TEXT            " PMs you: "        // the sender name will be before this text #define PM_SENDER_TEXT      "You PM "   // reciever name will come after this text #define TELL_ALL_TEXT         " : "    // the sender name will be before this text #define BEFORE_TELL_ALL_TEXT        "(ADMIN) "    // The prefix of amx_say new gmsgSayText public plugin_init() {     register_plugin("Std Admin Color Chat", "1.1.0", "Van der Cal")     register_clcmd("say",      "SayHandler",    ADMIN_CHAT, "# <name or #userid> <message> - Sends a PM")     register_clcmd("say_team""SayTeamHandler"0,         "@ <message> - Displays message to admins")         register_concmd("amx_say""ConCmdACCSay",      ADMIN_CHAT,    "<message> - Displays message to all players")     register_concmd("amx_psay""ConCmdACCPM",      ADMIN_CHAT,    "# <name or #userid> <message> - Sends a PM");     register_concmd("amx_chat""ConCmdACCAdmins",   ADMIN_CHAT,    "<message> - Displays message to admins");     //register_dictionary("std_admin_color_chat.txt") // Dictionary for this plugin (in TODO stage)         gmsgSayText = get_user_msgid("SayText") } // Runs if anything is said in say public SayHandler(iPlayerID) {     new sTemp[MAX_MESSAGE_CHARS]     new sMessage[MAX_MESSAGE_CHARS]     new sCmd[MAX_COMMAND_CHARS]     read_argv(1, sTemp, MAX_MESSAGE_CHARS - 1)         // if the player has admin chat rights     if ( get_user_flags(iPlayerID) & ADMIN_CHAT )     {         // if the chat starts with PM_RECOGNITION. That is, if an admin wants to send a PM         if ( sTemp[0] == PM_RECOGNITION )         { //      server_print("[DEBUG] ")             if (sTemp[1] == ' ')             {                 // Remove the chat recognition chars                 strbreak(sTemp, sCmd, MAX_COMMAND_CHARS-1, sMessage, MAX_MESSAGE_CHARS-1)             }             else             {                 // Remove the chat recognition chars without the space                 sTemp[0] = ' '                 trim(sTemp)                 copy(sMessage, MAX_MESSAGE_CHARS-1, sTemp)             }                         // Now we have our nick and message only in sMessage and thus, time for the next stage             BaseSendPM(sMessage, iPlayerID)                         return PLUGIN_HANDLED         }     }     return PLUGIN_CONTINUE } // Runs if anything is said in team_say public SayTeamHandler(iPlayerID) {     new sTemp[MAX_MESSAGE_CHARS]     new sCmd[MAX_COMMAND_CHARS]     new sMessage[MAX_MESSAGE_CHARS]     read_argv(1, sTemp, MAX_MESSAGE_CHARS - 1)         // if the chat starts with CHAR_RECOGNITION then we are supposed to send it to all admins     if ( sTemp[0] == CHAR_RECOGNITION )     {         // Somehow I cant get trim to work as I want, so if there are a space after @, then I had to resort to using strbreak         if (sTemp[1] == ' ')         {             // Remove the chat recognition chars, sMessage will contain the message and the message only             strbreak(sTemp, sCmd, MAX_COMMAND_CHARS-1, sMessage, MAX_MESSAGE_CHARS-1)         }         else         {             // Remove the chat recognition chars without the space.             sTemp[0] = ' '             trim(sTemp)             copy(sMessage, MAX_MESSAGE_CHARS-1, sTemp)         }                 remove_quotes(sMessage)                 SendAdminMessage(sMessage, iPlayerID)                 return PLUGIN_HANDLED     }     else if ( get_user_flags(iPlayerID) & ADMIN_CHAT )     {         // if the chat starts with PM_RECOGNITION. That is, if an admin wants to send a PM         if ( sTemp[0] == PM_RECOGNITION )         {             if (sTemp[1] == ' ')             {                 // Remove the chat recognition chars                 strbreak(sTemp, sCmd, MAX_COMMAND_CHARS-1, sMessage, MAX_MESSAGE_CHARS-1)             }             else             {                 // Remove the chat recognition chars without the space                 sTemp[0] = ' '                 trim(sTemp)                 copy(sMessage, MAX_MESSAGE_CHARS-1, sTemp)             }                         BaseSendPM(sMessage, iPlayerID)             return PLUGIN_HANDLED         }     }     return PLUGIN_CONTINUE } // Console command, amx_say <message> public ConCmdACCSay(iPlayerID) {     // if the user is an admin with ADMIN_CHAT flag     if ( get_user_flags(iPlayerID) & ADMIN_CHAT )     {         new sMessage[MAX_MESSAGE_CHARS]         read_args(sMessage, MAX_MESSAGE_CHARS-1)         remove_quotes(sMessage)                 // The message that we will actually send         new sRealMessage[MAX_MESSAGE_CHARS]                 new sUser[MAX_MESSAGE_CHARS]         get_user_name(iPlayerID, sUser, MAX_MESSAGE_CHARS-1)                 format(sRealMessage, MAX_MESSAGE_CHARS-1, "^x04%s%s^x01%s", BEFORE_TELL_ALL_TEXT, sUser, TELL_ALL_TEXT, "^x04%s" , sMessage)         // Get the steamid for the sake of logging         new sSendSteamID[MAX_MESSAGE_CHARS]         get_user_authid(iPlayerID, sSendSteamID, MAX_MESSAGE_CHARS-1)                 // Get all current players         new nCurPlayers         new iArrCurPlayers[32]         get_players(iArrCurPlayers, nCurPlayers, "c")                 // Log the message         log_amx("Chat (ALL), From: ^"%s<%d><%s><>^" Message: ^"%s^"", sUser, iPlayerID, sSendSteamID, sMessage)         log_message("^"%s<%d><%s><>^" triggered ^"amx_say^" (text ^"%s^")",sUser, iPlayerID, sSendSteamID, sMessage)             // For every player         for (new iID = 0; iID < nCurPlayers; iID++)             SendMessage(sRealMessage, iArrCurPlayers[iID]) // Send the message to the player     }     return PLUGIN_HANDLED; } // Console command, amx_psay <nick or steamid> <message> public ConCmdACCPM(iPlayerID) {     // if the user is an admin     if ( get_user_flags(iPlayerID) & ADMIN_CHAT )     {         new sArgs[MAX_MESSAGE_CHARS]         read_args(sArgs, MAX_MESSAGE_CHARS-1)         BaseSendPM(sArgs, iPlayerID)     }     return PLUGIN_HANDLED } // Console Command, amx_chat <message> public ConCmdACCAdmins(iPlayerID) {     new sArgs[MAX_MESSAGE_CHARS]     read_args(sArgs, MAX_MESSAGE_CHARS-1)     remove_quotes(sArgs)         SendAdminMessage(sArgs, iPlayerID)     return PLUGIN_HANDLED } // Returns the id of the player, IF and only IF it found ONLY one player with which contains the nick provided, otherwise it returns less than 0 FindPlayerWithNick(sNick[MAX_MESSAGE_CHARS]) {     new iArrPlayers[32]     new nPlayers     new sUser[MAX_MESSAGE_CHARS]     new iPlayerID = -100     get_players(iArrPlayers, nPlayers, "c")         // for every player     for (new iID = 0; iID < nPlayers; iID++)     {         get_user_name(iArrPlayers[iID], sUser, MAX_MESSAGE_CHARS-1)         // Check if their nick contains the nick part provided, ignore caps         if ( containi(sUser, sNick) >= 0  || equali(sUser,sNick) )         {             // if we havent found anyone yet, else return we have found too many             if (iPlayerID == -100)                 iPlayerID = iArrPlayers[iID]             else                 return TOO_MANY_MATCHED         }     }     if (iPlayerID == -100)         return NONE_MATCHED     else         return iPlayerID             return 0 } // Returns the id of the player with the correct steamid if it find any, otherwise it returns less than 0 FindPlayerWithSteamID(sSteamID[MAX_MESSAGE_CHARS]) {     new iArrPlayers[32]     new nPlayers     new sUser[MAX_MESSAGE_CHARS]     new iResult     get_players(iArrPlayers, nPlayers, "c")     for (new iID = 0; iID < nPlayers; iID++)     {         get_user_authid(iArrPlayers[iID], sUser, MAX_MESSAGE_CHARS-1)         // The steam id must be strictly equal         iResult = equal(sUser, sSteamID)         if ( iResult == 1 )         {             // Since steamid is unique, we dont have to check anyone else             return iArrPlayers[iID]         }     }     return NONE_MATCHED } // This is where we build the message to be sent, logs the message and find out who the admins are SendAdminMessage(sMessage[], iSenderID) {     // The message that is going to be sent. ^x04 is green color     new sRealMessage[MAX_MESSAGE_CHARS] = "^x04"     // Get the username of the sender     new sUser[MAX_MESSAGE_CHARS]     get_user_name(iSenderID, sUser, MAX_MESSAGE_CHARS - 1)         // Add user, "user friendly text" and the message to the message we are going to send     add(sRealMessage, MAX_MESSAGE_CHARS, sUser)     add(sRealMessage, MAX_MESSAGE_CHARS, TELL_ADMIN_TEXT)     add( sRealMessage, MAX_MESSAGE_CHARS, (sMessage), (MAX_MESSAGE_CHARS-strlen(sRealMessage)-1) )     // Get the steamid for the sake of logging     new sSendSteamID[MAX_MESSAGE_CHARS]     get_user_authid(iSenderID, sSendSteamID, MAX_MESSAGE_CHARS-1)         // Get all current players     new nCurPlayers     new iArrCurPlayers[32]     get_players(iArrCurPlayers, nCurPlayers, "c")         // Log the message     log_amx("ADMINS amx_chat, From: ^"%s<%d><%s><>^" Message: ^"%s^"", sUser, iSenderID, sSendSteamID, sMessage)     log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")",sUser, iSenderID, sSendSteamID, sMessage)     // For every player     for (new iID = 0; iID < nCurPlayers; iID++)         if ( get_user_flags(iArrCurPlayers[iID]) & ADMIN_CHAT ) // If the player is an admin             SendMessage(sRealMessage, iArrCurPlayers[iID]) // Send the message to the player(admin) } // This is where we prepare the PM, breaks out the nick and the message from the original message, // finds who the reciever is and sends it. Also sends error if none or several matches found BaseSendPM(sArgs[], iPlayerID) {     new sNick[MAX_MESSAGE_CHARS]     new sMessage[MAX_MESSAGE_CHARS]         // Get the nick/steamid     strbreak(sArgs, sNick, MAX_MESSAGE_CHARS-1, sMessage, MAX_MESSAGE_CHARS-1)         // Remove all those nasty quotes ! ! !     remove_quotes(sNick)     replace(sMessage, MAX_MESSAGE_CHARS-1, "^"", "")     // Get the players id by comparing the players nick with the one the user supplied     new iResult     if ( equal(sNick, "STEAM_", 6) )         iResult = FindPlayerWithSteamID(sNick)     else         iResult = FindPlayerWithNick(sNick)     if ( iResult >= 0 ) // if we found "ONE" player with that nick, then we send the PM     {         SendPM(sMessage, iPlayerID, iResult)     }     else // if we found none or several with that nick. Then we send back an error message to the admin     {         new sSendSteamID[MAX_MESSAGE_CHARS]         get_user_authid(iPlayerID, sSendSteamID, MAX_MESSAGE_CHARS-1)         format(sMessage, MAX_MESSAGE_CHARS-1, "^x04[ACC] says: Error: None found or too many found")         // if the sender is an admin or infact the server itself.         if ( equal(sSendSteamID, "STEAM_", 6) )             SendMessage(sMessage, iPlayerID)         else             server_print(sMessage)     } } // Here we build the PM message, logs it and sends it SendPM(sMessage[], iSenderID, iRecieverID) {     new sRealMessage[MAX_MESSAGE_CHARS] = "^x04"     // To the person     new sUser[MAX_MESSAGE_CHARS]     get_user_name(iSenderID, sUser, MAX_MESSAGE_CHARS - 1)     add(sRealMessage, MAX_MESSAGE_CHARS, sUser)     new sTemp[MAX_MESSAGE_CHARS]     format(sTemp, MAX_MESSAGE_CHARS-1, "%s^x01", PM_TELL_TEXT)     add(sRealMessage, MAX_MESSAGE_CHARS, sTemp)     add( sRealMessage, MAX_MESSAGE_CHARS, (sMessage), (MAX_MESSAGE_CHARS-strlen(sRealMessage)-1) )     new sRecvSteamID[MAX_MESSAGE_CHARS]     new sSendSteamID[MAX_MESSAGE_CHARS]     new sRecvName[MAX_MESSAGE_CHARS]         get_user_authid(iSenderID, sSendSteamID, MAX_MESSAGE_CHARS-1)     get_user_authid(iRecieverID, sRecvSteamID, MAX_MESSAGE_CHARS-1)     get_user_name(iRecieverID, sRecvName, MAX_MESSAGE_CHARS - 1)         log_amx("PM From: ^"%s<%d><%s><>^" To: ^"%s<%d><%s><>^" Message: ^"%s^"", sUser, iSenderID, sSendSteamID, sRecvName, iRecieverID, sRecvSteamID, sMessage)     log_message("^"%s<%d><%s><>^" triggered ^"amx_psay^" against ^"%s<%d><%s><>^" (text ^"%s^")",         sUser, iSenderID, sSendSteamID, sRecvName, iRecieverID, sRecvSteamID, sMessage)     SendMessage(sRealMessage, iRecieverID)         // And to the admin who sent it     // if the sender is an admin or infact the server     if ( equal(sSendSteamID, "STEAM_", 6) )     {         new sToAdmin[MAX_MESSAGE_CHARS]         format(sToAdmin, MAX_MESSAGE_CHARS-1, "^x04%s%s: ^x01%s", PM_SENDER_TEXT, sRecvName, sMessage)         SendMessage(sToAdmin, iSenderID)     }     else     {         server_print("[ACC] %s%s: %s", PM_SENDER_TEXT, sRecvName, sMessage)     } } // General method for sending chat messages, params are the message to be sent and the id of the player who should get it SendMessage(sMessage[], iRecieverID) {     message_begin(MSG_ONE, gmsgSayText, {0,0,0}, iRecieverID)     write_byte(iRecieverID)     write_string(sMessage)     message_end() }
__________________
Bento is offline
Cereal.Killer
Senior Member
Join Date: Jul 2004
Old 07-16-2005 , 16:41  
Reply With Quote #30

Err.. Im not totaly sure I understand what you said.. You say "It does NOT handle say and team_say" .. I want it to handle those, make the say the color of the team that the player is on.. AND I want it to work (In the sense of, logging to hlsw. <--- Is this possible?
Cereal.Killer is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:25.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode