Raised This Month: $32 Target: $400
 8% 

how do i look up ips ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
djh
Member
Join Date: Nov 2004
Old 10-05-2006 , 18:26   how do i look up ips ?
Reply With Quote #1

we have the get_user_ip(id,[...]) etc
how can i lookup the address like the command host does in linux or nslookup in windows ?
djh is offline
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 10-05-2006 , 18:39   Re: how do i look up ips ?
Reply With Quote #2

you mean get_user_ip(index,ip[],len, without_port = 0);
example
new ip[32]
get_user_ip(id ,ip,32, 0);
__________________
- Bye bye!
nightscreem is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 10-05-2006 , 20:13   Re: how do i look up ips ?
Reply With Quote #3

Code:
get_user_ip(id ,ip,32, 1); // Last arugment need to be 1 if you want it without the port. // For example // 192.168.2.4:27015 is what you will get if you use the last arugment with 0 or don't even put a number there. // 192.168.2.4 is what you will get if you put 1 as the last arugment.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 10-05-2006 , 22:44   Re: how do i look up ips ?
Reply With Quote #4

No, he means the full version. (Like you see in IRC) with the host and whatnot.
The answer to that is that it can't be done. You can only get the IP.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
djh
Member
Join Date: Nov 2004
Old 10-07-2006 , 06:31   Re: how do i look up ips ?
Reply With Quote #5

thanx xanimos.
note: some ppl just don't like reading the fist post

now comes *THE* part
has it been done before using custom made modules ? (ofc now everybody reads this and everybody will tell me to search-> http://forums.alliedmods.net/showthr...ostname+lookup lovely ain't it ?)
djh is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-07-2006 , 21:12   Re: how do i look up ips ?
Reply With Quote #6

I think the best you can do is get the country the IP address is from, using the GeoIP module.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
djh
Member
Join Date: Nov 2004
Old 10-12-2006 , 16:49   Re: how do i look up ips ?
Reply With Quote #7

well i've been through parts of the sockets module source code but i don't understand it. not yet anyway
this however rang a bell :
Code:
 // Test the hostname, and resolve if needed
    if ((addr = inet_addr(hostname)) != INADDR_NONE) {
        // seems like hostname is a numeric ip, so put it into the structure
        memcpy( (char *)&server.sin_addr, &addr, sizeof(addr));
    }
    else {
        // hostname is a domain, so resolve it to an ip
        host_info = gethostbyname(hostname);
        if (host_info == NULL) {
[...]
as i said i don't understand much and i don't have a compiler to compile modules so maybe in the next relase you guys will add a function in the sockets module so that by adding "#include <sockets>" in my sma file i will be able to use let's say
Code:
new ip[32],hname[64] get_user_ip(id,ip,32,0) get_hostname(ip,hname,63)
etc etc one way or another it will be done, because i have friends that are well-versed in coding, but of course it's better to have it built-in amxx so that everyone can use it whenever they wish

just so that anyone wonders what's all this fuss about ?
ppl often get banned when playing from icaffes because of - cheating -. now icaffe owners don't afford to get their icaffe accounts vac-banned so obviousely there's no cheat, it just so happens that the player has good skills and with the right hardware he's simply owning.
i've modified enough to show a console-outpout containing the user the ip and his access, but if i had a "hostname" ie pc55.l337-caffe.city.providername.com standing after each user name then well.. he/she wouldn't get banned for cheating now would he/she ?
djh is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 11-09-2009 , 08:56   Re: how do i look up ips ?
Reply With Quote #8

actually i've seen a server with announcing joinging steam + ip addresses in the HUD, only thing was different that it showed hostnames instead of just IP addresses

wonder what was that server useing to get such a result

is there a public plugin for this nowadays?
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
Reply


Thread Tools
Display Modes

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 02:03.


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