AlliedModders

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

zemanel 08-19-2008 14:06

Colored Text
 
I want my plugin to write for example: Test . How can I do it? (^x03 will write in what color? :S)

scrtxxcaz 08-19-2008 17:40

Re: Colored Text
 
^x01 default
^x03 ^x03 ^x03 team colors (only 1 can be in a message)
^x04 green

here's an example:
PHP Code:

static GREEN[] = "^x04"
static TEAM_COLOR[] = "^x03"
static YELLOW[] = "^x01"
new gameSayText
public plugin_int() {
     
gameSayText get_user_msgid("SayText")
}
public 
some_function(id) {
     new 
messge[124]
     new 
len format(message,123,"%sT",GREEN)
     
format(message[len],123,"%ses",YELLOW)
     
format(message[len],123,"%st",TEAM_COLOR)
     
print_message(id,message)
}
print_message(idmesg[]) {
     
message_begin(MSG_ONEgameSayText, {0,0,0}, id)
     
write_byte(id)
     
write_string(mesg)
     
message_end()


or even just
PHP Code:

public some_function(id) {
     new 
messge[124]
     
format(message,123,"^x04T^x01es^x03t")    //i believe this would work to
     
print_message(id,message)


text would come out Test. the last t would be the color of whatever team your on.


zemanel 08-19-2008 19:13

Re: Colored Text
 
that's the problem, i want the last part to be red, not whatever team.

Exolent[jNr] 08-19-2008 19:33

Re: Colored Text
 
Take a look at ColorChat.

zemanel 08-19-2008 19:41

Re: Colored Text
 
ok, but can u give me an example on how to do different colors in one sentence with that new color chat?

Brad 08-19-2008 19:56

Re: Colored Text
 
Seriously? Did you even read the FIRST post in the thread he linked? He was kind enough to link you to something you apparently couldn't find by a simple search. Now you're asking him to repeat something that was stated in the FIRST post in that thread he linked. Give me a break!

zemanel 08-19-2008 20:04

Re: Colored Text
 
i only asked u to do a code that is 3 times smaller then the rant u just did, anyways is ColorChat(0, RED, "^x03T^x01es^x04T) correct?

Brad 08-19-2008 20:18

Re: Colored Text
 
You didn't ask me to do anything for you.

Was it really a rant? Was it!? WAS IT!!!11!1!oeneleven

The code you posted may or may not be correct. I'd guess it's one or the other. Test it and let us know which it was.

-- Waiting with Bated Breath in Michigan

stupok 08-19-2008 20:19

Re: Colored Text
 
OMFG Brad is back. Hi, Brad.


All times are GMT -4. The time now is 03:04.

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