Raised This Month: $ Target: $400
 0% 

[L4D & L4D2] Set Server Name


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author
MoRanYue
Member
Join Date: Dec 2024
Location: Fuzhou, Fujian, China
Plugin ID:
8899
Plugin Version:
1.0.2
Plugin Category:
Server Management
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    24 
    Plugin Description:
    Set the server name with format text and add UTF-8 characters.
    Old 02-13-2025 , 00:54   [L4D & L4D2] Set Server Name
    Reply With Quote #1

    Description:

    A lot of server owners set their server name with their own language, but SRCDS console does not like direct UTF-8 characters.

    I found 2 snippets of source code, one allows users to hard-encode their server name and the other allows users to write theirs in a file. However, this plugin have more general method: similar to Minecraft servers, allows Unicode code points in server name.

    To use this plugin, what you need to do is CVar ssn_host_name. You need some tools to convert the characters that SRCDS console does not accept (Chinese, Japanese, Korean and so on) to code points. (For eample, the code points of "求生之路" (Chinese translation of "Left 4 Dead") are "\u6c42\u751f\u4e4b\u8def"), the plugin will convert the code points in that CVar to actual character.
    By the way, you can add text "{id}" to CVar ssn_host_name, if you set up multiple servers on the same machine and their ports are continuous, with ssn_first_port, you can easily get incrementing server number.

    Installation:
    1. Download set_server_name.smx below and put it in your servers /addons/sourcemod/plugins/.
    2. Start your server and edit cfg/sourcemod/set_server_name.cfg.

    CVars:

    PHP Code:
    // 0 will disable the plugin, other number will enable it.
    ssn_is_enabled "1"

    // It affects {id} format item. {id} = 'ssn_first_id + hostport - ssn_first_port'.
    ssn_first_port "27015"

    // It affects {id} format item. {id} = 'ssn_first_id + hostport - ssn_first_port'.
    ssn_first_id "1"

    // Server name format string. {id} = Server number
    ssn_host_name "Left 4 Dead 2 Server" 
    Attached Files
    File Type: smx set_server_name.smx (5.0 KB, 49 views)
    File Type: sp Get Plugin or Get Source (set_server_name.sp - 65 views - 4.7 KB)
    __________________
    Hello! Were you happy today?

    I'm just new to Sourcemodding, and just creating plugins and addons for L4D2.
    Contact links: Steam | GitHub | Email
    Some plugins: New Left 4 Chat 2

    Last edited by MoRanYue; 04-03-2025 at 22:01. Reason: Memory optimization and more safety check
    MoRanYue is offline
     


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 10:12.


    Powered by vBulletin®
    Copyright ©2000 - 2025, vBulletin Solutions, Inc.
    Theme made by Freecode