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

CSS: Read what dead people write (Red/Blue text color)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 12-10-2007 , 22:55   CSS: Read what dead people write (Red/Blue text color)
Reply With Quote #1

hello,

for my public servers i would like to a plugin, which makes it possible, that i as alive player can read, what dead people write ...

generally no problem, i can hook the say commands and can send messages from dead player to alive players, too ...

but ... is it possible to create colored nicknames in red or blue? tried the \xxx values ... but only green is working :-(

thx for help
__________________
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
ferret
SourceMod Developer
Join Date: Dec 2004
Location: Atlanta, GA
Old 12-11-2007 , 09:20   Re: CSS: Read what dead people write (Red/Blue text color)
Reply With Quote #2

Put in a feature request and I'll consider adding this to basecomm as part of sm_deadtalk.
__________________
I'm a blast from the past!
ferret is offline
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 12-11-2007 , 09:23   Re: CSS: Read what dead people write (Red/Blue text color)
Reply With Quote #3

and what about the blue and red text colors ? is it possible to use them in scripts ?
__________________
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
ferret
SourceMod Developer
Join Date: Dec 2004
Location: Atlanta, GA
Old 12-11-2007 , 10:06   Re: CSS: Read what dead people write (Red/Blue text color)
Reply With Quote #4

I've seen it done but I don't remember the exact method off the top of my head.
__________________
I'm a blast from the past!
ferret is offline
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 12-12-2007 , 05:11   Re: CSS: Read what dead people write (Red/Blue text color)
Reply With Quote #5

do you think you can find it out again? how to color chat text red or blue would interest me for different ideas
__________________
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 12-12-2007 , 06:55   Re: CSS: Read what dead people write (Red/Blue text color)
Reply With Quote #6

ah i found it ... messages have to start with \x01 to enable the color mode ... but the printToChat() function use always the green color instead of the team color ...

with this function
PHP Code:
stock SayText2client_index author_index , const String:message[] ) {
   new 
Handle:buffer StartMessageOne("SayText2"client_index);
   if (
buffer != INVALID_HANDLE) {
      
BfWriteByte(bufferauthor_index);
      
BfWriteByte(buffertrue);
      
BfWriteString(buffermessage);
      
EndMessage();
   }

and this call
PHP Code:
SayText2(xxx,client,"\x01 This word is red or blue: \x03 colored_text"); 
the "colored_text" should be red or blue ...
__________________
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 12-12-2007 , 08:07   Re: CSS: Read what dead people write (Red/Blue text color)
Reply With Quote #7

a working version for cs:s ... alive players can read the chat of dead players ...

PHP Code:
#include <sourcemod>
#include <sdktools>

#define PLUGIN_VERSION "1.0.0"

#define TEAM_T 2
#define TEAM_CT 3

new maxclients;

public 
Plugin:myinfo = {
    
name "DeadChat",
    
author "tF",
    
description "Read what dead people chat",
    
version PLUGIN_VERSION,
    
url "http://www.saigns.de"
};

public 
OnPluginStart() {
    
maxclients GetMaxClients();
    
RegConsoleCmd("say"Command_Say);
}

public 
OnMapStart() {
    
maxclients GetMaxClients();
}

public 
Action:Command_Say(clientargs) {
    new 
myteam GetClientTeam(client);
    if ( !
IsPlayerAlive(client) && (myteam == TEAM_T || myteam == TEAM_CT) ) {
        new 
String:message[255];
        
GetCmdArgString(message,255);

        new 
startidx 0
        
if (message[0] == '"') {
            
startidx 1;
            
/* Strip the ending quote, if there is one */
            
new len strlen(message);
            if (
message[len-1] == '"') {
                
message[len-1] = '\0';
            }
        }

        new 
String:name[32];
        
GetClientName(client,name,sizeof(name));

        new 
String:nm[255];
        
Format(nm,sizeof(nm),"\x01 *DEAD* \x03%s \x01: %s",name,message[startidx]);

        for( new 
to to <= maxclients to++ ) {
            if( !
IsClientInGame(to) || !IsValidEdict(to) || !IsPlayerAlive(to) ) continue;
            
SayText2(to,client,nm);
        }
    }
    return 
Plugin_Continue;
}

stock SayText2client_index author_index , const String:message[] ) {
    new 
Handle:buffer StartMessageOne("SayText2"client_index);
    if (
buffer != INVALID_HANDLE) {
        
BfWriteByte(bufferauthor_index);
        
BfWriteByte(buffertrue);
        
BfWriteString(buffermessage);
        
EndMessage();
    }

__________________
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
ferret
SourceMod Developer
Join Date: Dec 2004
Location: Atlanta, GA
Old 12-12-2007 , 08:20   Re: CSS: Read what dead people write (Red/Blue text color)
Reply With Quote #8

Yes, currently to use the team color you have to send the message as SayText2 directly. I'll have to look into getting a direct native for it setup.
__________________
I'm a blast from the past!
ferret is offline
bjornwitteman
New Member
Join Date: Oct 2010
Old 10-31-2010 , 07:46   Re: CSS: Read what dead people write (Red/Blue text color)
Reply With Quote #9

Quote:
Originally Posted by ferret View Post
Yes, currently to use the team color you have to send the message as SayText2 directly. I'll have to look into getting a direct native for it setup.
is there a also code that only admins can see deathchat??
bjornwitteman 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 09:30.


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