Raised This Month: $12 Target: $400
 3% 

Timeleft Hostname


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Hell Phoenix
Senior Member
Join Date: Jan 2005
Plugin ID:
191
Plugin Version:
1.3
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    14 
    Plugin Description:
    It grabs the timeleft for the map, and puts it into the hostname so people can see how much time is left on the current map.
    Old 09-24-2007 , 12:26   Timeleft Hostname
    Reply With Quote #1

    Timeleft Hostname
    Hell Phoenix
    http://www.charliemaurice.com/plugins

    Description:
    This is a port of Cheap_Suit's amxx plugin to sourcemod. It grabs the timeleft for the map, and
    puts it into the hostname so people can see how much time is left on the current map. Note that
    because of how the source engine works, this doesnt work until someone joins the server.

    Thanks To:
    Cheap Suit - for the original plugin
    Ferret for pointing out some things to fix =D

    Versions:
    1.0
    * First Public Release!
    1.1
    * Added missing mapend timer kill
    1.2
    * Fixed errors in the console
    1.3
    * Fixed frequency cvar not doing anything if set


    Cvars:
    sm_timeleft_hostname_frequency 2.0 - How often in seconds to update the hostname with timeleft
    ****You MUST set this in a config such as sourcemod.cfg or server.cfg...it cannot be changed
    "on the fly"

    Make sure you are using at least 1474 of sourcemod!
    Attached Files
    File Type: sp Get Plugin or Get Source (timeleft_hostname.sp - 6301 views - 2.4 KB)
    __________________

    Last edited by Hell Phoenix; 10-05-2007 at 10:16.
    Hell Phoenix is offline
    ferret
    SourceMod Developer
    Join Date: Dec 2004
    Location: Atlanta, GA
    Old 09-24-2007 , 12:43   Re: Timeleft Hostname
    Reply With Quote #2

    Not really an issue at all but!

    Code:
    GetMapTimeLeft(timeleft);
     if (timeleft <= 0)
    Could be

    Code:
    if (!GetMapTimeLeft(timeleft) && timeleft <= 0)
    GetMapTimeLeft returns true or false based on if the mod supports it, so it might be better to rely on that.
    __________________
    I'm a blast from the past!
    ferret is offline
    ferret
    SourceMod Developer
    Join Date: Dec 2004
    Location: Atlanta, GA
    Old 09-24-2007 , 12:44   Re: Timeleft Hostname
    Reply With Quote #3

    Also, you need to kill the timer OnMapEnd... Your current setup will continuously recreate the timer OnMapStart without ever stopping the original timer.
    __________________
    I'm a blast from the past!
    ferret is offline
    Hell Phoenix
    Senior Member
    Join Date: Jan 2005
    Old 09-24-2007 , 13:02   Re: Timeleft Hostname
    Reply With Quote #4

    I thought all plugins are unloaded at map change?

    I tried changing the getmaptimeleft, but it gave me some undesirable effects. Its a good idea though, I will try and see why it is acting weird (it gave me a timeleft of something weird when it shouldnt have even run yet because nobody had joined the server).

    Thanks!
    __________________
    Hell Phoenix is offline
    ferret
    SourceMod Developer
    Join Date: Dec 2004
    Location: Atlanta, GA
    Old 09-24-2007 , 13:03   Re: Timeleft Hostname
    Reply With Quote #5

    Plugins are unloaded at map change in AMXX.

    In SM, they are only unloaded if they are told to, or if they change. (This means your globals are also persistant across map changes, fyi)
    __________________
    I'm a blast from the past!
    ferret is offline
    Hell Phoenix
    Senior Member
    Join Date: Jan 2005
    Old 09-24-2007 , 13:22   Re: Timeleft Hostname
    Reply With Quote #6

    Gotcha. Thanks for the info =D
    __________________
    Hell Phoenix is offline
    Hell Phoenix
    Senior Member
    Join Date: Jan 2005
    Old 09-24-2007 , 13:27   Re: Timeleft Hostname
    Reply With Quote #7

    Updated to 1.1 to fix the mapend timer kill =D
    __________________
    Hell Phoenix is offline
    wraithcss
    Member
    Join Date: Sep 2007
    Old 09-24-2007 , 14:14   Re: Timeleft Hostname
    Reply With Quote #8

    This is a great plugin. I have added commands to my supermenu extensions when certain game modes are launched (GunGame, Zombie Mode, DeathMatch, etc) that changes the hostname to inform joining players we're running a game vs normal pub play.

    Is it possible to recode this as a hostname manager and include the current time left on a map, AND the current mode of play? It could key off the reg names of the popular game modes: GunGame, RPG:Mod, CSSDM, Zombie Mod, etc - with a variable front name cvar in a config file:

    The hostname would always be: XYZ Clan Server - Variable Game Mode 1 - Time Remaining 12min

    Or something similar.
    wraithcss is offline
    Hell Phoenix
    Senior Member
    Join Date: Jan 2005
    Old 09-24-2007 , 16:13   Re: Timeleft Hostname
    Reply With Quote #9

    Possibly, would have to look into it. I dont know where those values are stored since I dont run a CS server.
    __________________
    Hell Phoenix is offline
    bakedbean
    Junior Member
    Join Date: Dec 2005
    Old 09-25-2007 , 06:31   Re: Timeleft Hostname
    Reply With Quote #10

    Nice plugin. One problem. Without plugin and standard ones in the sm package on empty server cpu is 0.00 with this plugin on empty server it jumps to 8.90 - 11.0. This is on a dedicated server.

    Maybe have a cvar to limit the amount it reports that can be set. every 30 seconds or every minute etc.
    bakedbean is offline
    Reply


    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 19:48.


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