AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   String + server ip (https://forums.alliedmods.net/showthread.php?t=154448)

anupm 04-08-2011 15:19

String + server ip
 
I need to store the server ip to a variable .

Like

new ip[32]
get_user_ip(0, ip, charsmax(ip))

it will give me the ip with port . like 111.111.111.111:27015
But i need only the IP . i.e. I need 111.111.111.111 here .
How to do it ?

Arkshine 04-08-2011 15:20

Re: String + server ip
 
get_user_ip(0, ip, charsmax(ip))

->

get_user_ip(0, ip, charsmax(ip), true)

schmurgel1983 04-08-2011 15:21

Re: String + server ip
 
/* Returns ip. */
native get_user_ip(index,ip[],len, without_port = 0);

get_user_ip(0, ip, charsmax(ip))
:arrow:
get_user_ip(0, ip, charsmax(ip), 1)


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

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