Raised This Month: $ Target: $400
 0% 

Colored message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cFG
SourceMod Donor
Join Date: Aug 2009
Location: Poland, Łódź
Old 06-24-2010 , 12:40   Colored message
Reply With Quote #1

Hi all,
i used the search function but the answer for my q was not found.

I would like to print a color message from .txt file
For ex.
Code:
data/lang/timeleft.txt
Code:
TIME_LEFT = !gTime !tLeft
Doesn't work.

So how to?
__________________
HLXBans - worthy successor of AMXBans

Last edited by cFG; 06-24-2010 at 13:19.
cFG is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-24-2010 , 19:26   Re: Colored message
Reply With Quote #2

You need to code the function that is printing the message to add the colour. The default plugins are not set to show colour by default
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
cFG
SourceMod Donor
Join Date: Aug 2009
Location: Poland, Łódź
Old 06-25-2010 , 08:15   Re: Colored message
Reply With Quote #3

Guessed!
But how does it look?

ColorChat.inl doesn't work on lang files.
__________________
HLXBans - worthy successor of AMXBans
cFG is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 06-25-2010 , 08:18   Re: Colored message
Reply With Quote #4

This does -> http://forums.alliedmods.net/showthread.php?p=851160
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
cFG
SourceMod Donor
Join Date: Aug 2009
Location: Poland, Łódź
Old 06-25-2010 , 08:39   Re: Colored message
Reply With Quote #5

Damn.
When i' included the #include <chatcolor.inc> in a *sma file, compiled and... plugin doesn't work.
Plugin status is: unknown.

Code:
L 06/25/2010 - 14:37:21: [AMXX] Plugin "timeleft.amxx" failed to load: Module/Library "chatcolor" required for plugin.  Check modules.ini.
__________________
HLXBans - worthy successor of AMXBans

Last edited by cFG; 06-25-2010 at 08:46.
cFG is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 06-25-2010 , 08:39   Re: Colored message
Reply With Quote #6

Here is a stock:
PHP Code:
// Prints chat in colours
// use !g for green color
// use !t for team color [Team color can be red ,blue or grey, It depends on players team]
// use !y for yellow color
stock client_colored_print(const id, const input[], any:...)
{
 new 
iCount 1iPlayers[32]
 
 static 
szMsg[191]
 
vformat(szMsgcharsmax(szMsg), input3)
 
 
replace_all(szMsg190"!g""^4"// green txt
 
replace_all(szMsg190"!y""^1"// orange txt
 
replace_all(szMsg190"!t""^3"// team txt
 
 
if(idiPlayers[0] = id
 
else get_players(iPlayersiCount"ch")
 
 for (new 
0iCounti++)
 {
  if (
is_user_connected(iPlayers[i]))
  {
   
message_begin(MSG_ONE_UNRELIABLEg_msgSayText_iPlayers[i])
   
write_byte(iPlayers[i])
   
write_string(szMsg)
   
message_end()
  }
 }

Usage:
PHP Code:
client_colored_printid"!gHy  , !t Bye "
__________________

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
cFG
SourceMod Donor
Join Date: Aug 2009
Location: Poland, Łódź
Old 06-25-2010 , 08:43   Re: Colored message
Reply With Quote #7

abdul-rehman, i wan't to print colored text by multilingual(txt) files not through plugin.
This method also does not work.
__________________
HLXBans - worthy successor of AMXBans

Last edited by cFG; 06-25-2010 at 08:45.
cFG is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 06-25-2010 , 09:05   Re: Colored message
Reply With Quote #8

Then use conners plugin bcoz it is the best..
__________________

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
cFG
SourceMod Donor
Join Date: Aug 2009
Location: Poland, Łódź
Old 06-25-2010 , 09:06   Re: Colored message
Reply With Quote #9

I'll try'd but...

Quote:
When i' included the #include <chatcolor.inc> in a *sma file, compiled and... plugin doesn't work.
Plugin status is: unknown.

Code:
L 06/25/2010 - 14:37:21: [AMXX] Plugin "timeleft.amxx" failed to  load: Module/Library "chatcolor" required for plugin.  Check  modules.ini.
Code:
fun
;engine
;fakemeta
;geoip
;sockets
;regex
;nvault
cstrike
csx
;hamsandwich
__________________
HLXBans - worthy successor of AMXBans
cFG is offline
Hezerf
BANNED
Join Date: Mar 2010
Old 06-25-2010 , 10:13   Re: Colored message
Reply With Quote #10

You need that plugin too.
Hezerf 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 14:46.


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