Raised This Month: $32 Target: $400
 8% 

[ANY] Players count in hostname


Post New Thread Reply   
 
Thread Tools Display Modes
Author
D1maxa
Member
Join Date: Dec 2008
Plugin ID:
1642
Plugin Version:
1.21
Plugin Category:
Statistical
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    This plugin changes name of server to show current count of players, players limit and version
    Old 05-05-2010 , 04:21   [ANY] Players count in hostname
    Reply With Quote #1

    Description:
    This plugin changes name of server to show current count of players and players limit.
    Example:


    Cvar:
    sm_formatted_hostname "My Server %d/%d" where first %d - current count of players, second %d - value of sv_visiblemaxplayers
    Version 1.2:
    sm_formatted_hostname "My Server %d/%d (%s)" where last %s - server version (plugin gets it from PatchVersion in steam.inf), very useful for L4D2 server that is updated every week
    History:
    1.2 - Added version in hostname
    1.11 - Correct name after start of server
    1.1 - Added checking for bots in OnClientConnected
    1.0 - First version
    Attached Files
    File Type: sp Get Plugin or Get Source (playerscount_in_hostname.sp - 2812 views - 1.4 KB)
    File Type: sp Get Plugin or Get Source (playerscount_version_in_hostname.sp - 1810 views - 2.0 KB)

    Last edited by D1maxa; 11-12-2010 at 14:30. Reason: Added server with dynamic name
    D1maxa is offline
    Scone
    Senior Member
    Join Date: Apr 2010
    Location: England
    Old 05-05-2010 , 13:36   Re: Players count in hostname
    Reply With Quote #2

    In the OnClientConnected function you aren't checking whether the player is a bot, but then you do check in OnClientDisconnect. What's going on?

    Also, instead of requiring the user to manually set the number of slots, this could be detected directly (the "maxplayers" convar iirc).
    __________________
    Scone is offline
    D1maxa
    Member
    Join Date: Dec 2008
    Old 05-06-2010 , 02:54   Re: Players count in hostname
    Reply With Quote #3

    1) On L4D server OnClientConnected isn't called for bots (don't know about other games)
    2) Users don't manually set the count of players and number of slots:
    "My Server %d/%d" => "My Server 5/8"
    "%d/%d my server" => "5/8 My server"
    only formatted string
    is it clear?
    D1maxa is offline
    Scone
    Senior Member
    Join Date: Apr 2010
    Location: England
    Old 05-06-2010 , 06:56   Re: Players count in hostname
    Reply With Quote #4

    I see - thanks for clarifying!
    __________________
    Scone is offline
    psychonic

    BAFFLED
    Join Date: May 2008
    Old 05-06-2010 , 10:36   Re: Players count in hostname
    Reply With Quote #5

    Quote:
    Originally Posted by D1maxa View Post
    1) On L4D server OnClientConnected isn't called for bots (don't know about other games)
    OnClientConnected works fine for bots in other games and should fire in L4D/2 for all playable special infected (boomer, spitter, hunter, tank, smoker, charger, jockey). If it does not, it's a bug.
    psychonic is offline
    D1maxa
    Member
    Join Date: Dec 2008
    Old 05-08-2010 , 11:08   Re: Players count in hostname
    Reply With Quote #6

    Added checking for bots in OnClientConnected
    D1maxa is offline
    Eraa
    Senior Member
    Join Date: Mar 2010
    Old 05-08-2010 , 11:24   Re: Players count in hostname
    Reply With Quote #7

    Thanks you ;)
    Eraa is offline
    Searcher64
    Senior Member
    Join Date: Apr 2010
    Old 06-02-2010 , 16:41   Doesn't work?
    Reply With Quote #8

    I set sm_formatted_hostname "Versus %d/%d" in my server.cfg, and then started dedicated server. Instead of the cvar name, the name was dedicated server (default). Help?

    edit: the name changes to Versus %d/%d when a player joins, but when a player hasn't joined the newly-made dedicated server, it is still the default name.

    Last edited by Searcher64; 06-03-2010 at 06:11. Reason: more info
    Searcher64 is offline
    meng
    Veteran Member
    Join Date: Oct 2005
    Location: us
    Old 06-03-2010 , 00:28   Re: Players count in hostname
    Reply With Quote #9

    Quote:
    Originally Posted by psychonic View Post
    OnClientConnected works fine for bots in other games and should fire in L4D/2 for all playable special infected (boomer, spitter, hunter, tank, smoker, charger, jockey). If it does not, it's a bug.
    I think its a bug. I remember it being an issue for me recently. Filed here.
    __________________
    .
    [ 1 Dumerils Boa | 1 Cali King ]...
    .
    I'm a lil' spirituous.
    meng is offline
    Send a message via Yahoo to meng
    D1maxa
    Member
    Join Date: Dec 2008
    Old 11-02-2010 , 04:23   Re: Players count in hostname
    Reply With Quote #10

    Updated, now plugin can add PatchVersion to hostname
    D1maxa is offline
    Reply



    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 21:56.


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