Raised This Month: $ Target: $400
 0% 

Color Chat isn't working ?!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
byetovice
Senior Member
Join Date: Nov 2009
Location: Turkey
Old 06-20-2011 , 04:35   Color Chat isn't working ?!
Reply With Quote #1

Code:
stock chat_color(const id, const input[], any:...)
{
 new count = 1, players[32]
 static msg[191]
 vformat(msg, 190, input, 3)
 
 replace_all(msg, 190, "!g", "^4")
 replace_all(msg, 190, "!y", "^1")
 replace_all(msg, 190, "!t", "^3")
 
 if (id) players[0] = id; else get_players(players, count, "ch")
 {
  for (new i = 0; i < count; i++)
  {
   if (is_user_connected(players[i]))
   {
    message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
    write_byte(players[i]);
    write_string(msg);
    message_end();
   }
  }
 }
}

it's the stock. I'm using that like :
chat_color(0,"[!g%s!y] Has been !tbanned !",playername)

And its printing like This :
[ byetovice ] Has been banned!
It's just printing space Help me please
__________________
Working on mods..
byetovice is offline
DjOptimuS
Senior Member
Join Date: Jan 2009
Old 06-20-2011 , 05:51   Re: Color Chat isn't working ?!
Reply With Quote #2

try the regular colorchat.inc

use it with

PHP Code:
#include <colorchat> 
and

PHP Code:
TeamInfo get_user_msgid("TeamInfo");
SayText get_user_msgid("SayText"); 
in plugin_init()

Syntax:
PHP Code:
public ColorChat(idColor:type, const msg[], {Float,Sql,Result,_}:...) 
Example:
PHP Code:
ColorChat(idRED"message"); 
Attached Files
File Type: inc colorchat.inc (2.1 KB, 369 views)
DjOptimuS is offline
Stressful
Senior Member
Join Date: Feb 2011
Old 06-21-2011 , 05:57   Re: Color Chat isn't working ?!
Reply With Quote #3

ColorChat Tutorial

This is better and easier .
PHP Code:
#include <colorchat> 
PHP Code:
ColorChat(0NORMAL"[^x04 Green^x01] ^x03 Team Color^x01 "); 
PHP Code:
ColorChat(0/NORMAL/GREEN/, "<>"
PHP Code:
// ColorChat(1 > Only for "Host" to see the message.) 
PHP Code:
// ColorChat(0 > For everyone to see) 
Stressful is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 09-21-2011 , 11:46   Re: Color Chat isn't working ?!
Reply With Quote #4

i have the same problem, that stock isn't working, and i want to use stock :S
OvidiuS is offline
Send a message via Skype™ to OvidiuS
Korxu
Senior Member
Join Date: Sep 2010
Old 09-21-2011 , 11:56   Re: Color Chat isn't working ?!
Reply With Quote #5

I'm using this stock and works...
PHP Code:
new g_MsgSay 
PHP Code:
// in plugin_init ( )
g_MsgSay get_user_msgid "SayText" 
PHP Code:
stock print_colored ( const index, const input [ ], const any:... )
{
    new 
players 32 ]
    new 
count
    
new message 191 ]
    new 
i
    
    count 
1
    
    vformat 
message190input)
    
    
replace_all message190"!y""^1" )
    
replace_all message190"!t""^3" )
    
replace_all message190"!g""^4" )
    
    if ( 
index )
    {
        
players ] = index
    
}
        
    else
    {
        
get_players playerscount"ch" )
    }
    
    for ( 
0count++ )
    {
        if ( 
is_user_connected players ] ) )
        {
            
message_begin MSG_ONE_UNRELIABLEg_MsgSay_players ] )
            
write_byte players ] )
            
write_string message )
            
message_end ( )
        }
    }

Korxu is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 09-21-2011 , 12:07   Re: Color Chat isn't working ?!
Reply With Quote #6

tested, i just get empty space where !g !y !t should be
OvidiuS is offline
Send a message via Skype™ to OvidiuS
Korxu
Senior Member
Join Date: Sep 2010
Old 09-21-2011 , 13:01   Re: Color Chat isn't working ?!
Reply With Quote #7

Quote:
Originally Posted by OvidiuS View Post
tested, i just get empty space where !g !y !t should be
Try starting the message with a color, for example: "!y Hello!g guys".
Korxu is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 09-21-2011 , 12:20   Re: Color Chat isn't working ?!
Reply With Quote #8

use the colorchat stock that conner made, its much better!
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 09-21-2011 , 12:41   Re: Color Chat isn't working ?!
Reply With Quote #9

tried this one simple from him, but still nothing
http://forums.alliedmods.net/showthread.php?p=1389276
just empty space
OvidiuS is offline
Send a message via Skype™ to OvidiuS
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 09-21-2011 , 13:29   Re: Color Chat isn't working ?!
Reply With Quote #10

thanks a lot, finally working
OvidiuS is offline
Send a message via Skype™ to OvidiuS
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 23:26.


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