Results 1 to 10 of 10

Thread: Hud Message Script

  1. #1

    Default Hud Message Script

    Code:
    /*
    
    //     Map Rotation Messages cvar section
    //
    // There are 6 messages shown
    //
    // 1.) sv_hostname
    // 2.) Server Ip
    // 3.) Server Admin Name
    // 4.) Gametype
    // 5.) Next Map with or without gametype ( with "nextmapname Destroyed_Village_TDM" Without "nextmapname Destroyed_Village")
    // 6.) Your website
    //
    //  NOTE: The last message in the string will be the first message shown.
    //
    // The message script will get your "sv_hostname" 
    // and the "Gametype" you don't need to add them.
    // 
    // Add the cvars below to your server.cfg.
    
    set website "YOUR WEB SITE HERE"
    set admin "ADMIN NAME HERE"
    set ip "SERVER IP"
    
    //      Message TIMES cvar section
    //
    //The plug time is set to start then show each 
    // message for 40 seconds then switch to next message. 
    //So all 6 messages will run every "5 Mins."  
        
    
    set plugtime "40" 
    
    //    THESE MUST STAY AS IS
    
    set nextmapname ""
    set plug ""
    
    //===================================================================================================================================================
          EXAMPLE VSTR SETTINGS 
    The "nextmapname" is for the "next" map 
    in rotation, not the first map played.       
    
    //Map Rotation Messages cvar section
    
    // The download URL for any custom maps on the server. Usualy your clan/group's website address.
    set website "www.thedeadheads.freeforums.org"
    
    set admin "{TDH} Nightstalker"
    
    set plugtime "49" 
    
    set ip "68.192.147.203"
    
    set nextmapname ""
    set plug ""
    
    set x1 "nextmapname Destroyed_Village_TDM; plug 1;set g_gametype 1;map dm/mohdm1; set nextmap vstr x2"           
    set x2 "nextmapname Remagen_TDM; plug 1;set g_gametype 2; timelimit 20; map dm/mohdm2; set nextmap vstr x3"         
    set x3 "nextmapname Crossroads_TDM; plug 1;set g_gametype 1;map dm/mohdm3; set nextmap vstr x4"           
    set x4 "nextmapname Snowy_Park_FFA; plug 1;set g_gametype 1;map dm/mohdm4; set nextmap vstr x5"           
    set x5 "nextmapname Stalingrad_RB; plug 1;set g_gametype 3;map dm/mohdm5; set nextmap vstr x6"            
    set x6 "nextmapname Algiers_TDM; plug 1;set g_gametype 1;map dm/mohdm6; set nextmap vstr x7"          
    set x7 "nextmapname The_Hunt_OBJ; plug 1;set g_gametype 2;map dm/mohdm7; set nextmap vstr x8"           
    set x8 "nextmapname V2_Rocket_Facility_OBJ; plug 1;set g_gametype 4;map obj/obj_team1; set nextmap vstr x9"   
    set x9 "nextmapname Omahaa_Beach_OBJ; plug 1;set g_gametype 4;map obj/obj_team2; set nextmap vstr x10"    
    set x10 "nextmapname The_Bridge; plug 1;set g_gametype 4;map obj/obj_team3; set nextmap vstr x11"  
    set x11 "nextmapname Stalingrad_FFA; plug 1;set g_gametype 4;map obj/obj_team4; set nextmap vstr x12" 
    set x12 "nextmapname Southern_France_FFA; plug 1;set g_gametype 1;map dm/mohdm6; set nextmap vstr x1"            
    
    
    set sv_maplist "" // leave it blank
    
    // loads the first map
    vstr x1
    
    
    //===================================================================================================================================================
    
    */
    
    
    main:
    
    thread maps
    
    	  local.plugtime = int(getcvar(plugtime))
    	  wait local.plugtime
    	  
    	  local.plug = int(getcvar(plug))
        local.sv_hostname = getcvar(sv_hostname) 
        local.g_gametypestring = getcvar(g_gametypestring)   
        local.admin = getcvar(admin)
    		local.website = getcvar(website)
    		local.ip = getcvar(ip)
    		local.nextmapname = getcvar(nextmapname)
    		
        level.hudstrings = ("Server IP: "+(local.ip)+"")::("ADMIN: "+(local.admin)+"")::("Current Game Type: "+(local.g_gametypestring)+"")::("NEXT MAP: "+(local.nextmapname)+"")::("Vist Us At "+(local.website)+"")::("Welcome To "+(local.sv_hostname)+"")  		
        local.start = int( level.hudstrings.size ) 
    
    
        while(1)
        {
        waitframe
        wait 1.0                                                         
        huddraw_alpha 14 1                                                                               
        huddraw_color 14 0.0 1.0 1.0                                       
        huddraw_rect 14 325 -25 1 1                                 
        huddraw_align 14 left bottom                                     
        huddraw_string 14 level.hudstrings[local.start]
    
        wait local.plugtime     
    
        huddraw_alpha 14 0                                                     
        local.start++
        if(local.start > level.hudstrings.size)             
        local.start = 1
        }
    end
    
    maps:
    
    	while(1)
    	{
    		waitframe
        
    		local.nextmapname = getcvar(nextmapname)
    		local.mapnamesize = local.nextmapname.size
    		local.mapnamesize -= 1
    
    		for (local.i = 0; local.i <= local.mapnamesize; local.i ++ )
    		{
    			if(local.nextmapname[local.i] == "_")
    			{
    			local.nextmapname[local.i] = " "
    
    			}
    			
    		}
    		
      }
          
    end

  2. #2
    Senior Member verruguitens's Avatar
    Join Date
    Mar 2017
    Location
    Argentina
    Posts
    207

    Default

    How install in my hosted server?, only in CONFIG file i edit like me and paste? or what? please help!

  3. #3

    Default

    You put this in the config of the server:

    Code:
    //     Map Rotation Messages cvar section
    //
    // There are 6 messages shown
    //
    // 1.) sv_hostname
    // 2.) Server Ip
    // 3.) Server Admin Name
    // 4.) Gametype
    // 5.) Next Map with or without gametype ( with "nextmapname Destroyed_Village_TDM" Without "nextmapname Destroyed_Village")
    // 6.) Your website
    //
    //  NOTE: The last message in the string will be the first message shown.
    //
    // The message script will get your "sv_hostname" 
    // and the "Gametype" you don't need to add them.
    // 
    // Add the cvars below to your server.cfg.
    
    set website "YOUR WEB SITE HERE"
    set admin "ADMIN NAME HERE"
    set ip "SERVER IP"
    
    //      Message TIMES cvar section
    //
    //The plug time is set to start then show each 
    // message for 40 seconds then switch to next message. 
    //So all 6 messages will run every "5 Mins."  
        
    
    set plugtime "40" 
    
    //    THESE MUST STAY AS IS
    
    set nextmapname ""
    set plug ""
    
    //===================================================================================================================================================
          EXAMPLE VSTR SETTINGS 
    The "nextmapname" is for the "next" map 
    in rotation, not the first map played.       
    
    //Map Rotation Messages cvar section
    
    // The download URL for any custom maps on the server. Usualy your clan/group's website address.
    set website "www.thedeadheads.freeforums.org"
    
    set admin "{TDH} Nightstalker"
    
    set plugtime "49" 
    
    set ip "68.192.147.203"
    
    set nextmapname ""
    set plug ""
    
    set x1 "nextmapname Destroyed_Village_TDM; plug 1;set g_gametype 1;map dm/mohdm1; set nextmap vstr x2"           
    set x2 "nextmapname Remagen_TDM; plug 1;set g_gametype 2; timelimit 20; map dm/mohdm2; set nextmap vstr x3"         
    set x3 "nextmapname Crossroads_TDM; plug 1;set g_gametype 1;map dm/mohdm3; set nextmap vstr x4"           
    set x4 "nextmapname Snowy_Park_FFA; plug 1;set g_gametype 1;map dm/mohdm4; set nextmap vstr x5"           
    set x5 "nextmapname Stalingrad_RB; plug 1;set g_gametype 3;map dm/mohdm5; set nextmap vstr x6"            
    set x6 "nextmapname Algiers_TDM; plug 1;set g_gametype 1;map dm/mohdm6; set nextmap vstr x7"          
    set x7 "nextmapname The_Hunt_OBJ; plug 1;set g_gametype 2;map dm/mohdm7; set nextmap vstr x8"           
    set x8 "nextmapname V2_Rocket_Facility_OBJ; plug 1;set g_gametype 4;map obj/obj_team1; set nextmap vstr x9"   
    set x9 "nextmapname Omahaa_Beach_OBJ; plug 1;set g_gametype 4;map obj/obj_team2; set nextmap vstr x10"    
    set x10 "nextmapname The_Bridge; plug 1;set g_gametype 4;map obj/obj_team3; set nextmap vstr x11"  
    set x11 "nextmapname Stalingrad_FFA; plug 1;set g_gametype 4;map obj/obj_team4; set nextmap vstr x12" 
    set x12 "nextmapname Southern_France_FFA; plug 1;set g_gametype 1;map dm/mohdm6; set nextmap vstr x1"            
    
    
    set sv_maplist "" // leave it blank
    
    // loads the first map
    vstr x1
    This code in a script and call him on the Dmprecache:
    Code:
    main:
    
    thread maps
    
    	  local.plugtime = int(getcvar(plugtime))
    	  wait local.plugtime
    	  
    	  local.plug = int(getcvar(plug))
        local.sv_hostname = getcvar(sv_hostname) 
        local.g_gametypestring = getcvar(g_gametypestring)   
        local.admin = getcvar(admin)
    		local.website = getcvar(website)
    		local.ip = getcvar(ip)
    		local.nextmapname = getcvar(nextmapname)
    		
        level.hudstrings = ("Server IP: "+(local.ip)+"")::("ADMIN: "+(local.admin)+"")::("Current Game Type: "+(local.g_gametypestring)+"")::("NEXT MAP: "+(local.nextmapname)+"")::("Vist Us At "+(local.website)+"")::("Welcome To "+(local.sv_hostname)+"")  		
        local.start = int( level.hudstrings.size ) 
    
    
        while(1)
        {
        waitframe
        wait 1.0                                                         
        huddraw_alpha 14 1                                                                               
        huddraw_color 14 0.0 1.0 1.0                                       
        huddraw_rect 14 325 -25 1 1                                 
        huddraw_align 14 left bottom                                     
        huddraw_string 14 level.hudstrings[local.start]
    
        wait local.plugtime     
    
        huddraw_alpha 14 0                                                     
        local.start++
        if(local.start > level.hudstrings.size)             
        local.start = 1
        }
    end
    
    maps:
    
    	while(1)
    	{
    		waitframe
        
    		local.nextmapname = getcvar(nextmapname)
    		local.mapnamesize = local.nextmapname.size
    		local.mapnamesize -= 1
    
    		for (local.i = 0; local.i <= local.mapnamesize; local.i ++ )
    		{
    			if(local.nextmapname[local.i] == "_")
    			{
    			local.nextmapname[local.i] = " "
    
    			}
    			
    		}
    		
      }
          
    end

  4. #4

    Default

    Plz, post nice code, it just hurts.


    //=========================================================================
    main: {
    //=========================================================================
    thread maps

    local.plugtime = int(getcvar(plugtime))
    wait local.plugtime

    local.plug = int(getcvar(plug))
    local.sv_hostname = getcvar(sv_hostname)
    local.g_gametypestring = getcvar(g_gametypestring)
    local.admin = getcvar(admin)
    local.website = getcvar(website)
    local.ip = getcvar(ip)
    local.nextmapname = getcvar(nextmapname)
    level.hudstrings = ("Server IP: "+(local.ip)+"")::("ADMIN: "+(local.admin)+"")::("Current Game Type: "+(local.g_gametypestring)+"")::("NEXT MAP: "+(local.nextmapname)+"")::("Vist Us At "+(local.website)+"")::("Welcome To "+(local.sv_hostname)+"")
    local.start = int( level.hudstrings.size )

    while(1) {
    waitframe
    wait 1.0
    huddraw_alpha 14 1
    huddraw_color 14 0.0 1.0 1.0
    huddraw_rect 14 325 -25 1 1
    huddraw_align 14 left bottom
    huddraw_string 14 level.hudstrings[local.start]
    wait local.plugtime

    huddraw_alpha 14 0
    local.start++

    if(local.start > level.hudstrings.size){
    local.start = 1
    }
    }
    }end

    //=========================================================================
    maps: {
    //=========================================================================
    while(1) {
    waitframe
    local.nextmapname = getcvar(nextmapname)
    local.mapnamesize = local.nextmapname.size
    local.mapnamesize -= 1

    for (local.i = 0; local.i <= local.mapnamesize; local.i ++ ) {
    if(local.nextmapname[local.i] == "_") {
    local.nextmapname[local.i] = " "
    }
    }
    }
    }end
    Last edited by Criminal; March 17th, 2019 at 03:51 PM.
    Github - Steam - .Crimewavez#5285

  5. #5

    Default

    you guys should test first before posting a code
    that mod is not made for Reborn servers. VSTR doesn't work in Reborn servers
    you will get an error like "Couldn't load maps/vstr x2.bsp"

    @Criminal, that code still could be nicer.

  6. #6

    Default

    It could, but at least tabs are ok now. :P
    Github - Steam - .Crimewavez#5285

  7. #7
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,603

    Default

    Generally speaking there's no need to huddraw every second, nub scripters did it back in the day because they didn't know why hud isn't drawn to players who join after script gets executed so they just keep drawing it every second.
    The ideal solution (before reborn) is to keep track of how many players are there and only draw when that count changes.
    The ideal solution (after reborn) is to listen to the spawned event and ihuddraw to that player who joined.
    Believe me it makes a huge performance gain, as an example shadow realized this in the anticham mod so he did some similar tweaks to fix it. And it became smoother than a baby's butt.
    Sorry for hijacking the thread tho.
    One last note: guys just compile a pk3 for the OP he clearly doesn't have any experience in this field. It would be nice to also ask what other mods he got there so we don't damage them.
    Last edited by RyBack; March 18th, 2019 at 01:51 AM.

  8. #8
    Senior Member verruguitens's Avatar
    Join Date
    Mar 2017
    Location
    Argentina
    Posts
    207

    Default

    Quote Originally Posted by DoubleKill View Post
    You put this in the config of the server:

    Code:
    //     Map Rotation Messages cvar section
    //
    // There are 6 messages shown
    //
    // 1.) sv_hostname
    // 2.) Server Ip
    // 3.) Server Admin Name
    // 4.) Gametype
    // 5.) Next Map with or without gametype ( with "nextmapname Destroyed_Village_TDM" Without "nextmapname Destroyed_Village")
    // 6.) Your website
    //
    //  NOTE: The last message in the string will be the first message shown.
    //
    // The message script will get your "sv_hostname" 
    // and the "Gametype" you don't need to add them.
    // 
    // Add the cvars below to your server.cfg.
    
    set website "YOUR WEB SITE HERE"
    set admin "ADMIN NAME HERE"
    set ip "SERVER IP"
    
    //      Message TIMES cvar section
    //
    //The plug time is set to start then show each 
    // message for 40 seconds then switch to next message. 
    //So all 6 messages will run every "5 Mins."  
        
    
    set plugtime "40" 
    
    //    THESE MUST STAY AS IS
    
    set nextmapname ""
    set plug ""
    
    //===================================================================================================================================================
          EXAMPLE VSTR SETTINGS 
    The "nextmapname" is for the "next" map 
    in rotation, not the first map played.       
    
    //Map Rotation Messages cvar section
    
    // The download URL for any custom maps on the server. Usualy your clan/group's website address.
    set website "www.thedeadheads.freeforums.org"
    
    set admin "{TDH} Nightstalker"
    
    set plugtime "49" 
    
    set ip "68.192.147.203"
    
    set nextmapname ""
    set plug ""
    
    set x1 "nextmapname Destroyed_Village_TDM; plug 1;set g_gametype 1;map dm/mohdm1; set nextmap vstr x2"           
    set x2 "nextmapname Remagen_TDM; plug 1;set g_gametype 2; timelimit 20; map dm/mohdm2; set nextmap vstr x3"         
    set x3 "nextmapname Crossroads_TDM; plug 1;set g_gametype 1;map dm/mohdm3; set nextmap vstr x4"           
    set x4 "nextmapname Snowy_Park_FFA; plug 1;set g_gametype 1;map dm/mohdm4; set nextmap vstr x5"           
    set x5 "nextmapname Stalingrad_RB; plug 1;set g_gametype 3;map dm/mohdm5; set nextmap vstr x6"            
    set x6 "nextmapname Algiers_TDM; plug 1;set g_gametype 1;map dm/mohdm6; set nextmap vstr x7"          
    set x7 "nextmapname The_Hunt_OBJ; plug 1;set g_gametype 2;map dm/mohdm7; set nextmap vstr x8"           
    set x8 "nextmapname V2_Rocket_Facility_OBJ; plug 1;set g_gametype 4;map obj/obj_team1; set nextmap vstr x9"   
    set x9 "nextmapname Omahaa_Beach_OBJ; plug 1;set g_gametype 4;map obj/obj_team2; set nextmap vstr x10"    
    set x10 "nextmapname The_Bridge; plug 1;set g_gametype 4;map obj/obj_team3; set nextmap vstr x11"  
    set x11 "nextmapname Stalingrad_FFA; plug 1;set g_gametype 4;map obj/obj_team4; set nextmap vstr x12" 
    set x12 "nextmapname Southern_France_FFA; plug 1;set g_gametype 1;map dm/mohdm6; set nextmap vstr x1"            
    
    
    set sv_maplist "" // leave it blank
    
    // loads the first map
    vstr x1
    This code in a script and call him on the Dmprecache:
    Code:
    main:
    
    thread maps
    
    	  local.plugtime = int(getcvar(plugtime))
    	  wait local.plugtime
    	  
    	  local.plug = int(getcvar(plug))
        local.sv_hostname = getcvar(sv_hostname) 
        local.g_gametypestring = getcvar(g_gametypestring)   
        local.admin = getcvar(admin)
    		local.website = getcvar(website)
    		local.ip = getcvar(ip)
    		local.nextmapname = getcvar(nextmapname)
    		
        level.hudstrings = ("Server IP: "+(local.ip)+"")::("ADMIN: "+(local.admin)+"")::("Current Game Type: "+(local.g_gametypestring)+"")::("NEXT MAP: "+(local.nextmapname)+"")::("Vist Us At "+(local.website)+"")::("Welcome To "+(local.sv_hostname)+"")  		
        local.start = int( level.hudstrings.size ) 
    
    
        while(1)
        {
        waitframe
        wait 1.0                                                         
        huddraw_alpha 14 1                                                                               
        huddraw_color 14 0.0 1.0 1.0                                       
        huddraw_rect 14 325 -25 1 1                                 
        huddraw_align 14 left bottom                                     
        huddraw_string 14 level.hudstrings[local.start]
    
        wait local.plugtime     
    
        huddraw_alpha 14 0                                                     
        local.start++
        if(local.start > level.hudstrings.size)             
        local.start = 1
        }
    end
    
    maps:
    
    	while(1)
    	{
    		waitframe
        
    		local.nextmapname = getcvar(nextmapname)
    		local.mapnamesize = local.nextmapname.size
    		local.mapnamesize -= 1
    
    		for (local.i = 0; local.i <= local.mapnamesize; local.i ++ )
    		{
    			if(local.nextmapname[local.i] == "_")
    			{
    			local.nextmapname[local.i] = " "
    
    			}
    			
    		}
    		
      }
          
    end
    DoubleKill, the "dmprecache" file in official maps, which pk3 need open? "pak6"?, "pak7"? which? please help`!

  9. #9
    Developer Todesengel's Avatar
    Join Date
    Dec 2013
    Location
    St. Louis, Missouri, USA
    Posts
    276

    Default

    Quote Originally Posted by verruguitens View Post
    DoubleKill, the "dmprecache" file in official maps, which pk3 need open? "pak6"?, "pak7"? which? please help`!
    dmprecache.scr exists in pak0. However, you probably have a pak6 where it appears again. It may be in pak7 (and remember the highest numbered pak file wins unless you have a local directory {not inside a pk3 file}).
    I strongly suggest that you create a directory called 'global' off your main, and put the dmprecache.scr from pak6 (or pak7, if you have a pak7 and there is a dmprecache in it) there. Then, you only need to make changes to the one in ~mohaa/main/global as it 'wins'. Assuming AA.
    Last edited by Todesengel; April 8th, 2019 at 01:13 PM. Reason: I was using typognese

  10. #10
    Senior Member verruguitens's Avatar
    Join Date
    Mar 2017
    Location
    Argentina
    Posts
    207

    Default

    Quote Originally Posted by Todesengel View Post
    dmprecache.scr exists in pak0. However, you probably have a pak6 where it appears again. It may be in pak7 (and remember the highest numbered pak file wins unless you have a local directory {not inside a pk3 file}).
    I strongly suggest that you create a directory called 'global' off your main, and put the dmprecache.scr from pak6 (or pak7, if you have a pak7 and there is a dmprecache in it) there. Then, you only need to make changes to the one in ~mohaa/main/global as it 'wins'. Assuming AA.
    U can help me with HUD MESSAGE Todesengel?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •