<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/FetchServerIp?action=history&amp;feed=atom</id>
	<title>FetchServerIp - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/FetchServerIp?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FetchServerIp&amp;action=history"/>
	<updated>2026-05-12T15:56:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FetchServerIp&amp;diff=81679&amp;oldid=prev</id>
		<title>Botder: Created page with &quot;{{Useful_Function}} &lt;lowercasetitle/&gt; __NOTOC__ This function returns the server ip as reported by a third-party service.  ==Syntax== &lt;syntaxhighlight lang=&quot;lua&quot;&gt; string fetchServerIp ( ) &lt;/syntaxhighlight&gt;  ==Code== &lt;section name=&quot;Server&quot; class=&quot;server&quot; show=&quot;true&quot;&gt; &lt;syntaxhighlight lang=&quot;lua&quot;&gt; SERVER_IP = &quot;127.0.0.1&quot;  function fetchServerIp()     return SERVER_IP end  fetchRemote(&quot;http://checkip.dyndns.com/&quot;,     function (response)         if response ~= &quot;ERROR&quot; then...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FetchServerIp&amp;diff=81679&amp;oldid=prev"/>
		<updated>2025-01-08T19:55:38Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Useful_Function}} &amp;lt;lowercasetitle/&amp;gt; __NOTOC__ This function returns the server ip as reported by a third-party service.  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; string fetchServerIp ( ) &amp;lt;/syntaxhighlight&amp;gt;  ==Code== &amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt; &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; SERVER_IP = &amp;quot;127.0.0.1&amp;quot;  function fetchServerIp()     return SERVER_IP end  fetchRemote(&amp;quot;http://checkip.dyndns.com/&amp;quot;,     function (response)         if response ~= &amp;quot;ERROR&amp;quot; then...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Useful_Function}}&lt;br /&gt;
&amp;lt;lowercasetitle/&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function returns the server ip as reported by a third-party service.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string fetchServerIp ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
SERVER_IP = &amp;quot;127.0.0.1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
function fetchServerIp()&lt;br /&gt;
    return SERVER_IP&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
fetchRemote(&amp;quot;http://checkip.dyndns.com/&amp;quot;,&lt;br /&gt;
    function (response)&lt;br /&gt;
        if response ~= &amp;quot;ERROR&amp;quot; then&lt;br /&gt;
            SERVER_IP = response:match(&amp;quot;&amp;lt;body&amp;gt;Current IP Address: (.-)&amp;lt;/body&amp;gt;&amp;quot;) or &amp;quot;127.0.0.1&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
outputServerLog(&amp;quot;Public server IP: &amp;quot; .. fetchServerIp())&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Botder</name></author>
	</entry>
</feed>