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

Server Info

by Tank · 2008-12-30 · 8 replies · 8848 views · 99 downloads

Read the thread (9 posts)

From the first post

If this is posted in the wrong section, apologies, please point me to where I should post it.
rn
rnGoodday,
rn
rnI figured since everyone always shares their plugins I do the same. However, my knowledge of coding and the knowledge of coding of people posting plugins I use is a difference between water and fire.
rn
rnHowever I would like to get some feedback on my coding style. What am I doing wrong and what could be better. I also notice everything is always hardcoded for me, hardly use pcvars and therefor I would also like to learn how I could code plugins so they are more for general use, not just for me.
rn
rn
=========================================================rnTank's Server Info (version 0.1 07-11-2008)rnrnServer Info - information:rn===========================================================rn Author : |B.A.M| The Tank #AoS.nlrn Version: 0.1rn Date : 07-11-2008rn rn Tank's Server Info:rn rn A menu based plugin for providing all sorts of info to the client.rn Due to the fact that for some people using a MOTD way of providingrn information is too slow I wrote this plugin. It's fully multi-lingualrn making it a nice plugin for international servers/communities.rn rn Although it's basicly written for my own clan/server I think withrn some help it can be easily changed over to your needs. I tried torn alter the plugin as best I could to make it as general as possible.rn rn===========================================================rnServer Info - Features:rn=========================================================== rn - Fully multi-lingual supported (not all translated yet)rn rn===========================================================rnServer Info - To do:rn=========================================================== rn - Ask around for better information providing then just throughrn chat. Been thinking about making small tutorials in console print.rn rn===========================================================rnServer Info - !!!!!!ERRORS!!!!!rn===========================================================..rn No errors to reportrn rn===========================================================rnServer Info - Commands:rn===========================================================rn - say /serverinfo to open the menurn - say_team /serverinfo to open the menurn rn===========================================================rnServer Info - Installation:rn===========================================================rn - Compile the tanks_serverinfo.sma | An online compiler can be found here:rn http:[url]www.amxmodx.org/webcompiler.cgi[/url]rn - Copy tanks_serverinfo.amxx into your addonsamxmodxplugins folderrn - Add tanks_serverinfo.amxx to the bottom of your addonsamxmodxconfigsplugins.inirn - Place serverinfo.txt into dod/addons/amxmodx/data/lang/rn - Change the map or restart your server to start using the plugin!rnrn===========================================================rnServer Info - Notes & Credits:rn===========================================================rn - dodplugins.net for always having the information ready when needed, much appriciated.rn - h0 noMan for helping me out a lot with this pluginrn - Helping me with menu'srn - ZOR for helping me understand what I was doingrn - Also helped me on the multi lingual part of the pluginrn - Synthetic for always being able to answer my questions when having a few.rn===========================================================

Files

tanks_serverinfo_v0.1.sma Plugin Source 17 KB 81 dl Download Compile

Added later in the thread

tanks_serverinfo_v0.2.sma Plugin Source 20 KB 18 dl Download Compile

The thread

All 9 posts from 3 people on Server Info, kept as they were written.

Tank
started this thread
Posts: 581
Threads: 59
Joined: Jan 2007
12-30-2008, 12:52 PM #1

If this is posted in the wrong section, apologies, please point me to where I should post it.rnrnGoodday,rnrnI figured since everyone always shares their plugins I do the same. However, my knowledge of coding and the knowledge of coding of people posting plugins I use is a difference between water and fire.rnrnHowever I would like to get some feedback on my coding style. What am I doing wrong and what could be better. I also notice everything is always hardcoded for me, hardly use pcvars and therefor I would also like to learn how I could code plugins so they are more for general use, not just for me.rnrn

