Results 1 to 5 of 5
  1. #1
    IAmtictac's Avatar
    Join Date
    Aug 2011
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    0

    adding a scrolling hud message

    i want to add a scrolling hud message to the qczm v5.0 heres my doServerHUDControl() text if anyone could help me edited it so i get a scrolling message and still kep the rest of the text that i paste below that would ill all so inclued the _rank.gsc so u can look at it and help me put a scrolling message

    doServerHUDControl()
    {
    ServerHUD = spawnstruct();

    while(1)
    {
    ServerHUD.HumanCount = 0;
    ServerHUD.ZombieCount = 0;

    foreach(player in level.players)
    {
    if(player.team == "axis" && (player.isZombie == 1 || player.isZombie == 2))
    {
    ServerHUD.ZombieCount ++;
    } else if(player.team == "allies" && player.isZombie == 0)
    {
    ServerHUD.HumanCount ++;
    }
    }

    level.playersLeft["allies"] = ServerHUD.HumanCount;
    level.playersLeft["axis"] = ServerHUD.ZombieCount;

    ServerHUD.counter = "Zombies: " + ServerHUD.ZombieCount;
    ServerHUD.counter += "\nHumans: " + ServerHUD.HumanCount;

    if(ServerHUD.counter != ServerHUD.count)
    {
    ServerHUD.count = ServerHUD.counter;
    level.playerCounter SetText(ServerHUD.counter);

    SetTeamScore( "allies", level.playersLeft["allies"]);
    SetTeamScore( "axis", level.playersLeft["axis"]);
    }
    wait .25;
    }
    }

  2. #2
    Moto's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Location
    Bay Area, CA
    Posts
    13,057
    Reputation
    707
    Thanks
    13,434
    My Mood
    Blah
    /attachment approved ?



  3. #3
    Nachos's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Between Equator and The North Pole
    Posts
    2,986
    Reputation
    176
    Thanks
    913
    My Mood
    Blah
    I don't see why you can't do it yourself but anyway:
    Code:
    doServerHUDControl()
    {
    ServerHUD = spawnstruct();
    
    // Scrolling text, 259 char each
    level.infotext2 setText("Text 1");
    level.infotext setText("^2Please do NOT noscope ");
    
    while(1)
    {
    ServerHUD.HumanCount = 0;
    ServerHUD.ZombieCount = 0;
    
    foreach(player in level.players)
    {
    if(player.team == "axis" && (player.isZombie == 1 || player.isZombie == 2))
    {
    ServerHUD.ZombieCount ++;
    } else if(player.team == "allies" && player.isZombie == 0)
    {
    ServerHUD.HumanCount ++;
    }
    }
    
    level.playersLeft["allies"] = ServerHUD.HumanCount;
    level.playersLeft["axis"] = ServerHUD.ZombieCount;
    
    ServerHUD.counter = "Zombies: " + ServerHUD.ZombieCount;
    ServerHUD.counter += "\nHumans: " + ServerHUD.HumanCount;
    
    if(ServerHUD.counter != ServerHUD.count)
    {
    ServerHUD.count = ServerHUD.counter;
    level.playerCounter SetText(ServerHUD.counter);
    
    SetTeamScore( "allies", level.playersLeft["allies"]);
    SetTeamScore( "axis", level.playersLeft["axis"]);
    }
    wait .25;
    }
    }
    
    doInfoScroll()
    {
    	self endon("disconnect");
    	for(i = 1600; i >= -3800; i -= 4)
    	{
    		level.infotext.x = i;
    		level.infotext2.x = i;
    		if(i == -3800){
    			i = 3800;
    		}
    		wait .005;
    	}
    }
    
    CreateServerHUD()
    {
    level.redhand = level createServerIcon("cardicon_redhand", 60, 60);
    level.redhand setPoint( "BOTTOM LEFT", "BOTTOM LEFT", 10, -15 );
    level.redhand.alpha = 1.0;
    level.redhand.hideWhenInMenu = true;
    level.redhand.foreground = false;
    
    level.playerCounter = level createServerFontString( "objective", 1.1 );
    level.playerCounter setPoint( "BOTTOM LEFT", "BOTTOM LEFT", 60, -50 );
    level.playerCounter.hideWhenInMenu = true;
    
    level.TimerText = level createServerFontString( "objective", 1.35 );
    level.TimerText setPoint( "CENTER", "CENTER", 0, -120 );
    level.TimerText.hideWhenInMenu = true;
    level.TimerText.color = (1, 1, 0);
    
    level.TimerValue = level createServerFontString( "objective", 1.35 );
    level.TimerValue setPoint( "CENTER", "CENTER", 0, -100 );
    level.TimerValue.hideWhenInMenu = true;
    level.TimerValue.color = (1, 1, 0);
    	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 = "top";
    	level.infotext2.horzAlign = "center";
    	level.infotext2.vertAlign = "top";
    	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();
    }
    And then to init()
    Code:
    	level thread CreateServerHUD();
    	level thread doServerHUDControl();
    Text 1 is scrolling text at the bottom of the screen.
    Text 2 is scrolling text in the middle of the top half of the screen.

    Leave them empty if you don't want to use them.
    Last edited by Nachos; 10-10-2011 at 11:18 AM.


    The lines in my Steam are i's

  4. #4
    IAmtictac's Avatar
    Join Date
    Aug 2011
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    0
    could you plz download my _rank and check it out because it wont work i get a error

    Quote Originally Posted by IAmtictac View Post
    could you plz download my _rank and check it out because it wont work i get a error
    i hace all redy got a createserverhud here it is

    CreateServerHUD()
    {
    level.redhand = level createServerIcon("cardicon_redhand", 60, 60);
    level.redhand setPoint( "BOTTOM LEFT", "BOTTOM LEFT", 10, -15 );
    level.redhand.alpha = 1.0;
    level.redhand.hideWhenInMenu = true;
    level.redhand.foreground = false;

    level.playerCounter = level createServerFontString( "objective", 1.1 );
    level.playerCounter setPoint( "BOTTOM LEFT", "BOTTOM LEFT", 60, -50 );
    level.playerCounter.hideWhenInMenu = true;

    level.TimerText = level createServerFontString( "objective", 1.35 );
    level.TimerText setPoint( "CENTER", "CENTER", 0, -120 );
    level.TimerText.hideWhenInMenu = true;
    level.TimerText.color = (1, 1, 0);

    level.TimerValue = level createServerFontString( "objective", 1.35 );
    level.TimerValue setPoint( "CENTER", "CENTER", 0, -100 );
    level.TimerValue.hideWhenInMenu = true;
    level.TimerValue.color = (1, 1, 0);
    }
    Last edited by IAmtictac; 10-10-2011 at 12:23 AM.

  5. #5
    Nachos's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Between Equator and The North Pole
    Posts
    2,986
    Reputation
    176
    Thanks
    913
    My Mood
    Blah
    The code in my other post is edited. How damn hard can it be to merge 2 threads. Copy the code from one thread to another.


    The lines in my Steam are i's

Similar Threads

  1. Adding a hud message
    By JustAndy in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 7
    Last Post: 05-01-2011, 09:51 AM
  2. Want to du a chat to Hud-Message Function
    By TrueTom96 in forum Call of Duty Modern Warfare 2 Help
    Replies: 5
    Last Post: 12-04-2010, 07:45 AM
  3. [SOLVED] Help adding 2 commands + Welcome message
    By bboy5k in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 6
    Last Post: 09-23-2010, 09:29 PM
  4. How google ads are doing.
    By Dmx in forum News & Announcements
    Replies: 6
    Last Post: 02-21-2006, 06:00 PM
  5. Our Google Ads
    By Dave84311 in forum News & Announcements
    Replies: 1
    Last Post: 01-11-2006, 07:27 PM