Raised This Month: $ Target: $400
 0% 

Green Admin Chat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
joker555
BANNED
Join Date: Dec 2009
Old 01-23-2010 , 12:52   Green Admin Chat
Reply With Quote #1

i need a code in which admin color changes to Green.i checked all other plugin but there is little bugs in each and every plugin.

Last edited by joker555; 01-25-2010 at 14:37.
joker555 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-23-2010 , 15:17   Re: Green Admin Chat
Reply With Quote #2

Exolent wrote this plugin already. Post the ones that you have tried. Just saying that they all have bugs is dumb.
__________________
fysiks is offline
joker555
BANNED
Join Date: Dec 2009
Old 01-23-2010 , 23:46   Re: Green Admin Chat
Reply With Quote #3

Can give you give me the link
joker555 is offline
joker555
BANNED
Join Date: Dec 2009
Old 01-23-2010 , 23:50   Re: Green Admin Chat
Reply With Quote #4

PHP Code:

/***************************************************************************************

Colored Admin Chat - (c) 2007 by Exolent
Made by Exolent        http://forums.alliedmods.net/showthread.php?t=60009

Where the idea came from: http://forums.alliedmods.net/showthread.php?t=57993

Description:
    This plugin allows admin with the specified admin level to have colored text
    as all the text in their messagemode and messagemode2 chat messages. Also.
    "/command" messages and "@", "@@", and "@@@" messages will not be shown but
    they still will work.

Cvars:
    amx_cac_enabled        <0|1> (default: 1)
    amx_adminlisten_voice    <0|1> (default: 1)
    amx_adminlisten_voice    <0|1> (default: 1)

*NOTE* This was ONLY tested in CS 1.6. Use in other mods at own risk.


This plugin's source and compiled files can be found @:

    http://forums.alliedmods.net/showthread.php?t=60009


***************************************************************************************


    Changelog:
    
        Version 1.0
        - Initial release
        
        
        Version 1.1
        - Added admin level for green chat
        - Merged 4 format() functions into one
        
        
        Version 2.0
        - Simple code cleanup
        - Merged AdminListen with fakemeta and not engine
        --- AdminListen Link: http://forums.alliedmods.net/showthread.php?p=107768
        
        
        Version 3.0
        - Multiplied color possibilites
        - Rearranged messages
        - Fixed a few bugs
        - Renamed plugin
        
        
        Version 3.1
        - Cleanup code
        - Fixed cvar chat issue
        
        
        Version 3.2
        - Made only 1 check for @ | @@ | @@@ say commands
        - Made voice follow sv_alltalk when not using voice listening
        - Added cvar to turn on/off plugin
        - Removed green name with green chat
        - Optimized has_color_chat() and get_color_chat() when using get_user_flags()
        - Removed SPEAK_MUTED for its uselessness
        
        
        Version 4.0
        - Rewrote code
        - Fixed a few bugs


**************************************************************************************/


// COLOR CHAT LEVELS
// --------------------------------------------------------------------------------------
#define ADMIN_NORMAL    ADMIN_LEVEL_A        // level for normal chat with green name only
#define ADMIN_RED    ADMIN_LEVEL_B        // level for red chat
#define ADMIN_BLUE    ADMIN_LEVEL_C        // level for blue chat
#define ADMIN_SILVER    ADMIN_LEVEL_D        // level for silver chat
// --------------------------------------------------------------------------------------


// ADMIN LISTEN LEVELS
// --------------------------------------------------------------------------------------
#define LISTEN_CHAT ADMIN_KICK        // level to see all chat (adminlisten style)
#define LISTEN_VOICE ADMIN_IMMUNITY    // level to hear all voices (adminlisten style)
// --------------------------------------------------------------------------------------




//   DO NOT EDIT BEYOND THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING
// --------------------------------------------------------------------------------------

#include <amxmodx>
#include <fakemeta>

#define SPEAK_NORMAL    (1<<0)
//#define SPEAK_MUTED    (1<<1)
#define SPEAK_ALL    (1<<2)
#define SPEAK_LISTENALL    (1<<3)


new pCvar_enabled;
new 
pCvar_voice;
new 
pCvar_chat;
new 
pCvar_alltalk;

new 
giMaxPlayers;
new 
giMsgSayText;
new 
giMsgTeamInfo;
new 
giSpeakFlags[33];
new const 
giColorLevels[] = 
{
    
ADMIN_ALL,
    
ADMIN_NORMAL,
    
ADMIN_RED,
    
ADMIN_BLUE,
    
ADMIN_SILVER
};

