GetPlayerIP
#1

I recently made this, but when trying to recieve my own IP I only recieve 127.0.0.1 - is this due to being in localhost?

Код:
 CMD:ipcheck(playerid, params[])
{
      new IP[16], targetid, targetname[MAX_PLAYER_NAME], string[144];

      if(!IsPlayerAdmin(playerid))
        return 0;

      if(sscanf(params, "u", targetid)) 
        return SendClientMessage(playerid, -1, "SERVER - /ipcheck <playerid>");

      GetPlayerName(playerid, targetname, MAX_PLAYER_NAME);

      GetPlayerIp(targetid, IP, sizeof(IP));
      format(string, sizeof(string), "%s(%i)'s IP is: %s",targetname,targetid,IP);
      SendClientMessage(playerid, -1, string);
      return 1;
   
}
Reply
#2

Yes, it is.
Reply
#3

That probably is your IP adress. Check your IP on whatsmyip.org
Reply
#4

Quote:
Originally Posted by Luis-
Посмотреть сообщение
Yes, it is.
Okay. So it is due to being in localhost?

Quote:
Originally Posted by andrejc999
Посмотреть сообщение
That probably is your IP adress. Check your IP on whatsmyip.org
I just checked, and no, it is not my IP.
Reply
#5

Quote:
Originally Posted by ccodey
Посмотреть сообщение
Okay. So it is due to being in localhost?
More than likely, yeah.

Quote:
Originally Posted by andrejc999
Посмотреть сообщение
That probably is your IP adress. Check your IP on whatsmyip.org
I've just nearly spat out my tea. 127.0.0.1 is a local ip.
Reply
#6

Quote:
Originally Posted by Luis-
Посмотреть сообщение
More than likely, yeah.



I've just nearly spat out my tea. 127.0.0.1 is a local ip.
Lmao. Alright dude, thank you both for great help anyways.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)