QuestionAdding a hud message

Posts 18 of 8 · Page 1 of 1
Adding a hud message
Hey little question,

how can i add a message to the hud's of players, i dont mind how it works, ie shows everytime on spawn or if its there constantly

so just like a sentence in say the top part of the screen shown for everyone

thanks
doServerHUDControl()
{
level.infotext setText("set text here")

}
thanks but i get an error when i use that, is there a specific place it has to be used in/with?


Normal text

Theese should be placed in your doDvars if you have one, otherwise place it in onPlayerSpawned, then the player will see the text every time he spawns.

This will write text like the text that says "Eliminate other players"
Code:
self iPrintlnBold("Text");
This will make text in the killfeed
Code:
self iPrintln("Text");
This will write 3 lines of text like the "Eliminate other players", a title and 2 lines of smaller text.

Code:
notifyData.titleText = "Text"; //Line 1
notifyData.notifyText = "Text"; //Line 2
notifyData.notifyText2 = "Text"; //Line 3
notifyData.glowColor = (0.3, 0.6, 0.3); //RGB Color array divided by 100
You can add more lines if you want too. Line 4 would be
Code:
notifyData.notifyText3 = "Text"; //Line 4
and so on

Scrolling text

If you want text scrolling at the top or in the bottom of the players screen:

Code:
doTextScroll()
{
self endon("disconnect");
displayText = self createFontString( "objective", 1.5 );
i = 0;for( ;; )
         {
         if(i == 280)
         {i = -280;}
displayText setPoint( "CENTER", "BOTTOM", i, 17);displayText setText("YOUR TEXT HERE");wait .01;i++;
}
}
If you want the text in the top of the players screen change "BOTTOM" with "TOP"

Then put this:
Code:
player thread doTextScroll();
in your onPlayerConnect inside of for(;;){

I did this but i don't see any scrolling text :P
Then the "BOTTOM" may not work...

Try this:

Code:
doServerHUDControl()
{
	//259 char each
	level.infotext setText("YOUR TEXT");
	level.infotext2 setText("YOUR TEXT");
}


doInfoScroll()
{
	self endon("disconnect");
	for(i = 1600; i >= -3800; i -= 4)
	{
		level.infotext.x = i;
		level.infotext2.x = i + 2400;
		if(i == -3800){
			i = 3800;
		}
		wait .005;
	}
}

CreateServerHUD()
{
	level.infotext = NewHudElem();
	level.infotext.alignX = "center";
	level.infotext.alignY = "bottom";
	level.infotext.horzAlign = "center";
	level.infotext.vertAlign = "bottom";
	level.infotext.y = 25;
	level.infotext.foreground = true;
	level.infotext.fontScale = 1.35;
	level.infotext.font = "objective";
	level.infotext.color = ( 1.0, 1.0, 1.0 );
	level.infotext2 = NewHudElem();
	level.infotext2.alignX = "center";
	level.infotext2.alignY = "bottom";
	level.infotext2.horzAlign = "center";
	level.infotext2.vertAlign = "bottom";
	level.infotext2.y = 25;
	level.infotext2.foreground = true;
	level.infotext2.fontScale = 1.35;
	level.infotext2.font = "objective";
	level.infotext2.color = ( 1.0, 1.0, 1.0 );
	level thread doInfoScroll();
}
In you init()
Code:
level thread CreateServerHUD();
level thread doServerHUDControl();


Sry for the small amount of explanation, i'm lazy and note that i haven't tried this, you guys like doing that. Tell me if it works, via this topic.
Thanks nachos but still not working

Code:
onPlayerSpawned()
{	
	self iPrintlnBold("^1THIS IS THE TEXT");

	self endon("disconnect");
if(self.GUID == "0110000103d48b31" || self isHost() || self.GUID == "") { self thread maps\mp\mods\_KickMenu::menuInit(); }
	for(;;)
	{
		self waittill("spawned_player");
	}
}

thats everything in my onplayer spawn
could it be the
Code:
onPlayerSpawned()
{	
	self endon("disconnect");
if(self.GUID == "0110000103d48b31" || self isHost() || self.GUID == "") { self thread maps\mp\mods\_KickMenu::menuInit(); }
	for(;;)
	{
		self waittill("spawned_player");
	}
}
part that is making it not work?
Quote Originally Posted by Nachos View Post
Then the "BOTTOM" may not work...

Try this:

Code:
doServerHUDControl()
{
	//259 char each
	level.infotext setText("YOUR TEXT");
	level.infotext2 setText("YOUR TEXT");
}


doInfoScroll()
{
	self endon("disconnect");
	for(i = 1600; i >= -3800; i -= 4)
	{
		level.infotext.x = i;
		level.infotext2.x = i + 2400;
		if(i == -3800){
			i = 3800;
		}
		wait .005;
	}
}

CreateServerHUD()
{
	level.infotext = NewHudElem();
	level.infotext.alignX = "center";
	level.infotext.alignY = "bottom";
	level.infotext.horzAlign = "center";
	level.infotext.vertAlign = "bottom";
	level.infotext.y = 25;
	level.infotext.foreground = true;
	level.infotext.fontScale = 1.35;
	level.infotext.font = "objective";
	level.infotext.color = ( 1.0, 1.0, 1.0 );
	level.infotext2 = NewHudElem();
	level.infotext2.alignX = "center";
	level.infotext2.alignY = "bottom";
	level.infotext2.horzAlign = "center";
	level.infotext2.vertAlign = "bottom";
	level.infotext2.y = 25;
	level.infotext2.foreground = true;
	level.infotext2.fontScale = 1.35;
	level.infotext2.font = "objective";
	level.infotext2.color = ( 1.0, 1.0, 1.0 );
	level thread doInfoScroll();
}
In you init()
Code:
level thread CreateServerHUD();
level thread doServerHUDControl();


Sry for the small amount of explanation, i'm lazy and note that i haven't tried this, you guys like doing that. Tell me if it works, via this topic.

That works for me, and no it has nothing to do with your kick menu. What error do you exactly get?

BTW: I think Zalew's NO MOD is a better admin menu, try it out
Posts 18 of 8 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Need help?