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

[req] advanced admin_chatcolor


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
aTei
Junior Member
Join Date: Dec 2008
Old 02-02-2009 , 06:10   [req] advanced admin_chatcolor
Reply With Quote #1

Help me please. I am very need it.

admin_chatcolor plugin replaces
!t to ^x03
!w to ^x01
!g to ^x04
but doing it only with players chat messages.

I need
Change this plugin that he would replacing from any messages on server.
suppose we have statsx, we go to lang file, where replace
Killed by %s from %s @ %0.0fm
to
Killed by !g%s!t from %s @ %0.0fm
and when player die he see chat message
Killed by %s from %s @ %0.0fm

OR
tell how i must change .sma files of any plugin for do colored chat messages


I tried:
just insert "!g" or "^x04" in place where i need it in lang file - no effect
move admin_chatcolor plugin to the top of plugin.ini file - no effect
adding "!g" or "^x04" to statsx.sma file -> compile, replace old statsx.amxx - no effect

i find it on 1 server, but they dont give this plugin to people.
here is screen shots from it (server information hided )
<img src="http://img156.**************/img156/2885/detrain0000yk4.th.png" border="0" />
<img src="http://img65.**************/img65/4695/detrain0001lg5.th.png" border="0">
<img src="http://img65.**************/img65/1651/detrain0003bl9.th.png" border="0"/>


here is code of admin_chatcolor.

PHP Code:
//Use !T for team-color (sorry, can't use red when on CT, and vice-versa)
//!G for green, and !W for normal (it's more of a tan than a white...)


//Includes
#include <amxmodx>
#include <cstrike>

//Defines
#if defined ACCESS_LEVEL
    #undef ACCESS_LEVEL
#endif
//#define ACCESS_LEVEL ADMIN_CHAT    //UNCOMMENT THIS LINE to allow only admins (with ADMIN_CHAT) to use colors

//Messages
new gmsgSayText

//Globals


//Initialization
public plugin_init()
{
    
gmsgSayText get_user_msgid("SayText")
    
register_clcmd("say""CatchSay")
    
register_clcmd("say_team""CatchSay")
    
register_plugin("Admin Chat Color","1.0","BlueRaja")
    return 
PLUGIN_CONTINUE
}

//Functions
public CatchSay(id)
{
    
#if defined ACCESS_LEVEL
        
if( !(get_user_flags(id)&ACCESS_LEVEL) ) return PLUGIN_CONTINUE
    
#endif

    
new message[129]
    
read_argv(1,message,128)
    
    if ( 
containi(message,"!t")==-&&
         
containi(message,"!w")==-&&
         
containi(message,"!g")==-)
    {
        return 
PLUGIN_CONTINUE
    
}
    
    new 
szCommand[9]
    
read_argv(0,szCommand,8)

    new 
CsTeams:team cs_get_user_team(id)
    new 
isAlive is_user_alive(id)
    
    new 
playerList[32]//players to send message to
    
new playerCount
    
    
new message_to_send[129] = "^x01"

    
new szFlags[4] = ""
    
if(isAlive){
        
add(szFlags,3,"a")//Only alive players
    
} else {
        
add(szFlags,3,"b")//Only dead players
        
add(message_to_send,128,"*DEAD*")
    }
    
add(szFlags,3,"c")//skip bots
    
    
if(equal(szCommand,"say_team")) {
        
add(szFlags,3,"e")//Match with passed teamname
        
if(team==CS_TEAM_T){
            
get_players(playerList,playerCount,szFlags,"TERRORIST")
            
add(message_to_send,128,"(Terrorist) ^x03")
        } else if(
team==CS_TEAM_CT) {
            
get_players(playerList,playerCount,szFlags,"CT")
            
add(message_to_send,128,"(Counter-terrorist) ^x03")
        } else { 
//assume Spectator
            
get_players(playerList,playerCount,szFlags,"SPECTATOR")
            
add(message_to_send,128,"(Spectator) ^x03")
        }
    } else { 
//assume "say"
        
get_players(playerList,playerCount,szFlags)
        if(
isAlive)
        {
            
add(message_to_send,128,"^x03")
        } else {
            
add(message_to_send,128," ^x03")
        }
    }    
    
    new 
username[129]
    
get_user_name(id,username,128)
    
add(message_to_send,128,username)
    
add(message_to_send,128,"^x01 :  ")

    
addmessage_to_send,128,message,(128-strlen(message_to_send)) )

    while(
containi(message_to_send,"!t") != -1)
    {
        
replace(message_to_send,128,"!T","^x03")
        
replace(message_to_send,128,"!t","^x03")
    }
    while(
containi(message_to_send,"!g") != -1)
    {
        
replace(message_to_send,128,"!G","^x04")
        
replace(message_to_send,128,"!g","^x04")
    }
    while(
containi(message_to_send,"!w") != -1)
    {
        
replace(message_to_send,128,"!W","^x01")
        
replace(message_to_send,128,"!w","^x01")
    }


    for(new 
i=0i<playerCounti++)
    {
        
message_begin(MSG_ONEgmsgSayText, {0,0,0}, playerList[i])
        
write_byte(playerList[i])
        
write_string(message_to_send)
        
message_end()
    }

    return 
PLUGIN_HANDLED

Sorry for bad English

Last edited by aTei; 02-02-2009 at 06:15.
aTei is offline
drohM
Junior Member
Join Date: Apr 2008
Location: Behind your back, lold.
Old 02-04-2009 , 14:45   Re: [req] advanced admin_chatcolor
Reply With Quote #2

So, u want that admins talk, lets say green?

And if u want that, heres a link for a plugin that does that: http://forums.alliedmods.net/showthr...min+chat+color
__________________
wazzup banana split?
drohM is offline
aTei
Junior Member
Join Date: Dec 2008
Old 02-12-2009 , 00:46   Re: [req] advanced admin_chatcolor
Reply With Quote #3

no, read topic again.
aTei is offline
TwN
Junior Member
Join Date: Apr 2008
Location: Netherlands
Old 02-13-2009 , 20:13   Re: [req] advanced admin_chatcolor
Reply With Quote #4

I tottaly misread your request. Best way for you to do this is rewrite client_print native and then recompile amxmodx.
I'm keeping my include here for reference when changing the native.

Here is an easy include + code, using this include. Should work, didn't have time to test thouroughly.

REMEMBER:
only ONE of these colors can be used on ONE line: red, white (gray), blue.

download the uploaded .amxx, won't compile on web due include, [edit], okay it does compile, but generates a 1.6mb .amxx, locally 3.6k
b
Attached Files
File Type: inc twanchatcolor.inc (1.9 KB, 200 views)
File Type: sma Get Plugin or Get Source (AdminSay.sma - 781 views - 1.1 KB)

Last edited by YamiKaitou; 02-13-2009 at 20:44. Reason: Do not upload AMXX files
TwN is offline
veam174
BANNED
Join Date: Sep 2011
Old 10-04-2011 , 04:50   Re: [req] advanced admin_chatcolor
Reply With Quote #5

i didnt get it. could you please tell this again
veam174 is offline
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 10-04-2011 , 13:39   Re: [req] advanced admin_chatcolor
Reply With Quote #6

Quote:
Originally Posted by veam174 View Post
i didnt get it. could you please tell this again
What didnt you get specifically? Also, try not to revive two year old threads
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
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 15:10.


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