PDA

View Full Version : Timeleft Hostname


Hell Phoenix
09-24-2007, 12:26
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
Not really an issue at all but!

GetMapTimeLeft(timeleft);
if (timeleft <= 0)

Could be

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
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
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
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
Gotcha. Thanks for the info =D

Hell Phoenix
09-24-2007, 13:27
Updated to 1.1 to fix the mapend timer kill =D

wraithcss
09-24-2007, 14:14
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
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
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.

ferret
09-25-2007, 08:42
You should disable your timer when the last player disconnects. That should allow the server to fall back into an idle state.

Hell Phoenix
09-26-2007, 10:20
Thats strange, I have it on my server and dont see any cpu usage increase.

There actually is a cvar to control how often it updates. By default its every 2 seconds.

sm_timeleft_hostname_frequency 2.0
^ that is the default.

jones ray
09-26-2007, 13:26
cpu usage here FINE as well :P

J@y-R
09-26-2007, 22:05
Hello

I find this in my sourcemod log's

L 09/27/2007 - 01:34:39: [SM] Native "CloseHandle" reported: Handle 0 is invalid (error 4)
L 09/27/2007 - 01:34:39: [SM] Displaying call stack trace for plugin "timeleft_hostname.smx":
L 09/27/2007 - 01:34:39: [SM] [0] Line 71, /home/groups/alliedmodders/forums/files/3/7/6/4/20404.attach::OnMapEnd()
L 09/27/2007 - 01:34:39: [SM] Native "CloseHandle" reported: Handle 0 is invalid (error 4)
L 09/27/2007 - 01:34:39: [SM] Displaying call stack trace for plugin "timeleft_hostname.smx":
L 09/27/2007 - 01:34:39: [SM] [0] Line 76, /home/groups/alliedmodders/forums/files/3/7/6/4/20404.attach::OnPluginEnd(

JaY

Hell Phoenix
09-27-2007, 13:40
Whoops...sorry about that. Get the new version, it fixes the errors.

1.2
* Fixed errors in the console

-=CsFF=- Eagle
10-03-2007, 08:59
Hi there,

the cvar sm_timeleft_hostname_frequency seems not to work. Set them to another time ex. 5 and it change every 2 seconds the name.
Thanks for your work

Eagle

Hell Phoenix
10-03-2007, 10:12
Hmmm...I will look into that. Thanks for the report =D

Falco
10-04-2007, 00:34
Getting this error:L 10/03/2007 - 18:57:32: [SM] Native "CloseHandle" reported: Handle 27c0124 is invalid (error 3)
L 10/03/2007 - 18:57:32: [SM] Displaying call stack trace for plugin "timeleft_hostname.smx":
L 10/03/2007 - 18:57:32: [SM] [0] Line 81, /home/groups/alliedmodders/forums/files/3/7/6/4/20404.attach::OnPluginEnd()

Hell Phoenix
10-04-2007, 10:34
OK, I have the cvar working...I will post the version later today hopefully after I hear back from Falco.

Falco, when are you getting that error? I cant reproduce it after version 1.2.

Falco
10-04-2007, 18:04
I have not received the error for 16hrs now. I removed the bots. It appears to be related to that possibly.
Win server
Meta list

[01] FPS Boost 1.0 sslice RUN
[02] SourceMod 1.0.0.153 AlliedModders LLC RUN
[03] SteamBans Detox 1.1 sslice/opi RUN
[04] Statsmeminimum Plug 1.3.0.10 Roger Devil RUN
[05] GlitterMod 1.3.0.14 Roger Devil RUN
[06] CS:S Tools 1.0.0.147 AlliedModders RUN
[07] SDK Tools 1.0.0.152 AlliedModders LLC RUN
[08] Hacks Extension 1.3.0.0 Knagg0 RUN

sm plugins list

6:01:12 [SM] Listing 40 plugins:
01 "1v1" (1.0) by dalto
02 "Admin Auth" (1.0.0.0) by AlliedModders LLC
03 "Admin File Reader" (1.0.0.1533) by AlliedModders LLC
04 "SQL Admins (Threaded)" (1.0.0.1533) by AlliedModders LLC
05 "Admin Help" (1.0.0.1533) by AlliedModders LLC
06 "Admin loggin" (1.0) by vIr-Dan
07 "Aimbot Detection" (0.0.1.0) by devicenull
08 "Anti-Flood" (1.0.0.1533) by AlliedModders LLC
09 "Advanced Team Attack Control" (1.3.3) by FlyingMongoose
10 "Bad name ban" (1.4) by vIr-Dan
11 "Basic Chat" (1.0.0.1533) by AlliedModders LLC
12 "Basic Comm Control" (1.0.0.1533) by AlliedModders LLC
13 "Basic Commands" (1.0.0.1533) by AlliedModders LLC
14 "Basic Fun Commands" (1.0.0.1533) by AlliedModders LLC
15 "Basic Fun Votes" (1.0.0.1533) by AlliedModders LLC
16 "Basic Info Triggers" (1.0.0.1533) by AlliedModders LLC
17 "Basic Votes" (1.0.0.1533) by AlliedModders LLC
18 "Bot Ping" (1.0.0) by Knagg0
19 "Bounty" (1.0.9.0) by Shane A. ^BuGs^ Froebel, FlyingMongoose, and stoic
20 "Basic Server Crontab" (1.0.0.2b) by dubbeh
21 "Cheer!" (1.2) by dalto
22 "Country Filter" (1.0.0) by Knagg0
23 "Healthkit On Death" (1.3.0) by Knagg0
24 "HLstatsX Plugin" (1.6) by Tobi17
25 "Nextmap" (1.0.0.1533) by AlliedModders LLC
26 "QuakeSounds" (1.6) by AMP
27 "RateChecker" (0.2) by pRED*
28 "Reserved Slots" (1.0.0.1533) by AlliedModders LLC
29 "Sm_Cash" (1.2) by ferret
30 "SM Super Commands" (0.51) by pRED*
31 "SM Super Menu" (0.4) by pRED*
32 "SourceBans" (g) by SteamFriends Development Team
33 "SQL Admin Manager" (1.0.0.1533) by AlliedModders LLC
34 "Team Bets" (1.4) by ferret
35 "Timeleft Hostname" (1.2) by Hell Phoenix
36 "WeaponRewards ADVANCED" (2.0.0) by FlyingMongoose/theY4Kman
37 "Weapon Logging" (1.5) by Tobi17
38 "Web Shortcuts" (1.0.1) by James "sslice" Gray
39 "Word Filter Plugin" (1.1) by Tobi17
40 "YeGods High Ping Remover" (1.0.0.4) by dubbeh

Hell Phoenix
10-05-2007, 10:17
The error isnt a fatal error if you do get it, so its not hurting anything if it is because of the bots.

I posted up the new version:

1.3
* Fixed frequency cvar not doing anything if set

Falco
10-05-2007, 18:22
Perfect, thanks. ;)

