Day of Defeat Plugins Community
This site is an archive — everything is readable and downloadable, nothing can be posted. Admin

Server Name / Score for Clan Match

by Zor · 2014-02-22 · 50 replies · 22190 views · 20 downloads

Read the thread (51 posts)

From the first post

Good day,
n
nThis is a copy from another thread that was done by Wilson. Its untested but hope it works.
n
nCheers!
n
nCVAR:
ndod_scoreservername - The Short Server Name
n
neg: 'Hulus Fun House' will come out as: 'Hulus Fun House (Allies: 0 - Axis: 0)'
n
nVersioning:
n
0.1 - Be! (by Willson)n	0.2 - Be! a plugin by Zorn	0.3 - Fixed to using server command instead of updating the hostnamen	0.4 - Fixed to run plugin on join / quit / spawnn	     - Moved update to own sectionn	0.5 - Refixed score update to use built in DoD client_score methodn        0.6 - Added set timer task derived from: MasterWanger @ n                [url]https://forums.alliedmods.net/showthread.php?t=21127[/url]n		as identified by: sparky99

n
nCheers!

Files

dod_servername_score.sma Plugin Source 2 KB 20 dl Download Compile

The thread

All 51 posts from 5 people on Server Name / Score for Clan Match, kept as they were written.

Zor
started this thread
Posts: 688
Threads: 75
Joined: Jun 2006
02-22-2014, 12:10 AM #1

Good day,nnThis is a copy from another thread that was done by Wilson. Its untested but hope it works.nnCheers!nnCVAR:ndod_scoreservername - The Short Server Name nneg: 'Hulus Fun House' will come out as: 'Hulus Fun House (Allies: 0 - Axis: 0)'nnVersioning:n

0.1 - Be! (by Willson)n	0.2 - Be! a plugin by Zorn	0.3 - Fixed to using server command instead of updating the hostnamen	0.4 - Fixed to run plugin on join / quit / spawnn	     - Moved update to own sectionn	0.5 - Refixed score update to use built in DoD client_score methodn        0.6 - Added set timer task derived from: MasterWanger @ n                [url]https://forums.alliedmods.net/showthread.php?t=21127[/url]n		as identified by: sparky99n
nnCheers!

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
02-22-2014, 04:36 AM #2

Awesome!~! Thanks Zor!rnrnThis is exactly what I needed.rnrnDoes anybody know of a plugin for Adminmod or Metamod though? I don't have AMXX mod installed and would rather not install it if I can avoid it??

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
02-22-2014, 05:31 AM #3

Actually, will AMXX mods work with AMX?

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
02-22-2014, 09:07 PM #4

