Color embedding - 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: Color embedding (
/showthread.php?tid=384613)
Color embedding -
Emre__ - 12.10.2012
I've a text like this:
pawn Код:
format(str, sizeof(str), "{FFFFF}Bla bla{FF9900} and something about {FFFFFF}brigde{FF90FF} and la la {FFFFFF}la{FF90FF}");
SendClientMessageToAll(0xFF9000FF, str);
But the problem is, when I use color embedding thing three times, it doesn't sent the message. str variable is big enough. Is there any way to show 'em all?
Re: Color embedding -
gtakillerIV - 12.10.2012
Does it send half of the message or?
Re: Color embedding -
2KY - 12.10.2012
Well, why are you using a string for that message first off, or was that just an example?
I've got this:
pawn Код:
SendClientMessage( playerid, -1, " "#Int_RankOrange"HINT: "#Int_White"Roleplay your injuries and then type "#Int_LimeGreen"/acceptdeath "#Int_White"to be transported to a medical center." );
and it's working perfectly fine. (Which is basically the same thing as yours, except I use definitions)
Re: Color embedding -
Emre__ - 12.10.2012
Quote:
Originally Posted by 2KY
Well, why are you using a string for that message first off, or was that just an example?
I've got this:
pawn Код:
SendClientMessage( playerid, -1, " "#Int_RankOrange"HINT: "#Int_White"Roleplay your injuries and then type "#Int_LimeGreen"/acceptdeath "#Int_White"to be transported to a medical center." );
and it's working perfectly fine. (Which is basically the same thing as yours, except I use definitions)
|
Of course it was an example. Why on earth a server would send a message to players?
Anyway, I'll try that and edit that post. (if someone didn't reply before me.)
Re: Color embedding -
2KY - 12.10.2012
If you're going to try my example, you're going to need my colour set. (Unless you were editing it for yourself.)
pawn Код:
// Colours
#define Colour_White (0xFFFFFFFF)
#define Int_White "{FFFFFF}"
#define Colour_Red (0xD10F0FFF)
#define Int_Red "{D10F0F}"
#define Colour_Yellow (0xF6FF00FF)
#define Int_Yellow "{F6FF00}"
#define Colour_AdminBlue (0x56D7E8FF)
#define Int_AdminBlue "{56D7E8}"
#define Colour_RankOrange (0xF5AF0CFF)
#define Int_RankOrange "{F5AF0C}"
#define Colour_LimeGreen (0xC1E60BFF)
#define Int_LimeGreen "{C1E60B}"
#define Colour_Grey (0x525452FF)
#define Int_Grey "{525452}"
#define Colour_Purple (0x942DA6FF)
#define Int_Purple "{942DA6}"
Re: Color embedding -
Emre__ - 12.10.2012
I tried your example but it didn't work. But i didn't use it with # thing at that point:
pawn Код:
SendClientMessage( playerid, -1, " "#Int_RankOrange"HINT: "#Int_White"Roleplay your injuries and then type "#Int_LimeGreen"/acceptdeath "#Int_White"to be transported to a medical center." );
Re: Color embedding -
2KY - 12.10.2012
Try this then.
pawn Код:
SendClientMessage( playerid, -1, "{D10F0F}This text should be red." );
If that doesn't work, I'm beginning to doubt you have the correct SA:MP version.
Re: Color embedding -
Vince - 12.10.2012
Keep in mind that the maximum output string for a chat message is 144 characters. Anything longer simply won't be displayed. Every embedded color you use adds 8 characters to that limit.
Re: Color embedding -
Emre__ - 12.10.2012
Oh yes. @2KY's is 126 characters with color tags. I think I should decrease my characters, first.