Show players location on join?

Hey, I found a server recently that showed the location of the players when they joined.
I currently have something to display when they are connecting, but I was just wondering if anyone knew how to display the country the user was from.
(here’s the code created by: brandonj4 (Thanks to him))



if SERVER then
	AddCSLuaFile()
	util.AddNetworkString("chat_AddText")
	chat = {}
	function chat.AddText(...)
		net.Start("chat_AddText")
			net.WriteTable({...})
		net.Broadcast()
	end
	
	hook.Add("PlayerInitialSpawn", "SteamIDDisplay", function(ply)
		chat.AddText(Color(255,0,0), "[SERVER]", Color(255,255,255), ply:Nick().." has connected. SteamID: "..ply:SteamID())
	end)
else
	net.Receive("chat_AddText", function(len)
		chat.AddText(unpack(net.ReadTable()))
	end)
end


And an example of what I’m talking about:

Thanks.

You’ll need to use web API of one of GeoIP services.