Member
Join Date: Jul 2013
Location: Guatemala
|
01-24-2015
, 12:23
Re: [CS:GO] HUD colors
|
#7
|
Quote:
Originally Posted by KissLick
So... I did some testing and HTML seems to be partialy working in PrintHintText() and UserMessage KeyHintText.
Some points I made:
- PrintHintText and KeyHintText seems to be working exactly the same way...
- CSS is not working...
- Only a few HTML tags are working (<font>, <b>, <i>, <u> and <br>)
- You can create new line with both <br> or \n
- HUD has only three lines (with default font size)
- Font
- Color could be set only via HEX RGB code and not names... I use this color mixer
- Default font size seems to be 20, but I am not sure about that...
- Smaller font means more lines
- Any custom font I tried to use with <font> gave me the same result
- And of course, you can combine tags...
Here is my test plugin I made:
PHP Code:
#include <sourcemod>
public Plugin:myinfo =
{
name = "CSGO_ColorHudTest",
author = "Raska",
description = "",
version = "0.1",
url = ""
}
public OnClientSayCommand_Post(iClient, const String:sCommand[], const String:sArgs[])
{
if (StrEqual(sArgs, "!1")) {
PrintHintText(iClient,"normal <font color='#ff0000'>red</font> normal <font color='#006699'>color #006699</font> normal");
} else if (StrEqual(sArgs, "!2")) {
PrintHintText(iClient,"normal <font size='30'>size 30</font> normal");
} else if (StrEqual(sArgs, "!3")) {
PrintHintText(iClient,"normal <font face='Arial'>custom font</font> normal");
} else if (StrEqual(sArgs, "!4")) {
PrintHintText(iClient,"normal <b>bold</b> normal");
} else if (StrEqual(sArgs, "!5")) {
PrintHintText(iClient,"normal <i>italica</i> normal");
} else if (StrEqual(sArgs, "!6")) {
PrintHintText(iClient,"normal <u>underline</u> normal");
} else if (StrEqual(sArgs, "!7")) {
PrintHintText(iClient,"line1\nline2<br/>line3");
} else if (StrEqual(sArgs, "!8")) {
PrintHintText(iClient,"<font color='#006699'><b><u>PLAYER INFO</u></b></font>\n<font color='#990033'>PlayerName:</font> %N\n<font color='#666699'>PlayerUserID:</font> #%d", iClient, GetClientUserId(iClient));
} else if (StrEqual(sArgs, "!9")) {
PrintHintText(iClient,"<font size='10'>line1\nline2\nline3\nline4\nline5\nline6</font>");
}
}
stock bool:PrintKeyHintText(client, const String:format[], any:...)
{
new Handle:userMessage = StartMessageOne("KeyHintText", client);
if (userMessage == INVALID_HANDLE) {
return false;
}
decl String:buffer[1024];
SetGlobalTransTarget(client);
VFormat(buffer, sizeof(buffer), format, 3);
if (GetUserMessageType() == UM_Protobuf)
{
PbAddString(userMessage, "hints", buffer);
}
else
{
BfWriteByte(userMessage, 1);
BfWriteString(userMessage, buffer);
}
EndMessage();
return true;
}
And some images:
!1 !2 !3 !4 !5 !6 !7 !8 !9
|
I was having this doubt about the hint text, cause I researched and there is not much info about it, I think we should start to update the wiki with some new info ;D
|
|