Was finding a way to hook those Game Instructor Hints stuff you see on your screen in L4D when you first look at an ammopile, hold a health pack or having gotten pounced. Like "<Mouse Clicking Icon> Use Pain Pills" at the bottom section of your screen, etc.
Experimented with the usermessages and found MessageText, but it was not I was looking for. But it looked interesting, like an on-screen in-game console thing.
[IMG]http://img406.**************/img406/4577/l4dhospital01apartment0c.th.jpg[/IMG]
Here's the snippet for sending these messages. Every MessageText you send will print a new line at the bottom of that panel, much like a console if you ask me.
PHP Code:
MessageText(client, r, g, b, String:message[]) {
new Handle:TextHandle = StartMessageOne("MessageText", client);
BfWriteByte(TextHandle, r); // R
BfWriteByte(TextHandle, g); // G
BfWriteByte(TextHandle, b); // B
BfWriteString(TextHandle, message);
EndMessage();
}
Yes, colour can be changed by r/g/b values.
Some stuff you need to know:
31 character message limit
Text size is (very, very) small. (In that screenshot I put a CenterText to have a fontsize comparison - its even smaller!)
Make the panel close by ClientCommand-ing the client to do
hide_message_panel
The messagepanel appears
behind menus, hinttexts, chattexts. (i.e. its underlapped)
You might need this on whichever client you execute the panel to.
PHP Code:
ClientCommand(client, "bind - hide_message_panel");
Because by default hide_message_panel isn't bound on a client, and it seems like when you bind it it only lasts for that server connect. Once you quit the server, the bind gets removed.
The console command I used for that demo:
PHP Code:
public Action:TestText(client, args) {
if(GetCmdArgs() < 1) {
ReplyToCommand(client, "Usage: TestText <message>");
return Plugin_Handled;
}
decl String:arg1[32];
GetCmdArg(1, arg1, 32);
MessageText(client, 255, 101, 0, arg1);
return Plugin_Handled;
}
Don't know if it'll be of use to anyone but I'll just put it up here anyway.
P.S. anyone knows the usermessage/event that fires when the game instructor hints show? :X
__________________