=========================================================rnTank's Server Info (version 0.1 07-11-2008)rnrnServer Info - information:rn===========================================================rn Author : |B.A.M| The Tank #AoS.nlrn Version: 0.1rn Date : 07-11-2008rn rn Tank's Server Info:rn rn A menu based plugin for providing all sorts of info to the client.rn Due to the fact that for some people using a MOTD way of providingrn information is too slow I wrote this plugin. It's fully multi-lingualrn making it a nice plugin for international servers/communities.rn rn Although it's basicly written for my own clan/server I think withrn some help it can be easily changed over to your needs. I tried torn alter the plugin as best I could to make it as general as possible.rn rn===========================================================rnServer Info - Features:rn=========================================================== rn - Fully multi-lingual supported (not all translated yet)rn rn===========================================================rnServer Info - To do:rn=========================================================== rn - Ask around for better information providing then just throughrn chat. Been thinking about making small tutorials in console print.rn rn===========================================================rnServer Info - !!!!!!ERRORS!!!!!rn===========================================================..rn No errors to reportrn rn===========================================================rnServer Info - Commands:rn===========================================================rn - say /serverinfo to open the menurn - say_team /serverinfo to open the menurn rn===========================================================rnServer Info - Installation:rn===========================================================rn - Compile the tanks_serverinfo.sma | An online compiler can be found here:rn http:www.amxmodx.org/webcompiler.cgirn - Copy tanks_serverinfo.amxx into your addonsamxmodxplugins folderrn - Add tanks_serverinfo.amxx to the bottom of your addonsamxmodxconfigsplugins.inirn - Place serverinfo.txt into dod/addons/amxmodx/data/lang/rn - Change the map or restart your server to start using the plugin!rnrn===========================================================rnServer Info - Notes & Credits:rn===========================================================rn - dodplugins.net for always having the information ready when needed, much appriciated.rn - h0 noMan for helping me out a lot with this pluginrn - Helping me with menu'srn - ZOR for helping me understand what I was doingrn - Also helped me on the multi lingual part of the pluginrn - Synthetic for always being able to answer my questions when having a few.rn===========================================================rnrn
Dr.G
posted here
Posts: 776
Threads: 75
Joined: Nov 2007
12-30-2008, 01:43 PM #2

GJ! i might grap some of that menu code :)rnrn

================================================== =========rnBAM Info - To do:rn================================================== ========= rn- Ask around for better information providing then just throughrnchat. Been thinking about making small tutorials in console print.rnrn
rnrnI made something like this long ago, but i did it with showing a motd, and that showed a small website where u able to click around and see all the diffrent stuff info about plugins etc. The main reason i did it like that was because i didnt know anything about codeing.. But might be and idea u can use for tutorials...

Tank
started this thread
Posts: 581
Threads: 59
Joined: Jan 2007
12-30-2008, 01:51 PM #3

I always used GHC Custom Message plugin which did the same. However, the moment I open a MOTD (could be the huge amount of miles between me and my server) I could built a replica of an old war ship and still have time left before it opened.rnrnI also heared this complaints with others, so I figured to keep it as basic as possible. I also figured that pointing them to /baminfo with full language support would be quicker then trying as a Dutchy to explain in English to a spanish player who doesn't speak English that he can't shoot that ceiling with a bazooka.

Dr.G
posted here
Posts: 776
Threads: 75
Joined: Nov 2007
12-30-2008, 02:01 PM #4

lol yea good point... well i linked to a www addresse when i did it, and that wasnt slow.. good luck with it...

Tank
started this thread
Posts: 581
Threads: 59
Joined: Jan 2007
12-30-2008, 02:07 PM #5

I'll think I try what you posted on a different computer and a different internet connection and see if it's still slow. Some stuff just doesn't work for me and I never liked doing work which doesn't benefit me :DrnrnThanks for the advice, I'll surely look into that.

Zor
posted here
Posts: 688
Threads: 75
Joined: Jun 2006
12-30-2008, 03:16 PM #6

If you change this to something more dynamic, like insdead of BAM Info, Server Info and let the people change it to whatever they want in the Library files it would be much better. Then you can post it in Server Management forum.rnrnAlso you should use the Library file for your Menu Headings. This way you keep it completely dynamic.rnrnYou could Eliminate these defines:rn

#define mainmenu "yB.A.M Information Center:^n" // Main menurn#define rulesmenu "yB.A.M Rules: No Racism, No Hacking, No Glitching (nade or zooka)^nyB.A.M Rules: No Excessive Wall Spamming^n" // Rules menurn#define pluginsmenu "yInformation on all plugins running :^n" // Plugins menurn#define bindkeymenu "yInformation on how to bind a key :^n" // Bindkey menurn#define faqmenu "yFrequently Asked Questions :^n" // F.A.Q Menu
rnrnAdd the following to your Library TXT:rn
MAINMENU 	= "yB.A.M Information Center:^n"rnRULESMENU	= "yB.A.M Rules: No Racism, No Hacking, No Glitching (nade or zooka)^nyB.A.M Rules: No Excessive Wall Spamming^n"rnPLUGINSMENU	= "yInformation on all plugins running :^n"rnBINDKEYMENU	= "yInformation on how to bind a key :^n"rnFAQMENU 	= "yFrequently Asked Questions :^n"
rnrnChange your Menu Designators to the following:rn
//Menu registrationrnnew mainmenu[128], rulesmenu[128], pluginsmenu[128], bindkeymenu[128], faqmenu[128]rnvformat(mainmenu, 127, "%L", id, MAINMENU) rnvformat(rulesmenu, 127, "%L", id, RULESMENU) rnvformat(pluginsmenu, 127, "%L", id, PLUGINSMENU) rnvformat(bindkeymenu, 127, "%L", id, BINDKEYMENU) rnvformat(faqmenu, 127, "%L", id, FAQMENU) rnregister_menucmd(register_menuid(mainmenu), 1023, "func_choice_main")rnregister_menucmd(register_menuid(rulesmenu), 1023, "func_choice_rules")rnregister_menucmd(register_menuid(pluginsmenu), 1023, "func_choice_plugins")rnregister_menucmd(register_menuid(bindkeymenu), 1023, "func_choice_bindkey")rnregister_menucmd(register_menuid(faqmenu), 1023, "func_choice_faq")
rnrnSeems like a bit more work, but it will make adjusting things just so much more simpler for the untrained coder to put on their servers.rnrnCheers!

