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

Std Admin Color Chat


Post New Thread Reply   
 
Thread Tools Display Modes
clowntrick
Junior Member
Join Date: Apr 2010
Old 07-29-2010 , 02:08   Re: Std Admin Color Chat
Reply With Quote #91

Is there a way, I could have it do this:

Admin with flag (ban), has green chat.

There name, appears normal (regardless what team there on, spec, t, or ct), but the Message itself is green.
clowntrick is offline
horussjr
Junior Member
Join Date: Dec 2010
Old 12-31-2010 , 07:17   Re: Std Admin Color Chat
Reply With Quote #92

simple players , without no accesses, dont see his own say_team @ mesage. can you update it? or at least tell me what to edit/add in the sma and wherE? thank you in advance
horussjr is offline
Old 05-24-2012, 17:35
Moh Es
This message has been deleted by Exolent[jNr]. Reason: Advertising server.
cemo
Junior Member
Join Date: Sep 2012
Old 09-05-2012 , 15:10   Re: Std Admin Color Chat
Reply With Quote #93

How can i remove "tells all" from the chat??
cemo is offline
Gicu
Member
Join Date: May 2008
Location: Romania
Old 01-14-2013 , 00:55   Re: Std Admin Color Chat
Reply With Quote #94

I'm not sure if it's a problem from me, or if it's intended to work this way, however, when a player is writing with U@ (say_team@) only the admins can see his message, but the player can't, and they keep spamming thinking that the command doesn't work. If this is the way it was intended to work, would you please be so kind to help me? If it was not meant to work this way, a simple answer would be helpful. Thanks in advance.
Gicu is offline
Send a message via Yahoo to Gicu
wickedd
Veteran Member
Join Date: Nov 2009
Old 01-14-2013 , 02:19   Re: Std Admin Color Chat
Reply With Quote #95

The answer to your question is in the first post.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Gicu
Member
Join Date: May 2008
Location: Romania
Old 01-14-2013 , 22:18   Re: Std Admin Color Chat
Reply With Quote #96

Actually is not, the plugin works as described in first post, but there's nothing about the say_team @message, which only shows on amx_chat but not on the chat of the player who sends it, as it should.
Gicu is offline
Send a message via Yahoo to Gicu
_ck
Junior Member
Join Date: May 2013
Location: Russia, Togliatti
Old 05-07-2013 , 21:15   Re: Std Admin Color Chat
Reply With Quote #97

