Raised This Month: $51 Target: $400
 12% 

Serverinfo


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   General Purpose        Approver:   v3x (159)
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 02-26-2006 , 11:54   Serverinfo
Reply With Quote #1

Serverinfo, by p3tsin

Description:
Get status of defined servers (server name, current map, players/maxplayers, etc)

Settings:
Place serverlist.ini in amxmodx/data directory and add the addresses you want.
(Note MAX_SERVERS definition!)

Cvars & Commands:
- srv_format - response format for queries
- srv_format2 - response format when couldn't get server status

- say /servers - prints the status of servers defined in serverlist.ini

Response format variables:
$type - HL1 / HL2
$ip - ip address
$host - hostname
$map - current map
$dir - gamedirectory (e.g. cstrike)
$mod - modname (e.g. Counter-Strike)
$players - players/maxplayers
$pw - password protected? (Yes/No)

$timeleft - time remaining on current map
$nextmap - next map

Changelog:
1.00 - Initial release
1.01 - Fixed maxplayers showing as 0 when there are no players
1.10 - Added $timeleft and $nextmap
- Improved speed

Thanks to:
Kraugh for helping me with the byte values in the response


Oh, and you need Sockets module to run the plugin
Attached Files
File Type: zip serverlist.zip (229 Bytes, 4222 views)
File Type: sma Get Plugin or Get Source (serverinfo.sma - 6221 views - 8.5 KB)
__________________
plop
p3tsin is offline
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 02-26-2006 , 12:29  
Reply With Quote #2

Most all of this can be setup easily with the use of this plugin:
http://forums.alliedmods.net/showthread.php?t=24092

And with all do respect, I don't think a client needs to know this:
$type - HL1 / HL2
$dir - gamedirectory (e.g. cstrike)
$mod - modname (e.g. Counter-Strike)

A. If you don't know if this is HL1 or HL2 or if you are playing CS or TS, pretty sad :/
B. no use at all for the client to know the mod directory.
Quote:
Originally Posted by GHW_Chronic
with all do respect
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 02-26-2006 , 12:56  
Reply With Quote #3

Looks sexy
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
JKB
Member
Join Date: Jan 2006
Old 02-26-2006 , 13:11  
Reply With Quote #4

Cool, this is for when you run multiple servers, right?
Correct me if im wrong :S
__________________
Quote:
Chuck Norris doesn't sleep. He waits.
JKB is offline
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 02-26-2006 , 13:20  
Reply With Quote #5

@Chronic: the gamedirectory is only there coz the full modname may take up too much space (theres a limit of how many characters u may have in one message, u know) so "dod" might be better than "Day Of Defeat"

well yeah, i dont think many would use type/mod/dir in their response but some could.. and theres no harm if they exist

@JKB: yes, thats right
__________________
plop
p3tsin is offline
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 02-26-2006 , 15:32  
Reply With Quote #6

found a bug
if theres 0 players on the server, it will also show maxplayers as 0.. gotta take a look at it tomorrow
EDIT: fixed
__________________
plop
p3tsin is offline
TiMbErLaNd
Senior Member
Join Date: Jan 2005
Location: Detroit, Michigan
Old 03-01-2006 , 14:40  
Reply With Quote #7

http://forums.alliedmods.net/showthread.php?t=7347

Addin the option to directly connect to the server that you are currently viewing, like this one that I currently use.
Yeah and like previously stated I think this could do without some of that info.
We just need the meat and the potatoes.

Keep up the great work!
TiMbErLaNd is offline
SoBe Green
Junior Member
Join Date: Mar 2006
Location: Russellville, AR
Old 03-28-2006 , 16:01  
Reply With Quote #8

Quote:
Originally Posted by GHW_Chronic
A. If you don't know if this is HL1 or HL2 or if you are playing CS or TS, pretty sad :/
I'd find it nice to know that my favorite CS 1.6 server community might be running some source related servers. So I wouldn't label this one completely useless. But I do agree the mod directory is a bit useless.
SoBe Green is offline
Send a message via ICQ to SoBe Green Send a message via AIM to SoBe Green Send a message via MSN to SoBe Green
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 03-31-2006 , 11:02  
Reply With Quote #9

** updated to v1.10 **

added $timeleft and $nextmap variables
improved the speed of sending & receiving data

(note: sry for hardcoring the couple values in the beginning of rulesparse, gotta figure out how to do it otherwise if ppl start having problems with it )
__________________
plop
p3tsin is offline
Otzku
New Member
Join Date: Apr 2006
Old 04-22-2006 , 08:23  
Reply With Quote #10

Thank you for this nice plugin! It will be really helpful and good for me.
__________________
Otzku is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:20.


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