AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Colored message (https://forums.alliedmods.net/showthread.php?t=130504)

cFG 06-24-2010 12:40

Colored message
 
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?

YamiKaitou 06-24-2010 19:26

Re: Colored message
 
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

cFG 06-25-2010 08:15

Re: Colored message
 
Guessed! :D
But how does it look?

ColorChat.inl doesn't work on lang files.

Alka 06-25-2010 08:18

Re: Colored message
 
This does -> http://forums.alliedmods.net/showthread.php?p=851160

cFG 06-25-2010 08:39

Re: Colored message
 
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.

abdul-rehman 06-25-2010 08:39

Re: Colored message
 
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 "


cFG 06-25-2010 08:43

Re: Colored message
 
abdul-rehman, i wan't to print colored text by multilingual(txt) files not through plugin.
This method also does not work.

abdul-rehman 06-25-2010 09:05

Re: Colored message
 
Then use conners plugin bcoz it is the best..

cFG 06-25-2010 09:06

Re: Colored message
 
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


Hezerf 06-25-2010 10:13

Re: Colored message
 
You need that plugin too.


All times are GMT -4. The time now is 14:46.

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