Results 1 to 8 of 8

Thread: Server message to bottom of screen

  1. #1

    Default Server message to bottom of screen

    I want to add a server message saying "Join our discord server" in a green color.
    Is there a mod I can download and place in my main folder?

  2. #2

  3. #3

    Default

    if you search on forum you will find something about that.

  4. #4
    Senior Member beroo's Avatar
    Join Date
    Dec 2017
    Location
    Cairo
    Posts
    108

    Default

    Code:
    level.message = getcvar "message"
    if(level.message == "1")
    {
    
    thread message
    
    }
    else
    {
    if(level.message == "0")
    
    level.message = 0
    
    }	
    
    end
    
    message:
    
    while(1)
    {
    huddraw_alpha 200 1
    huddraw_font 200 "facfont-20"
    huddraw_color 200 0 1 0 // change color here
    huddraw_align 200 "center" "bottom"
    huddraw_rect 200 1 -86 260 1
    huddraw_string 200 " Type ur Message "
    wait 1
    }
    
    end
    save this into txt file and rename it to "message.txt" then put it in pk3 file or in Global folder then add this in ur server.cfg file
    Code:
    set message "1"
    then add this line into DMprecache
    Code:
    exec global/message.txt
    noting:- try to read some topics about what u want first cuz if u adopt us we will help u, but u will not help yourself to collect some knowlage about how u can do it by yourself in next time.
    You will be like someone who saves and does not understand. but i'm gonna help u cuz this is the first thread to u
    Last edited by beroo; September 30th, 2018 at 12:39 PM.
    Greetings :-{[T_P]}- BeroO -{[CF]}-
    the-pharaohs.enjin.com

  5. #5

    Default

    Cheers, beroo. A few redundancies in the code though, which may just confuse people who aren't used to scripting. No need to wait 0 seconds or have the second if statement. Always good to make sure the lines are indented too.


    start:
    if(getcvar "message" == "1")
    {
    while(1)
    {
    huddraw_alpha 200 1
    huddraw_font 200 "facfont-20"
    huddraw_color 200 0 1 0 // change color here
    huddraw_align 200 "center" "bottom"
    huddraw_rect 200 1 -86 260 1
    huddraw_string 200 " Type ur Message "
    wait 1
    }
    }
    end
    Last edited by 1337Smithy; September 30th, 2018 at 10:36 AM.

  6. #6
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,257

    Default

    It was already said that it's better not to loop all the time to print static text that never changes. It's much better to use Reborn event handlers to re-display the message everytime someone connets to the server and do it once and not in an infinite loop.

  7. #7

    Default

    Yup, definitely. Someone who knows Reborn can send them in the right direction.

  8. #8

    Default

    Thank you for your replies, appreciate the help

Posting Permissions

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