Hello everyone! Just sorry for my English, I use the translator google Tell me how to fix this problem? (In a personal message appears ",it appears when I use the messagemode "amx_psay name"). admin_chat By default, this option is correctly!
_ck is offline
Send a message via ICQ to _ck Send a message via Skype™ to _ck
guraba
Member
Join Date: Feb 2013
Old 11-05-2013 , 14:46   Re: Std Admin Color Chat
Reply With Quote #98

is possible to change in admin chat namecolor not all green name if is ts red if ct blue and txt "tell to all admins "green message normal ? if some1 can edit sma and give me here plss thanks
guraba is offline
botz
AlliedModders Donor
Join Date: Jan 2015
Old 08-24-2015 , 13:19   Re: Std Admin Color Chat
Reply With Quote #99

I have seen some bugs/ plus i need some edit of codes, i cant edit it im getting confused.

When a player messages admin using u@ he cant see what he sent, he thinks the server is messed up
Please fix it so he can see what he messaged admins

Now the color codes, i need help with

|Username- Green| |tells admins:-yellow| |Message - Green|

|Username - Green| |PMs You: - Yellow| |Message - Green|

|You PM:- Green| |Username-Yellow| |Message-Green|

|Username-Green| |tells all:-yellow| Message-Green|

Thansk
__________________

Last edited by botz; 08-24-2015 at 17:33.
botz is offline
Myshu
Junior Member
Join Date: Jul 2017
Old 07-22-2017 , 08:36   Re: Std Admin Color Chat
Reply With Quote #100

Hey,

I have 2 problems with this plugin.

1. When one player is using u@ to report a cheater tag before his name is the same like admins (ADMIN) and not (Player)

2. When players are using u@ they can't see their own message like in normal adminchat

Cand someone help me?

Quote:
//********************************************* ******************
//* Standard Admin Color Chat v. 1.1.1 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_SIZE 256
#define MAX_COMMAND_SIZE 10
#define AMX_CHAT_CHAR_RECOGNITION '@' // What character we look for when we decide if the message should go to the admins
#define AMX_PSAY_CHAR_RECOGNITION '#' // Character to look for when sending PMs

// Error Codes
#define TOO_MANY_MATCHED -1
#define NONE_MATCHED -2

#define AMX_PSAY_FINDNICK_ERROR_TOO_MANY "^x04[ACC] says: Error <More than one player matches your input>"
#define AMX_PSAY_FINDNICK_ERROR_NONE "^x04[ACC] says: Error <Player not found>"
#define AMX_PSAY_FINDNICK_ERROR_UNKNOWN "^x04[ACC] says: Error <Unknown error>"

// Text defines, PREFIX is text before and SUFFIX is text after the username in a message.
// Feel free to change these. Also note that ^x01 and ^x04 is color codes.
#define AMX_CHAT_PREFIX "^x03 (ADMIN) " // Text before the username in amx_chat command
#define AMX_CHAT_SUFFIX ": ^x04" // Text after the username in amx_chat command
#define AMX_PSAY_SEND_PREFIX "^x04 (PM)" // Text before the username in a PM that you send
#define AMX_PSAY_SEND_SUFFIX ": ^x03" // Text after the username in a PM that you send
#define AMX_PSAY_BACK_TO_SENDER_PREFIX "^x03(PM) " // Text before the username in the confimation notice of the PM you send
#define AMX_PSAY_BACK_TO_SENDER_SUFFIX ": ^x04" // Text after the username in the confimation notice of the PM you send
#define AMX_SAY_PREFIX "^x03 (ALL)" // Text before the username in the amx_say command
#define AMX_SAY_SUFFIX ": ^x04" // Text after the username in the amx_say command
// E. g. an amx_chat message with the current settings will be as following example shows
// Command by player with the nick "Martin Van der Cal":
// amx_chat Hello admins
// Shows as:
// Martin Van der Cal tells admins: Hello admins
// Also note that with only the color code in the prefix the whole line will show as green to all admins


new gmsgSayText

public plugin_init()
{
register_plugin("Std Admin Color Chat", "1.1.1", "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");

gmsgSayText = get_user_msgid("SayText")
}

// Runs if anything is said in say
public SayHandler(iPlayerID)
{
new sTemp[MAX_MESSAGE_SIZE]
new sMessage[MAX_MESSAGE_SIZE]
new sCmd[MAX_COMMAND_SIZE]
read_argv(1, sTemp, MAX_MESSAGE_SIZE - 1)

// if the player has admin chat rights
if ( get_user_flags(iPlayerID) & ADMIN_CHAT )
{
// if the chat starts with AMX_PSAY_CHAR_RECOGNITION. That is, if an admin wants to send a PM
if ( sTemp[0] == AMX_PSAY_CHAR_RECOGNITION )
{
// server_print("[DEBUG] ")

if (sTemp[1] == ' ')
{
// Remove the chat recognition chars
strbreak(sTemp, sCmd, MAX_COMMAND_SIZE-1, sMessage, MAX_MESSAGE_SIZE-1)
}
else
{
// Remove the chat recognition chars without the space
sTemp[0] = ' '
trim(sTemp)
copy(sMessage, MAX_MESSAGE_SIZE-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_SIZE]
new sCmd[MAX_COMMAND_SIZE]
new sMessage[MAX_MESSAGE_SIZE]
read_argv(1, sTemp, MAX_MESSAGE_SIZE - 1)

// if the chat starts with AMX_CHAT_CHAR_RECOGNITION then we are supposed to send it to all admins
if ( sTemp[0] == AMX_CHAT_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_SIZE-1, sMessage, MAX_MESSAGE_SIZE-1)
}
else
{
// Remove the chat recognition chars without the space.
sTemp[0] = ' '
trim(sTemp)
copy(sMessage, MAX_MESSAGE_SIZE-1, sTemp)
}

remove_quotes(sMessage)

SendAdminMessage(sMessage, iPlayerID)

return PLUGIN_HANDLED
}
else if ( get_user_flags(iPlayerID) & ADMIN_CHAT )
{
// if the chat starts with AMX_PSAY_CHAR_RECOGNITION. That is, if an admin wants to send a PM
if ( sTemp[0] == AMX_PSAY_CHAR_RECOGNITION )
{
if (sTemp[1] == ' ')
{
// Remove the chat recognition chars
strbreak(sTemp, sCmd, MAX_COMMAND_SIZE-1, sMessage, MAX_MESSAGE_SIZE-1)
}
else
{
// Remove the chat recognition chars without the space
sTemp[0] = ' '
trim(sTemp)
copy(sMessage, MAX_MESSAGE_SIZE-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_SIZE]
read_args(sMessage, MAX_MESSAGE_SIZE-1)
remove_quotes(sMessage)

new sUser[MAX_MESSAGE_SIZE]
get_user_name(iPlayerID, sUser, MAX_MESSAGE_SIZE-1)

// The message that we will actually send
new sRealMessage[MAX_MESSAGE_SIZE] = AMX_SAY_PREFIX
add(sRealMessage, MAX_MESSAGE_SIZE-1, sUser)
add(sRealMessage, MAX_MESSAGE_SIZE-1, AMX_SAY_SUFFIX)
add(sRealMessage, MAX_MESSAGE_SIZE-1, sMessage, MAX_MESSAGE_SIZE-strlen(sRealMessage)-1)

// Get the steamid for the sake of logging
new sSendSteamID[MAX_MESSAGE_SIZE]
get_user_authid(iPlayerID, sSendSteamID, MAX_MESSAGE_SIZE-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_SIZE]
read_args(sArgs, MAX_MESSAGE_SIZE-1)

BaseSendPM(sArgs, iPlayerID)
}
return PLUGIN_HANDLED
}

// Console Command, amx_chat <message>
public ConCmdACCAdmins(iPlayerID)
{
new sArgs[MAX_MESSAGE_SIZE]
read_args(sArgs, MAX_MESSAGE_SIZE-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_SIZE])
{
new iArrPlayers[32]
new nPlayers
new sUser[MAX_MESSAGE_SIZE]
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_SIZE-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_SIZE])
{
new iArrPlayers[32]
new nPlayers
new sUser[MAX_MESSAGE_SIZE]
new iResult
get_players(iArrPlayers, nPlayers, "c")

for (new iID = 0; iID < nPlayers; iID++)
{
get_user_authid(iArrPlayers[iID], sUser, MAX_MESSAGE_SIZE-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_SIZE] = AMX_CHAT_PREFIX

// Get the username of the sender
new sUser[MAX_MESSAGE_SIZE]
get_user_name(iSenderID, sUser, MAX_MESSAGE_SIZE - 1)

// Add user, "user friendly text" and the message to the message we are going to send
add(sRealMessage, MAX_MESSAGE_SIZE, sUser)
add(sRealMessage, MAX_MESSAGE_SIZE, AMX_CHAT_SUFFIX)
add( sRealMessage, MAX_MESSAGE_SIZE, (sMessage), (MAX_MESSAGE_SIZE-strlen(sRealMessage)-1) )

// Get the steamid for the sake of logging
new sSendSteamID[MAX_MESSAGE_SIZE]
get_user_authid(iSenderID, sSendSteamID, MAX_MESSAGE_SIZE-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_SIZE]
new sMessage[MAX_MESSAGE_SIZE]

// Get the nick/steamid
strbreak(sArgs, sNick, MAX_MESSAGE_SIZE-1, sMessage, MAX_MESSAGE_SIZE-1)

// Remove all those nasty quotes ! ! !
remove_quotes(sNick)
replace(sMessage, MAX_MESSAGE_SIZE-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_SIZE]
get_user_authid(iPlayerID, sSendSteamID, MAX_MESSAGE_SIZE-1)

if ( iResult == TOO_MANY_MATCHED )
format(sMessage, MAX_MESSAGE_SIZE-1, AMX_PSAY_FINDNICK_ERROR_TOO_MANY)
else if ( iResult == NONE_MATCHED )
format(sMessage, MAX_MESSAGE_SIZE-1, AMX_PSAY_FINDNICK_ERROR_NONE)
else
format(sMessage, MAX_MESSAGE_SIZE-1, AMX_PSAY_FINDNICK_ERROR_UNKNOWN)

// 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_SIZE] = AMX_PSAY_SEND_PREFIX

// To the person
new sUser[MAX_MESSAGE_SIZE]
get_user_name(iSenderID, sUser, MAX_MESSAGE_SIZE - 1)

add(sRealMessage, MAX_MESSAGE_SIZE-1, sUser)
add(sRealMessage, MAX_MESSAGE_SIZE-1, AMX_PSAY_SEND_SUFFIX)
add(sRealMessage, MAX_MESSAGE_SIZE-1, sMessage, MAX_MESSAGE_SIZE-strlen(sRealMessage)-1)

new sRecvSteamID[MAX_MESSAGE_SIZE]
new sSendSteamID[MAX_MESSAGE_SIZE]
new sRecvName[MAX_MESSAGE_SIZE]

get_user_authid(iSenderID, sSendSteamID, MAX_MESSAGE_SIZE-1)
get_user_authid(iRecieverID, sRecvSteamID, MAX_MESSAGE_SIZE-1)

get_user_name(iRecieverID, sRecvName, MAX_MESSAGE_SIZE - 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
new sToAdmin[MAX_MESSAGE_SIZE] = AMX_PSAY_BACK_TO_SENDER_PREFIX
add(sToAdmin, MAX_MESSAGE_SIZE-1, sRecvName)
add(sToAdmin, MAX_MESSAGE_SIZE-1, AMX_PSAY_BACK_TO_SENDER_SUFFIX)
add(sToAdmin, MAX_MESSAGE_SIZE-1, sMessage, MAX_MESSAGE_SIZE-strlen(sToAdmin)-1)

// if the sender is an admin or infact the server
if ( equal(sSendSteamID, "STEAM_", 6) )
SendMessage(sToAdmin, iSenderID)
else
server_print(sToAdmin)
}

// 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()
}
Myshu is offline
Reply


Thread Tools
Display Modes

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 04:53.


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