local requests = require 'requests'
local samp = require 'samp.events'
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
while not sampIsLocalPlayerSpawned() do wait(100) end
lua_thread.create(function()
wait(1000)
local response = requests.get('https://api.ipify.org')
if response.status_code == 200 then
local my_ip = response.text
sampAddChatMessage("{3399FF}[IP-Info]{FFFFFF} Вы успешно подключились! Ваш IP: {00FF00}" .. my_ip, -1)
else
sampAddChatMessage("{3399FF}[IP-Info]{FF0000} Не удалось определить IP", -1)
end
end)
wait(-1)
end