GetPlayerIP Server function

From Gothic 2 Online: Wiki
Jump to navigation Jump to search

This function was added in version: 0.0.0

Returns player IP address.

Syntax

string getPlayerIP(int id)

Required Arguments

  • id: id of the player who you want to check.

Returns

  • string with player IP address.

Example

local blackList = {
  [0] = [ "2.186.219.71", "Nubzior" ],
  [1] = [ "157.215.81.171", "Alex" ]
};

addEventHandler("onPlayerJoin", function(pid){
  local pidIP = getPlayerIP(pid);
  for(local i = 0; i < blackList.len(); ++i) {
  	if(blackList[i][0] == pidIP){
			print("Ohh, its you! " + blackList[i][1]);
		}
  }
});

Related functions

Server

Shared