new const 
gszColorCode[][] = 
{
    
"",
    
"^x01",
    
"^x03",
    
"^x03",
    
"^x03"
};
new const 
gszColorTeams[][] = 
{
    
"",
    
"",
    
"TERRORIST",
    
"CT",
    
"SPECTATOR"
};
new const 
gszTeamNames[][] = 
{
    
"Spectator",
    
"Terrorist",
    
"Counter-Terrorist",
    
"Spectator"
};

public 
plugin_init()
{
    
register_plugin("Colored Admin Chat""4.0""Exolent");
    
register_clcmd("say""handle_say");
    
register_clcmd("say_team""handle_teamsay");
    
register_forward(FM_Voice_SetClientListening"fm_SetVoice");
    
    
pCvar_enabled register_cvar("amx_cac_enabled""1");
    
pCvar_voice register_cvar("amx_adminlisten_voice""1");
    
pCvar_chat register_cvar("amx_adminlisten_chat""1");
    
pCvar_alltalk get_cvar_pointer("sv_alltalk");
    
    
giMaxPlayers get_maxplayers();
    
giMsgSayText get_user_msgid("SayText");
    
giMsgTeamInfo get_user_msgid("TeamInfo");
}

public 
handle_say(id)
{
    if(!
get_pcvar_num(pCvar_enabled))
        return 
PLUGIN_CONTINUE;
    
    static 
szMessage[192];
    
read_args(szMessage191);
    
remove_quotes(szMessage);
    
    if(!
is_valid_message(szMessage))
        return 
PLUGIN_CONTINUE;
    
    static 
bool:bAdmin;
    
bAdmin has_color_chat(id);
    
    static 
iChatColoriAlivei;
    
iChatColor get_chat_color(id);
    
iAlive is_user_alive(id);
    
    static 
szName[32], szTeam[32], szTeam2[32];
    
get_user_name(idszName31);
    
get_user_team(idszTeam31);
    
    
format(szMessage191"%s%s%s ^x01: %s %s",\
        
iAlive "" "^x01*DEAD*",\
        
bAdmin "^x04" "^x01",\
        
szName,\
        
bAdmin gszColorCode[iChatColor] : "",\
        
szMessage);
    
    for(
1<= giMaxPlayersi++)
    {
        if(!
is_user_connected(i))
            continue;
        
        if(
iAlive == is_user_alive(i)
        || (
get_pcvar_num(pCvar_chat)) && (get_user_flags(i) & LISTEN_CHAT))
        {
            
get_user_team(iszTeam231);
            
handle_message(iszTeamszTeam2iChatColorszMessage);
        }
    }
    return 
PLUGIN_HANDLED;
}

public 
handle_teamsay(id)
{
    if(!
get_pcvar_num(pCvar_enabled))
        return 
PLUGIN_CONTINUE;
    
    static 
szMessage[192];
    
read_args(szMessage191);
    
remove_quotes(szMessage);
    
    if(!
is_valid_message(szMessage))
        return 
PLUGIN_CONTINUE;
    
    static 
bool:bAdmin;
    
bAdmin has_color_chat(id);
    
    static 
iChatColoriAliveiTeami;
    
iChatColor get_chat_color(id);
    
iAlive is_user_alive(id);
    
iTeam get_user_team(id);
    
    static 
szName[32], szTeam[32], szTeam2[32];
    
get_user_name(idszName31);
    
get_user_team(idszTeam31);
    
    
format(szMessage191"^x01%s(%s)%s %s^x01 : %s %s",\
        
iAlive "" "*DEAD*",\
        
gszTeamNames[iTeam],\
        
bAdmin "^x04" "^x03",\
        
szName,\
        
bAdmin gszColorCode[iChatColor] : "",\
        
szMessage);
    
    for(
1<= giMaxPlayersi++)
    {
        if(!
is_user_connected(i))
            continue;
        
        
get_user_team(iszTeam231);
        if(!
equali(szTeamszTeam2) && (get_pcvar_num(pCvar_chat) != 1))
            continue;
        
        if(
iAlive == is_user_alive(i)
        || 
get_user_flags(i) & LISTEN_CHAT)
        {
            
handle_message(idszTeamszTeam2iChatColorszMessage);
        }
    }
    return 
PLUGIN_HANDLED;
}

public 
fm_SetVoice(iReceiveriSenderbool:bListen)
{
    
reset_speak(iReceiver);
    
reset_speak(iSender);
    if((
giSpeakFlags[iSender] & SPEAK_ALL) != 0)
    {
        
set_speak(iReceiveriSendertrue);
        return 
FMRES_SUPERCEDE;
    }
    if((
giSpeakFlags[iReceiver] & SPEAK_LISTENALL) != 0)
    {
        
set_speak(iReceiveriSendertrue);
        return 
FMRES_SUPERCEDE;
    }
    
forward_return(FMV_CELLbListen);
    return 
FMRES_IGNORED;
}

