local requests = require 'requests'
function main()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand("showmyip", function()
lua_thread.create(function()
local response = requests.get('http://api.ipify.org')
if response.status_code == 200 then
sampAddChatMessage("IP: " .. response.text, -1)
else
sampAddChatMessage("Error: " .. response.status_code, -1)
end
end)
end)
wait(-1)
end