Results 1 to 8 of 8
  1. #1
    JustAndy's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Posts
    62
    Reputation
    10
    Thanks
    2
    My Mood
    Fine

    Question 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

  2. #2
    SneakyPete's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    In a New World
    Posts
    531
    Reputation
    22
    Thanks
    25
    My Mood
    Happy
    doServerHUDControl()
    {
    level.infotext setText("set text here")

    }

    Waiting between worlds that divide through a choice undefined
    A break in the line where all paths intertwine
    And no roads lead or progress behind
    And all signs read: "Know The Way. Decide"



  3. #3
    JustAndy's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Posts
    62
    Reputation
    10
    Thanks
    2
    My Mood
    Fine
    thanks but i get an error when i use that, is there a specific place it has to be used in/with?

  4. #4
    Nachos's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Between Equator and The North Pole
    Posts
    2,984
    Reputation
    176
    Thanks
    919
    My Mood
    Blah


    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(;;){

    Last edited by Nachos; 04-30-2011 at 05:07 AM.


    The lines in my Steam are i's

  5. #5
    lolkop123's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Posts
    7
    Reputation
    10
    Thanks
    0
    I did this but i don't see any scrolling text :P

  6. #6
    Nachos's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Between Equator and The North Pole
    Posts
    2,984
    Reputation
    176
    Thanks
    919
    My Mood
    Blah
    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.infotex*****lor = ( 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.
    Last edited by Nachos; 04-30-2011 at 10:38 AM.


    The lines in my Steam are i's

  7. The Following User Says Thank You to Nachos For This Useful Post:

    backtrack.mani (09-28-2011)

  8. #7
    JustAndy's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Posts
    62
    Reputation
    10
    Thanks
    2
    My Mood
    Fine
    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?

  9. #8
    Nachos's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Between Equator and The North Pole
    Posts
    2,984
    Reputation
    176
    Thanks
    919
    My Mood
    Blah
    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.infotex*****lor = ( 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


    The lines in my Steam are i's