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

Get server IP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 08-13-2009 , 19:14   Get server IP
Reply With Quote #1

I'm wondering if there is a way to get the server ip within an amxx script? Same like get_mapname to get the name of the current map.
__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.

Last edited by Maurice; 08-13-2009 at 21:45.
Maurice is offline
0010101
BANNED
Join Date: Aug 2009
Old 08-13-2009 , 22:07   Re: Get server IP
Reply With Quote #2

get_user_ip(0,....
0010101 is offline
madeitout
Member
Join Date: Jun 2008
Old 08-14-2009 , 01:46   Re: Get server IP
Reply With Quote #3

type status in console
madeitout is offline
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 08-14-2009 , 08:46   Re: Get server IP
Reply With Quote #4

Thanks 0010101, get_user_ip indeed seems indeed also to detect the server ip with the right setup.

Quote:
Originally Posted by AMX Mod X Function Reference Search View Post
index is a player index from 1 to 32. If an index is supplied that is not between 1 and 32 the server's IP address will be stored in ip for a maximum length of len characters.

The result is stored in ip for a maximum length of len characters.

If without_port is set to 1, the port is not included in the string (defaults to 0).
__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.

Last edited by Maurice; 08-14-2009 at 08:53.
Maurice is offline
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 08-14-2009 , 08:53   Re: Get server IP
Reply With Quote #5

Thanks 0010101, get_user_ip indeed seems indeed also to detect the server ip with the right setup.

Quote:
Originally Posted by AMX Mod X Function Reference Search View Post
index is a player index from 1 to 32. If an index is supplied that is not between 1 and 32 the server's IP address will be stored in ip for a maximum length of len characters.

The result is stored in ip for a maximum length of len characters.

If without_port is set to 1, the port is not included in the string (defaults to 0).
__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.
Maurice is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 08-14-2009 , 13:00   Re: Get server IP
Reply With Quote #6

double post?
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 08-14-2009 , 13:04   Re: Get server IP
Reply With Quote #7

also you can get the cvar pointer of "IP"


get_cvar_string("IP", Buffer, BufferLen)
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
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 10:17.


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