Different Colors - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Different Colors (
/showthread.php?tid=497672)
Different Colors -
Mriss - 28.02.2014
How to put different colors in text, so like, a bot system, This will be red: [Bot] and the rest the normal color?
Re: Different Colors -
Aerotactics - 28.02.2014
https://sampwiki.blast.hk/wiki/Format
I could write a small sample for you if still don't understand.
Re: Different Colors -
Knekt - 28.02.2014
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",
Re: Different Colors -
Aerotactics - 28.02.2014
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).
Re: Different Colors -
Mriss - 28.02.2014
I understand, thanks both of you!
Re: Different Colors -
Knekt - 28.02.2014
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
Re: Different Colors -
Aerotactics - 28.02.2014
Quote:
Originally Posted by Knekt
He's mentioning a bot system though..
|
A
bot system is
not a random messaging system.