PDA

View Full Version : HUD messages.


koshmel
04-18-2009, 14:54
How thay do that. :oops:
see Attach File
Server Tf2 and L4D want to see some sample plugins.

bl4nk
04-18-2009, 15:30
Screenshot of below code in action (http://users.alliedmods.net/~bl4nk/cp_dustbowl0050.jpg)

#pragma semicolon 1

#include <sourcemod>

public OnPluginStart()
{
RegConsoleCmd("test", asdf);
}

public Action:asdf(client, args)
{
new Handle:hHudText = CreateHudSynchronizer();
SetHudTextParams(-1.0, 0.2, 5.0, 255, 0, 0, 255);
ShowSyncHudText(client, hHudText, "This is a test");
CloseHandle(hHudText);

return Plugin_Handled;
}If you use SetHudTextParamsEx, you can fade the text from one color to another.

exvel
04-18-2009, 15:32
Look into the API Reference (http://docs.sourcemod.net/api/). Keyword for searching is "hud":
CreateHudSynchronizer
SetHudTextParams
SetHudTextParamsEx
ShowSyncHudText
ClearSyncHud
ShowHudText

And as far as I know HUD examples can be found into SprayTracer plugin.

upd:
nevermind, bl4nk showed you it ))

retsam
04-18-2009, 22:29
I have a question. Is it the first numbers after SetHudTextParams(-1.0, 0.2, 5.0, 255, 0, 0, 255);

that are used to move the location of text around? Which number or numbers do that. Are those 3 the x,y,z axis?

bl4nk
04-19-2009, 00:19
Look at the prototype (http://docs.sourcemod.net/api/index.php?fastload=show&id=842&) for the function. It tells you exactly what everything is.

The first two params are x and y (there is no z as you're drawing on a 2D plane - your screen).

voogru
04-19-2009, 02:33
hey that looks like its from my server :P

koshmel
04-19-2009, 05:41
hey that looks like its from my server :P
yep ;)

kiki33hun
08-17-2013, 04:01
Its workings CSS?

necavi
08-17-2013, 04:52
No, the closest CS:S has is KeyHintText, which is...difficult to position.