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

Quick Server Info Questions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xris
Junior Member
Join Date: May 2008
Old 05-19-2008 , 18:02   Quick Server Info Questions
Reply With Quote #1

I really have looked and searched for this on this site and others but can't find it. I'm looking for information on the server the plugin is running on. I've found the port number. I'm looking for name of the server like "ACME 24/7 dustbowl with stats!" as well as the IP of the server.

I see that information is on the server_spawn event but I'm assuming that only runs when the server first starts. I'm sure there is another way to get that info, just don't know it and couldn't find it.

Thanks in advance for your help. Great site.
Xris is offline
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 05-19-2008 , 18:10   Re: Quick Server Info Questions
Reply With Quote #2

PHP Code:
//Find server name
new Handle:convar FindConVar("hostname");

decl String:ServerName[64];
GetConVarStringconvarServerNamesizeof(ServerName)); 
I am not sure how to get server IP :/
__________________
http://www.nican132.com
I require reputation!
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican
Xris
Junior Member
Join Date: May 2008
Old 05-19-2008 , 18:46   Re: Quick Server Info Questions
Reply With Quote #3

It's actually just "ip" instead of "hostport" or "hostname". Thanks again!
Xris is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 05-19-2008 , 18:51   Re: Quick Server Info Questions
Reply With Quote #4

It usually works to check the ip convar, but some servers it will say 'localhost' or the internal IP address (like 192.168.0.4) instead of the ip you use to connect.
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline
Xris
Junior Member
Join Date: May 2008
Old 05-19-2008 , 19:50   Re: Quick Server Info Questions
Reply With Quote #5

So there isn't a good way to get the public IP 100% of the time?
Xris is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 05-19-2008 , 21:16   Re: Quick Server Info Questions
Reply With Quote #6

If you use +ip on the command line, it will display the proper IP address when you try to grab it.
bl4nk is offline
SAMURAI16
BANNED
Join Date: Sep 2006
Old 05-20-2008 , 13:40   Re: Quick Server Info Questions
Reply With Quote #7

you can hook server_spawn event and read address[] with GetEventString() native
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
Reply


Thread Tools
Display Modes

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 08:28.


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