Raised This Month: $ Target: $400
 0% 

Is it possible to get serverip ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 08-03-2010 , 19:01   Re: Is it possible to get serverip ?
Reply With Quote #1

Quote:
Originally Posted by fysiks View Post
And if the ip cvar was never set? I'm assuming you would get an empty string? Guess I should test it out.
port + ip are setup at hlds start time. Hostname should be set if you want to change default name (Half-Life)

I always run hlds with +ip +port arguments
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-03-2010 , 19:02   Re: Is it possible to get serverip ?
Reply With Quote #2

Quote:
Originally Posted by joropito View Post
port + ip are setup at hlds start time. Hostname should be set if you want to change default name (Half-Life)

I always run hlds with +ip +port arguments
I don't use either one of those. I've never needed to.
__________________
fysiks is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 08-03-2010 , 19:29   Re: Is it possible to get serverip ?
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
I don't use either one of those. I've never needed to.
Tested.

If +port is not used, port cvar will be default port (27015)

If +ip is not used, it's value will be localhost...
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 08-03-2010 , 13:05   Re: Is it possible to get serverip ?
Reply With Quote #4

isn't get_user_name(0...) returning the hostname
SpeeDeeR is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 08-03-2010 , 13:25   Re: Is it possible to get serverip ?
Reply With Quote #5

Quote:
Originally Posted by SpeeDeeR View Post
isn't get_user_name(0...) returning the hostname
Who said that?

Just get value from "hostname" cvar.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
biscuit628
Senior Member
Join Date: Jun 2007
Location: 香港HongKong
Old 08-04-2010 , 16:55   Re: Is it possible to get serverip ?
Reply With Quote #6

PHP Code:
    new NetIp[64],serverip[20],port[6]
    
get_cvar_string("net_address",NetIp,63)
    
strtok(NetIpserverip19port5':'
__________________
My Plugins

C4man with fun

Sniper Skill bonus
-------------------------
Sorry for my poor English!
biscuit628 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 00:07.


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