Server menu
1 Attachment(s)
This gives an in game menu that will allow players to query and connect to other servers if wanted.
To set the list of servers available, create a file serverlist.cfg in the amxx config directory. Each line should contain one server and look like: Server name\IP or hostname:port password Server name is whatever you want the server to be called in the menu. That is followed by a backslash (\). Then the hostname or IP of the server followed by a colon (:) and then the port. If needed the password is put after a space following the port. Warning, this will allow anyone that uses the menu to connect to the passworded server to learn the password. The port and password are optional. The port will default to 27015 and must be defined if a password is used. Lines starting with # or ; are considered a comment. 1.0 Some small refactoring to clean up the code a bit. Fixed a bug where it would not handle a challenge with a 0x00 byte in it. Unfortunately this uncovered a similiar bug in the sockets module. So... Added a little more graceful handling of packet errors. 0.6 Update to new steam server query protocol. 0.5 Changed the way packets are formed to be sent. Hopefully working around the linux compiler bug and also being 64bit compliant. (Suggested by Bailopan.) 0.4: Fixed showing incorrect number of pages on the main server menu. 0.3: Changed includes to conform with standard practice Made the port optional in the server list Added ability to connect to password protected servers 0.2: Initial public release |
Code:
#include <amxmodx.inc> Code:
#include <amxmodx> |
Bug Found, not sure if this is fixable:
You can't connect to a HLTV, even if it's the same mod you were just on. It's weird issue because you can connect by typing Connect IP:port but it doesn't work. It shows the error: Can't connect to Server. |
Acutally to make the code nicer you just need
Code:
The file.inc and string.inc are already included in the amxmodx.inc soo adding them into your plugin is kinda pointless. However, I must say this has to be one of the best ideas for a plugin ever, I will try this out on my server and add a few servers that I know of to test this out. And have you thought about adding a option to place passwords in the config file? something like ip addy\pass\port which the pass part would be optional so you can still have ip addy\port or maybe you do ipaddy:port password=blah or something I dont know, just giving you something to think about :) EDIT You should change your include files too Code:
That is the "correct" way for your plugin to compile. If you do that then everything will work fine, cause right now your plugin doesnt compile with the online compiler. |
@ kamikaze
Are you sure the server line in serverlist.cfg is correct? It seems to work fine here. @ Bigballer I had thought about adding passwords before but didn't think people would want to expose their passwords. I went ahead and did it, with the warning that any one who uses it will be able to learn the password. Janzert |
Still doesn't seem to compile with the web compiler. :(
Any way to see what the errors are? Does the web compiler have sockets.inc? Janzert |
It should
If not then maybe you should contact BAILOPAN or post in the bugs forum about the web compiler not reading the sockets.inc I installed the plugin last night, works very well, good job. |
I get a /home/users/amxmodx/tmp/phpk7hh7c.sma(59) : fatal error 100: cannot read from file: "sockets"
Compilation aborted. 1 Error. when i compile this plugin |
you need the sockets module to use this plugin.
Seeing how the sockets module is only on .20 amxx you need to use the nightly builds in order to compile this plugin. |
ahh so should the .16 not even work then? or how can it be compatible with .16?
|
All times are GMT -4. The time now is 20:07. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.