Ok, I got AMXX installed and working. I tried your plugin Zor - it doesn't do anything :(nnEdit: Actually, it does work. The CVAR shows up in console and can be modified. However, it doesn't actually show up on the scoreboard? :( It did work once, but after I reset the server it had stopped working for some reason :(nnAny ideas?

Zor
started this thread
Posts: 688
Threads: 75
Joined: Jun 2006
02-25-2014, 08:02 AM #5

Try getting the log to me and restarting the plugin.rnCheers!

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
02-25-2014, 10:49 PM #6

Ok, I did some more testing and it does in fact work - but the server needs to 'changelevel' once before it will actually show. In addition, it also affects the servername that is shown on the MOTD upon joining.nnIdeally, we don't want to have to changelevel in order to get it to show. nnIs there any way around these two issues?? Many thanks for your help Zor...

Zor
started this thread
Posts: 688
Threads: 75
Joined: Jun 2006
02-28-2014, 05:16 PM #7

Well if you mean that when you start the server up it doesn't show until the map has been changed, well I would say the best bet is to change the map after restart and then leave the server alone.rnrnAs for it showing up in the MOTD, not much can be done about that as the MOTD uses the same variable, servername.rnrnI would ask for you to clarify exactly what you want done in this thread please so I can mayhap make changes.rnrnCheers!

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
02-28-2014, 09:23 PM #8

Thanks very much Zor!nnYes, that's what I meant - when I first start the server (listenserver, btw) it just shows the servername in the scoreboard, without the teamscores. The plugin doesn't actually take effect until I changelevel to another map, at which point it actually starts working. Is there no way around this? Do you know why it does this?nnI understand now that nothing can be done about it showing up in the MOTD though.

Zor
started this thread
Posts: 688
Threads: 75
Joined: Jun 2006
03-04-2014, 02:28 PM #9

Ok, I added the register_plugin, that may actually help. Not sure, I was trying to find out what function that was called when server starts, but can't remember / find it.rnrnSo let me know how that helped?

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
03-05-2014, 05:15 AM #10

Hmmm, same issue unfortunately.nnI remember I used to have a plugin for this many years ago - worked exactly the same as yours, but it worked straight away without needing to changelevel. Surely nothing drastic has changed in the architecture of the console/engine during that time? I wonder what could be causing it...nnDo you have any other ideas Zor??

Zor
started this thread
Posts: 688
Threads: 75
Joined: Jun 2006
03-05-2014, 01:22 PM #11

Best thing I can come up with is that you should set the cvar dod_scoreservername in the amxx.cfg, maybe that will kick start the plugin.rnrnCheers!

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
03-06-2014, 01:51 AM #12

For example, simply adding:nndod_scoreservername "Servernamehere"nnat the bottom of the amxx.cfg?nnEdit: Tried this anyway, no difference. Thanks anyway, Zor

Zor
started this thread
Posts: 688
Threads: 75
Joined: Jun 2006
03-07-2014, 11:35 PM #13

Installed a server on my linux box, will see what I can figure out...might have to do with you using a listenserver.rnrnCheers!

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
03-08-2014, 01:25 AM #14

Yeah possibly, maybe that's the reason why?rnrnAgain, it seems odd... I guess it's got something to do with the fact that this plugin affects the actual hostname directly

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
03-14-2014, 06:24 AM #15

Ok....well after all that, the scoreboard doesn't even work anyway - the plugin appears, but the score itself doesn't change from 0 - 0.nnI tested it properly for the first time in a real game last night, and while the plugin does display on the scoreboard, the teamscore doesn't actually change from 0 - 0. I posted on another forum (alliedmodders), and they are suggesting that this is because the hostname isn't able to change during a game??

Zor
started this thread
Posts: 688
Threads: 75
Joined: Jun 2006
03-18-2014, 10:17 AM #16

Sorry Im afraid not. I have no server to test, and work, wife and school take most of my time up. So I haven't had time to tweak my linux box server to test.rnrnCheers!

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
03-20-2014, 08:19 PM #17

Understandable! Thanks for your helps anyway

Zor
started this thread
Posts: 688
Threads: 75
Joined: Jun 2006
03-21-2014, 08:57 PM #18

No problem, if you can find another version from another site, such as amx or amxmod or even metamod, etx, let me know. I will see what I can do once I have more time.rnrnCheers!

S sparky99
posted here
Posts: 263
Threads: 49
Joined: Jan 2006
03-24-2014, 01:37 AM #19
Zor
started this thread
Posts: 688
Threads: 75
Joined: Jun 2006
03-24-2014, 07:19 AM #20

Thanks, I have looked at the code in that one and updated it accordingly, please let me know if it works and I can move it to the server admin section!rnrnCheers!

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
03-25-2014, 05:19 AM #21

Great, I've got the updated plugin and will test is this weekend hopefully.nnI'll report back ASAP!nnThanks so much!

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
03-25-2014, 05:52 AM #22

Alright, bad news unfortunately.nnI tested it, and it's still borked. The core functionality doesn't work.nnAccording to the link sparky provided, the servername is supposed to update when 1) someone joins the server, 2) whenever the round is wonnnFirstly, neither of these things happen. I still need to use 'changelevel' after I have created the server in order to get the plugin to display on the scoreboard. It doesn't update the hostname when someone joins or when the round is won. nnSecondly - the plugin itself is basically unusable as it doesn't parse/read the scoring info properly. What happened was, I won a round and then used 'changelevel' in order to get the hostname (and therefore the scoreboard plugin) to update. Upon changing level, the hostname was "Lan Dod - Allies 53 - Axis 0". So clearly, the plugin 'works' to some degree, but it doesn't read the scoring info properly (and even if it did, it would be useless right now as it doesn't update every round)nnI believe that Dod uses a slightly more complex scoring method. A team gets a certain number of points per flag cap, I believe. Or maybe it's points based on time depending on number of flags held. It tallies these to give an overall 'score', rather than a simple victory count such as 3-1 or whatever.

