SA-MP Forums Archive
GetPlayerIP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: GetPlayerIP (/showthread.php?tid=629606)



GetPlayerIP - ccodey - 01.03.2017

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;
   
}



Re: GetPlayerIP - Luis- - 01.03.2017

Yes, it is.


Re: GetPlayerIP - andrejc999 - 01.03.2017

That probably is your IP adress. Check your IP on whatsmyip.org


Re: GetPlayerIP - ccodey - 01.03.2017

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.


Re: GetPlayerIP - Luis- - 01.03.2017

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.


Re: GetPlayerIP - ccodey - 01.03.2017

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.