Tank
started this thread
Posts: 581
Threads: 59
Joined: Jan 2007
12-30-2008, 04:37 PM #7

More work or not, I posted it to learn how to make this more versatile for everyone to use. Besides that I gladly learn new stuff.nnNew version should be up in a few. I'll post here to make sure I did it the right way. Im learning and slowly getting there but some extra checking never hurts.nnedit:nI adjusted the plugin:n- named the plugin from Tank's BAM Info to Tank's Server Info (and all the stuff related to BAM into server, also goes for the say commands).n- made the adjustment posted by ZornnIm working on changing the language file around so it doesn't show all info about my server but basicly general pointers on what that line should hold.nnAny idea if I can generalise this even more? Im kinda stuck on that due to the use of the menu's. The menu's titles, the menu items and the amount of client prints are all hardcoded.nnI have one question though, I checked this out:nvformat ( buffer[], len, const fmt[], vararg ) nnI know what len stands for but thats the only one. Can someone perhaps translate the short words to what they need to be, like wId is weaponindex, const fmt[] stands for constant....

Zor
posted here
Posts: 688
Threads: 75
Joined: Jun 2006
12-31-2008, 01:32 PM #8

Ok if I understand what you mean here is the translation, very programize:rnrnvformat ( buffer[], len, const fmt[], vararg ) rnrnvformat - Name of the functionrnbuffer - Is the string memory you want filledrnlen - Length of buffers memory address eg: temp[128] len = 127 ( 0 - 127 = 128 )rnconst fmt - This is the formated string part eg: "Hello my name is %s I am %d years old"rnvararg - This is the arguments to add into format, for above eg: , "zor", 36 Or you can give it arguments eg: new name[] = "Zor", age = 36 then have them replace the above "zor" and 36rnrnHope this explains everything?rnrnCheers!

Tank
started this thread
Posts: 581
Threads: 59
Joined: Jan 2007
01-01-2009, 06:55 PM #9

Yes it does. Any idea where I can find information on those abbriviations (spelling)? I'm having a lot of difficulties with all the functions to implement them in the right way because I dont know what the abriviations stands for.rnrnEDIT:rnI finished the changes that needed to be done on the plugin however now it won't compile.rnrnThe changes I made were:rn

===========================================================rnServer Info - Changelog:rn===========================================================rn- Friday 2 January 2008:rn -Added a new function to go to a second page in a menurn -Also added the option for multi lingual title menu'srn -Finished the plugins sectionrn===========================================================*/
rnrnThese are the compilers error I get:rnrn
temp.sma(103) : error 017: undefined symbol "id"rntemp.sma(103) : error 017: undefined symbol "MAINMENU"rntemp.sma(104) : error 017: undefined symbol "id"rntemp.sma(104) : error 017: undefined symbol "RULESMENU"rntemp.sma(105) : error 017: undefined symbol "id"rntemp.sma(105) : error 017: undefined symbol "PLUGINSMENU"rntemp.sma(106) : error 017: undefined symbol "id"rntemp.sma(106) : error 017: undefined symbol "PLUGINSMENU"rntemp.sma(107) : error 017: undefined symbol "id"rntemp.sma(107) : error 017: undefined symbol "BINDKEYMENU"rntemp.sma(108) : error 017: undefined symbol "id"rntemp.sma(108) : error 017: undefined symbol "FAQMENU"rntemp.sma(108 -- 110) : error 088: number of arguments does not match definitionrntemp.sma(108 -- 110) : fatal error 107: too many error messages on one linern
rnrnNormally when I get this it's often because I forgot to include a module but all the functions used come up at amxmodx.org as just amxmodx module. Could someone perhaps help me on this bug?

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