Raised This Month: $ Target: $400
 0% 

[HELP] get ip


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 12-21-2015 , 16:00   [HELP] get ip
Reply With Quote #1

hi guys i want get ip server without port
example:

PHP Code:
new address[32];
get_cvar_string("net_address"addresscharsmax(address)); 
this code get ip:port 11.22.33.44:5555
i want get just ip server without port

example:
11.22.33.44
__________________
arvEL. is offline
Send a message via Skype™ to arvEL.
Kakarot47
Senior Member
Join Date: May 2015
Location: Pakistan
Old 12-21-2015 , 16:12   Re: [HELP] get ip
Reply With Quote #2

No chance lol xD you need to be hoster for that :v
Kakarot47 is offline
Send a message via Skype™ to Kakarot47
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 12-21-2015 , 17:07   Re: [HELP] get ip
Reply With Quote #3

Quote:
Originally Posted by arvEL. View Post
hi guys i want get ip server without port
example:

PHP Code:
new address[32];
get_cvar_string("net_address"addresscharsmax(address)); 
[/COLOR]
Code:
net_address
"net_address" is "192.168.42.246:27015"
Gives the local server ip. Unless your computer is connected to the internet without local ip.

Despite that, here there a plugin to get your server external: ip: /ip = show server IP and SQL Get column as cvar.

Quote:
Originally Posted by arvEL. View Post
this code get ip:port 11.22.33.44:5555
i want get just ip server without port

example:
11.22.33.44
To remove the string, see:
  1. Rules
  2. Some help with AlliedModdersForum.

https://www.amxmodx.org/api/string/strtok
Code:
strtok( currentLine, string_ip, charsmax(string_ip), currentLine_splited, charsmax(currentLine_splited), ':', 0 )
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 12-28-2015 at 09:35. Reason: new better info
addons_zz is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 12-21-2015 , 17:29   Re: [HELP] get ip
Reply With Quote #4

Wut???
Serverid is 0, just use:
new svip[16]
get_user_ip(0, svip, charsmax(svip), 1)

1 means without port else if empty then with it.
siriusmd99 is offline
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 12-21-2015 , 18:22   Re: [HELP] get ip
Reply With Quote #5

Quote:
Originally Posted by siriusmd99 View Post
Wut???
Serverid is 0, just use:
new svip[16]
get_user_ip(0, svip, charsmax(svip), 1)

1 means without port else if empty then with it.
thank you very much.
solved.
T/C
__________________
arvEL. is offline
Send a message via Skype™ to arvEL.
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 18:06.


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