<DieSel>
01-21-2008, 21:31
Using in Insurgency, no problems.

Solarcaine
05-19-2008, 05:43
Thank you I've had this running on my server for my Insurgency Server for a while now.

MaKTaiL
08-12-2008, 12:46
Is there a way of changing from (30:00) to [30:00] or something else??

I think you should add a command to change this thing. Just an idea ^^.

Bye Bye

r3dh3adkid
08-12-2008, 13:34
Here you go, I think that will work. I haven't tested it myself (yet) but I think it will.

ulx
08-12-2008, 13:59
Here you go, I think that will work. I haven't tested it myself (yet) but I think it will.

works perfect - thx:up:

MaKTaiL
08-12-2008, 15:01
Here you go, I think that will work. I haven't tested it myself (yet) but I think it will.

Thanks man, I love you xDDDD.

MaKTaiL
08-12-2008, 16:22
Is there a way to put only the timeleft between the [] and with spaces??? This way the name of the server doesn't get too long and still looks nice. Sorry for the inconvenience ^^.
You could do a cfg or command to change this type of things to fit everybody which.

Exemple: MaKTaiL Server [ 30:00 ]. <------------------------> Look, there are spaces between the [].

RM_Hamster
08-12-2008, 16:28
This version should do that.

I'm going to rewrite this plugin and add some stuff to it (yay my first plugin!). Coming soon :)

MaKTaiL
08-12-2008, 16:32
This version should do that.

I'm going to rewrite this plugin and add some stuff to it (yay my first plugin!). Coming soon :)

Man, thank you. Good luck with the rewrite. I will look forward to it ^^.
Don't forget to put a config or command to change this type of things I have asked.

Bye.

MaKTaiL
08-16-2008, 17:03
Where is your new plugin? I enter in the foruns everyday looking forward to it.

GOGOGOGOGO xDDD

Atreus
08-20-2008, 23:56
I'd love to to see this, but with rounds left.

MaKTaiL
08-21-2008, 17:23
I'd love to to see this, but with rounds left.

This is already being made in the Dynamic Hostname a completely rewrite of Timeleft Hostname.

igroman
02-21-2012, 11:23
win 7, error
not found MSVCP100.dll

bebe9b
05-20-2014, 12:28
Salut ,

You can make it appear LAST ROUNDE

Multumesc,