Zor
started this thread
Posts: 688
Threads: 75
Joined: Jun 2006
03-26-2014, 07:21 AM #23

Ok:rn0.4 - Fixed to run plugin on join / quit / spawnrn - Moved update to own sectionrnrnThis update is more along the lines of the one you pointed me at, I cleaned it up and made it more dod friendly.rnrnHope it helps!rnCheers!

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
03-26-2014, 04:14 PM #24

Ok many thanks Zor!! I'll try it out and report back

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
03-26-2014, 04:30 PM #25

Alright, so I tested the plugin.nnThe good news: it works upon starting the server! (Maybe it started working the moment I spawned, I didn't check - but it works without needing to changelevel, which is awesome)nnThe bad news: I tried winning a couple of rounds, but the score didn't change, it stayed at zero. The native/inbuilt scoreboard still said "axis 53" after winning one round though. I even tried using 'changelevel' to force it to update, but it still didn't do anything (of course, this would have been useless anyway but i just did it to try and see if it would actually update)

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
03-27-2014, 05:26 AM #26

Alright, I did some investigating, and figured out how the scoring system works.nnThis is taken from the DoD:Source manual (but I believe it's the same for DoD anyway):nnTeams receive one point per flag captured. One point is also awarded to every individual who participated in the capture. A team receives 50 points for capturing the entire map.nnThis makes sense - when I tested it and won a round by myself, the team had 53 points (3 points for capping the remaining 3 flags, and 50 points for winning the round).

Zor
started this thread
Posts: 688
Threads: 75
Joined: Jun 2006
03-27-2014, 07:16 AM #27

Fixed:rn 0.5 - Refixed score update to use built in DoD client_score methodrnrnHope this works. I totally forgot about the fact that client_score is a method in dod. So now it will update the score at a bunch of times.rnrnCheers!

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
03-27-2014, 04:12 PM #28

Thanks Zor!nnI tested it out. Good news is that it still loads properly from the beginning. Bad news is that it doesn't update after the round win.nnI did a 'changelevel' to try and force it to update, and it did - when it changed to the next level, the scoreboard showed "Allies 53 - Axis 0". nnSo I guess it needs 1) some way of interpreting the team score and displaying it as simply "1" or "2" or whatever, rather than "53" etc, and 2) it needs to update more often.

F Fysiks
posted here
Posts: 108
Threads: 3
Joined: Aug 2007
03-27-2014, 08:22 PM #29

The scoreboard title is only updated when you join the server (IIRC). Therefore, it's not possible.

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
03-28-2014, 01:30 AM #30

I'm certain that many years ago, we used to have a plugin that did exactly what Zor is trying to achieve here though.rnrnIt would display Axis 1 - Allies 1 (or whatever) on the scoreboard and would update accordingly.rnrnSurely the engine hasn't changed in a way that stops this from being possible?

F Fysiks
posted here
Posts: 108
Threads: 3
Joined: Aug 2007
03-28-2014, 05:44 AM #31
I'm certain that many years ago, we used to have a plugin that did exactly what Zor is trying to achieve here though.nnIt would display Axis 1 - Allies 1 (or whatever) on the scoreboard and would update accordingly.nnSurely the engine hasn't changed in a way that stops this from being possible?
nnThat depends on your definition of "years ago". I've never known the hostname being updated on the scoreboard and I've been playing since 2006 and scripting plugins since 2007.nnEDIT:nI had a friend (Arkshine) nice enough to go look into the code of the game and he noticed that there exists an event that might work. I don't have time to try it out but if Zor or somebody would like to try it, feel free:nnhttps://wiki.alliedmods.net/Half-Life_1_Game_Events#ServerName

Zor
started this thread
Posts: 688
Threads: 75
Joined: Jun 2006
03-28-2014, 07:22 AM #32

Not sure then as I have run out of ideas. I have looked at the clan match stuff and the plugins you pointed out and seems nothing is working. What I would suggest is that you use a plugin that will show the score on the screen like talking text but at the very top of the screen.rnrnCheers!

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
03-28-2014, 08:27 AM #33

Ahh damn, so I guess the idea Fysiks is suggesting won't work then.nnThanks for all your help anyway Zor!

Zor
started this thread
Posts: 688
Threads: 75
Joined: Jun 2006
03-28-2014, 02:13 PM #34

No his friend pointed him at servername, which is the way I first tried it.rnCheers!

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
03-28-2014, 06:19 PM #35

Ahh, right, I see. Perhaps the method used from the plugin I had years ago (and we're talking at least a decade ago here) didn't actually change the servername...but that seems like it would have been the only option. So yeah, I'm all out of ideas too :pnnYour help was much appreciated Zor :)

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
04-26-2014, 10:36 PM #36

Right, so I've resigned myself to having to use HUD-based score displays - however, I still can't find any apart from this one by FireStorm https://forums.alliedmods.net/showth...ight=dod+score which is far too involved and doesn't seem to have any way to only use the score component (eg it forces you to use all the other settings etc as well - not suitable at all).nnDoes anybody have any other suggestions or can anybody help point me in the right direction? I wouldn't have imagined it'd be so hard to find such a seemingly simple plugin.

S sparky99
posted here
Posts: 263
Threads: 49
Joined: Jan 2006
04-27-2014, 10:34 AM #37
O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
04-29-2014, 04:57 AM #38

What is this for Sparky?? It looks like that thread has been dead for many years now.

S sparky99
posted here
Posts: 263
Threads: 49
Joined: Jan 2006
04-29-2014, 05:35 AM #39

The thread is related to what this thread is trying to achieve, So Im tieing them together here so we might get an end result.

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
04-29-2014, 06:59 AM #40

Ahh right, I see. Do you think Zor might be able to use the info in that thread to modify his plugin??nnAny thoughts Zor??

Zor
started this thread
Posts: 688
Threads: 75
Joined: Jun 2006
04-29-2014, 09:34 AM #41

Sorry but that is pretty well the same code as I used on this thread. I do not know why it isn't working now.rnrnSorry

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
04-30-2014, 04:17 AM #42

No worries, I just thought maybe the link Sparky posted had some new information (eg the naming of ALLIES instead of Allies, etc).nnAnybody have any suggestions for a HUD-based score display?

S sparky99
posted here
Posts: 263
Threads: 49
Joined: Jan 2006
05-01-2014, 06:55 AM #43

There is a rnrnset_task(10.0, "UpdateServer")rnrnwhich polls the plugin to update the servername not just on join/quit/spawn/score.

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
05-01-2014, 07:18 AM #44

I assume Zor already used that in the latest version of his plugin though

Zor
started this thread
Posts: 688
Threads: 75
Joined: Jun 2006
05-03-2014, 12:25 PM #45

No I did not...let me add that, must have missed it. Was very quick looking at that code. Have you tried the code mentioned?rnrnCheers!

Zor
started this thread
Posts: 688
Threads: 75
Joined: Jun 2006
05-03-2014, 12:32 PM #46

Ok everyone, did an update with the added 10 sec update to the server. That will probably fix it, thanks to sparky99.rnrnCheers!

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
05-06-2014, 05:58 AM #47

Same thing unfortunately - the problem is two-foldnn1) Server is only updating upon round changen2) The score is being displayed as the total sum of points, rather than simply number of round victories. EG, upon winning a test round, Allies had a score of "53" which is what was being displayed. nnNumber 2 is moot anyway, since the plugin's main purpose of updating during the round, isn't working.nnAny alternative suggestions anybody?

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
05-06-2014, 01:16 PM #48

sorry i might be missing this while reading through the thread..nnyou guys are trying to just make the hostname show how many rounds each side has won? or in the scoreboard title? nni think i might be confusednn*edit*nnif youre trying to get the score to show up in the title of the scoreboard.. you can change the "ServerName" message string (it can be changed seperate of the hostname) mid game with the updated team scores but you wont see the changed title unless you reconnectnnOne way to get it to change though would be to show a motd window on the client. As displaying something in a motd window resets the scoreboard title to the hostname (not counting the default motd window when you connect).. But then each player would have to close the motd manually as I dont think theres anyway to force it to close via a plugin. If you can find a way to force it to close, you could try to open a motd window and then close it right away, still wouldnt be the best thoughnnnit might be connected to the ScoreBoard.res file, which probably gets initialized when you connect to a server and probably sits in memory till you reconnect

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
05-08-2014, 10:24 PM #49
sorry i might be missing this while reading through the thread..rnrnyou guys are trying to just make the hostname show how many rounds each side has won? or in the scoreboard title? rnrni think i might be confusedrnrn*edit*rnrnif youre trying to get the score to show up in the title of the scoreboard.. you can change the "ServerName" message string (it can be changed seperate of the hostname) mid game with the updated team scores but you wont see the changed title unless you reconnectrnrnOne way to get it to change though would be to show a motd window on the client. As displaying something in a motd window resets the scoreboard title to the hostname (not counting the default motd window when you connect).. But then each player would have to close the motd manually as I dont think theres anyway to force it to close via a plugin. If you can find a way to force it to close, you could try to open a motd window and then close it right away, still wouldnt be the best thoughrnrnrnit might be connected to the ScoreBoard.res file, which probably gets initialized when you connect to a server and probably sits in memory till you reconnect
rnrnWow, great insight here. Yeah, we're just trying to get the number of rounds won to show on the scoreboard - don't care about the hostname. rnrn"it might be connected to the ScoreBoard.res file"rnrnThis sounds likely. I've said this before, but about 10 years ago I am 100% sure I had a plugin (either for metamod, adminmod, or amx) that did this. Showed the number of rounds won on the scoreboard somehow, and didn't change the hostname (as far as I can remember) or have any problems. I've scoured the internet high and low for it, but I can't find the plugin, since most results refer to Dod Source :(rnrnHow would one go about looking into editing the ScoreBoard.res file in an attempt to do this? Not that I'd know how...

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
05-09-2014, 02:41 AM #50

the .res file is in ../steamapps/common/half-life/dod/resource/ui/nnthis is the section that stands out:nn

    "ServerName"n    {n        "ControlName"        "Label"n        "fieldName"        "ServerName"n        "xpos"        "4"n        "ypos"        "0"n        "wide"        "444"n        "tall"        "22"n        "autoResize"    "0"n        "pinCorner"        "0"n        "visible"        "1"n        "enabled"        "1"n        "labelText"        ""n        "textAlignment"        "west"n        "dulltext"        "0"n        "brighttext"    "1"n    }
probably something with the 'labelText' line.. but it is just an empty string. Though if you put something in there to see what happens, it has no effect. It's probably something in the game code that automatically fills that in with the server name when you connect (or whatever the server has set for the ServerName msg if using a plugin to override it from being the hostname).nnbut the .res files are pretty much all handled client side, there probably isnt many options for what can be done here through the server

O orz
posted here
Posts: 30
Threads: 0
Joined: Feb 2014
05-09-2014, 08:00 PM #51

Mmmm, bugger

DoD Plugins Archive · Repository · Old Forum Threads · Maps · Admin · built 14 Sep 2026 00:34 UTC