bool:is_valid_message(const szMessage[])
{
    if(
szMessage[0] == '/'
    
|| szMessage[0] == '@'
    
|| !strlen(szMessage))
    {
        return 
false;
    }
    return 
true;
}

bool:has_color_chat(const id)
{
    static 
iFlagsi;
    
iFlags get_user_flags(id);
    for(
1sizeof giColorLevelsi++)
    {
        if(
iFlags giColorLevels[i])
            return 
true;
    }
    return 
false;
}

get_chat_color(const id)
{
    static 
iFlagsi;
    
iFlags get_user_flags(id);
    for(
1sizeof giColorLevelsi++)
    {
        if(
iFlags giColorLevels[i])
            return 
i;
    }
    return 
0;
}

handle_message(const id, const szTeam[], const szTeam2[], const iChatColor, const szMessage[])
{
    if(
equali(gszColorCode[iChatColor], "^x03") && !equali(gszColorTeams[iChatColor], szTeam2))
    {
        
show_TeamInfo_msg(idgszColorTeams[iChatColor]);
        
show_SayText_msg(idszMessage);
        
show_TeamInfo_msg(idszTeam2);
    }
    else if(!
equali(szTeamszTeam2) && !iChatColor)
    {
        
show_TeamInfo_msg(idszTeam);
        
show_SayText_msg(idszMessage);
        
show_TeamInfo_msg(idszTeam2);
    }
    else
    {
        
show_SayText_msg(idszMessage);
    }
    return 
1;
}

show_TeamInfo_msg(const id, const szTeam[])
{
    
message_begin(MSG_ONEgiMsgTeamInfo_id);
    
write_byte(id);
    
write_string(szTeam);
    
message_end();
}

show_SayText_msg(const id, const szMessage[])
{
    
message_begin(MSG_ONEgiMsgSayText_id);
    
write_byte(id);
    
write_string(szMessage);
    
message_end();
}

reset_speak(const id)
{
    if(
get_pcvar_num(pCvar_alltalk) == 1)
    {
        
giSpeakFlags[id] = SPEAK_ALL;
    }
    else if((
get_pcvar_num(pCvar_voice) == 1) && (get_user_flags(id) & LISTEN_VOICE))
    {
        
giSpeakFlags[id] = SPEAK_LISTENALL;
    }
    else
    {
        
giSpeakFlags[id] = SPEAK_NORMAL;
    }
}

set_speak(const iReceiver, const iSender, const bool:bListen)
{
    
engfunc(EngFunc_SetClientListeningiReceiveriSenderbListen)
    
forward_return(FMV_CELLbListen);

I only want Green admin chat.Rest in this above code i dont want anything,will some people help me to remove uncessary things like admin level and other color accept green
joker555 is offline
ditmesteam
Senior Member
Join Date: Oct 2009
Old 01-24-2010 , 06:06   Re: Green Admin Chat
Reply With Quote #5

I am too, I only like color admin chat, do not need anything more
ditmesteam is offline
Old 01-25-2010, 08:12
joker555
This message has been deleted by YamiKaitou. Reason: bump
Old 01-25-2010, 14:37
joker555
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks since last post. http://forums.alliedmods.net/showthread.php?t=100352
cs-portal
BANNED
Join Date: Dec 2009
Location: Kiev
Old 01-25-2010 , 14:39   Re: Green Admin Chat [ EXOLENT-HELP ]
Reply With Quote #6

admin_chat_color plugin .... omg
cs-portal is offline
Send a message via ICQ to cs-portal Send a message via Skype™ to cs-portal
joker555
BANNED
Join Date: Dec 2009
Old 01-25-2010 , 14:45   Re: Green Admin Chat [ EXOLENT-HELP ]
Reply With Quote #7

no i want edited code.. i dont want any color excpet green and also i dont want admin levels and also admin voice
joker555 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-25-2010 , 18:15   Re: Green Admin Chat [ EXOLENT-HELP ]
Reply With Quote #8

have you tried searching for it? I'm sure there is one in this forum (or maybe unapproved forum) that is just green text for admins.
__________________
fysiks is offline
joker555
BANNED
Join Date: Dec 2009
Old 01-25-2010 , 23:10   Re: Green Admin Chat [ EXOLENT-HELP ]
Reply With Quote #9

Flysiks.. i got d code and i posted above and so now can u edit that
joker555 is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 01-25-2010 , 23:14   Re: Green Admin Chat [ EXOLENT-HELP ]
Reply With Quote #10

Quote:
Originally Posted by joker555 View Post
Flysiks.. i got d code and i posted above and so now can u edit that
It's fysiks. Respect goes a long way in this community.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ 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 19:06.


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