AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Off-Topic (https://forums.alliedmods.net/forumdisplay.php?f=15)
-   -   Get server IP (https://forums.alliedmods.net/showthread.php?t=100359)

Maurice 08-13-2009 19:14

Get server IP
 
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.

0010101 08-13-2009 22:07

Re: Get server IP
 
get_user_ip(0,....

madeitout 08-14-2009 01:46

Re: Get server IP
 
type status in console

Maurice 08-14-2009 08:46

Re: Get server IP
 
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 (Post 899157)
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).


Maurice 08-14-2009 08:53

Re: Get server IP
 
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 (Post 899157)
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).


tuty 08-14-2009 13:00

Re: Get server IP
 
double post?

AntiBots 08-14-2009 13:04

Re: Get server IP
 
also you can get the cvar pointer of "IP"


get_cvar_string("IP", Buffer, BufferLen)


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

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