Different Colors
#1

How to put different colors in text, so like, a bot system, This will be red: [Bot] and the rest the normal color?
Reply
#2

https://sampwiki.blast.hk/wiki/Format

I could write a small sample for you if still don't understand.
Reply
#3

I'M ASSUMING, THIS IS WHAT YOU WANT:

Too lazy to write one, there's a good one on wiki.sa-mp.com already:
pawn Код:
new RandomMSG[][] =
{
    "Random Message 1",
    "Random Message 2",
    "Random Message 3"
};

public SendMSG()
{
    new randMSG = random(sizeof(RandomMSG));
    SendClientMessageToAll(COLOR, RandomMSG[randMSG]); // Replace the "COLOR" with your defined color.
}
Don't forget to call the function ongamemodeinit
pawn Код:
SetTimer("SendMSG", 60000, true);
// 60000ms = 60 seconds = 1 minute
To add colors to the messages, simply change it to:
pawn Код:
Change FFFFFF to whatever hex colour you want to be used.
 "{FFFFFF}BOT:{FFFFFF}Random Message 1",
Reply
#4

Quote:
Originally Posted by Knekt
Посмотреть сообщение
I'M ASSUMING, THIS IS WHAT YOU WANT:
That's not what they asked for. They want to just change the text color, that's it. Using "format" is one way (the easiest IMO).
Reply
#5

I understand, thanks both of you!
Reply
#6

Quote:
Originally Posted by Aerotactics
Посмотреть сообщение
That's not what they asked for. They want to just change the text color, that's it. Using "format" is one way (the easiest IMO).
He's mentioning a bot system though..
Quote:

How to put different colors in text, so like, a bot system, This will be red: [Bot] and the rest the normal color?

But yeah, format the msg or you could simply do:
Код:
SendClientMessage(playerid, -1,"{FFFF00}SERVER:{FFFFFF}This will be white
Reply
#7

Quote:
Originally Posted by Knekt
Посмотреть сообщение
He's mentioning a bot system though..
A bot system is not a random messaging system.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)