AlliedModders

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

feren02 05-06-2012 05:10

Colored text messages
 
2 Attachment(s)
Hi,

How can I put colors in texts in "Configuration Settings" file?

E.g.
PHP Code:

]/eat
exact
don
't show
text
All
[green][o-cP` Battle Arena][/green] %name is eating%text.
don'
t log 

>>> The [o-cP` Battle Arena] should be green in text message in-game.

Here are the files that I have:

.SMA
.CFG



Many thanks in advance, looking forward!

Mitchell 05-06-2012 11:54

Re: Colored text messages
 
Wrong section.

striker07 05-07-2012 00:39

Re: Colored text messages
 
Quote:

Originally Posted by Mitchell (Post 1703463)
Wrong section.

not really becous for that he needs an colorchat include or colorchat stock.
Look around there are plenty of plugins that already have colorprints in it. just copie it or make an include of it

feren02 05-08-2012 10:44

Re: Colored text messages
 
Quote:

Originally Posted by Mitchell (Post 1703463)
Wrong section.

I guess this section is not wrong.

What I am trying to ask is a help for the codes in the .sma file so that when I put [green] [/green] in a configuration settings file, there will be color in-game. The only color I can manage is the chatcolor by Conor but it is applicable in .sma files only, not for configuration settings file (the .ini file I attached)


-- Any help out there. Thank you, looking forward!

bazhenov93 05-08-2012 15:00

Re: Colored text messages
 
PHP Code:

#include <colorchat>
 
ColorChat(idGREEN"[o-cP` Battle Arena] ^1Your text"


?

feren02 05-09-2012 08:20

Re: Colored text messages
 
Quote:

Originally Posted by bazhenov93 (Post 1705032)
PHP Code:

#include <colorchat>
 
ColorChat(idGREEN"[o-cP` Battle Arena] ^1Your text"


?

I just have said. Not in .sma files but in .ini files......... What I uploaded are related files:

1. .SMA file = the file where the .ini file is based and gets functions
2. .INI file = the file where I input the commands I want to have in my server in simple way because it already gets the functions from the .SMA file.

My question is, how can I put colored text messages using the .INI file but the script/function will come from the .SMA file so that when I put [green] [/green] in the .INI file, i will get a colored text chat in-game.

striker07 05-09-2012 10:17

Re: Colored text messages
 
Quote:

Originally Posted by feren02 (Post 1705470)
I just have said. Not in .sma files but in .ini files......... What I uploaded are related files:

1. .SMA file = the file where the .ini file is based and gets functions
2. .INI file = the file where I input the commands I want to have in my server in simple way because it already gets the functions from the .SMA file.

My question is, how can I put colored text messages using the .INI file but the script/function will come from the .SMA file so that when I put [green] [/green] in the .INI file, i will get a colored text chat in-game.

I dont think you can put colors on your server messages with php code using a .ini file, bazhenov93 is right.
download a colorchat include or strip a colorchat stock from an existing plugin into an include yourself. I recommend the colorprint from pastout's jailbreakmod. It is very good and can display multiple colors (green, team based red, blue) and is user friendly.

you can simply use his stock in the sma itself or if you use a plugin that uses a dictonary then you can put the colors in the dictonary itself.

a lil example:

In the script:
PHP Code:

//without using a dictonary:
fnColorPrint(id"sentence starts in default yellow ^2blue/red or teamcolor(not sure) ^3blue/red or teamcolor (not sure) ^4green text ^1yellow text ")
 
//with dictonary:
fnColorPrint(id"%L"LANG_SERVER"TESTLINE"'^4''^1'); 

Code:

//inside the dictonary (.txt):
TESTLINE = %cGreen text %cYellow Text.


wickedd 05-09-2012 10:19

Re: Colored text messages
 
Take a look at this plugin.

striker07 05-09-2012 10:25

Re: Colored text messages
 
Quote:

Originally Posted by wickedd (Post 1705585)
Take a look at this plugin.

there ya go, GHW released all the good stuff :)

feren02 05-09-2012 12:57

Re: Colored text messages
 
Quote:

Originally Posted by striker07 (Post 1705589)
there ya go, GHW released all the good stuff :)

hi that is why I attached a .SMA file so that I could seek help in scripting. I have that plugin by GHW, but it is different from the GHW Say commands I have. Kindly assist me what code will I put in the GHW say commands in order to use color coding in the .INI files and appear in-game.

Maybe you still don't understand my point :)

Here it is in detail:

I attached GHW Say commands - .SMA FILE - Where codes are put and where you include <chatcolor> to have colored chat text messages in-game.
I attached Say_Commands - .INI FILE - Where texts are put so they apprear in-game, but the functions will be called from the .SMA file.


*It is clear to me that:

Quote:

I dont think you can put colors on your server messages with php code using a .ini file, bazhenov93 is right.
download a colorchat include or strip a colorchat stock from an existing plugin into an include yourself.
----- I know I can't put codes in a .INI File, that is why I am asking it to be put in the .SMA file I attached so that when I put codes in the .INI file like ([green] [/green]) --- The functions will be called from the .SMA file.


Hope its somehow clear, looking forward :)


All times are GMT -4. The time now is 00:20.

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