AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Timeleft Hostname (https://forums.alliedmods.net/showthread.php?t=61221)

Hell Phoenix 09-24-2007 12:26

Timeleft Hostname
 
5 Attachment(s)
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!

ferret 09-24-2007 12:43

Re: Timeleft Hostname
 
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.

ferret 09-24-2007 12:44

Re: Timeleft Hostname
 
Also, you need to kill the timer OnMapEnd... Your current setup will continuously recreate the timer OnMapStart without ever stopping the original timer.

Hell Phoenix 09-24-2007 13:02

Re: Timeleft Hostname
 
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!

ferret 09-24-2007 13:03

Re: Timeleft Hostname
 
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)

Hell Phoenix 09-24-2007 13:22

Re: Timeleft Hostname
 
Gotcha. Thanks for the info =D

Hell Phoenix 09-24-2007 13:27

Re: Timeleft Hostname
 
Updated to 1.1 to fix the mapend timer kill =D

wraithcss 09-24-2007 14:14

Re: Timeleft Hostname
 
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.

Hell Phoenix 09-24-2007 16:13

Re: Timeleft Hostname
 
Possibly, would have to look into it. I dont know where those values are stored since I dont run a CS server.

bakedbean 09-25-2007 06:31

Re: Timeleft Hostname
 
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.


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

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