SA-MP Forums Archive
Get IP of server? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Get IP of server? (/showthread.php?tid=653469)



Get IP of server? - GospodinX - 05.05.2018

Hi guys

Is possible to make ongamemodeinit check on which IP is run server...I use my mode on 3 different IP (My main server,my public test server(for staff,test update,5 slots...) and localhost,haha) . So I want to make check in ongamemodeinit for example

Код:
if(IPAdress == 130.321.3224.:4040)
{
g_SQL = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB);
}
else if(IPAdress == 242.133.3131:4040)
{
g_SQL = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB);
}
else //localhost
{
g_SQL = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB);
}
Is something like this possible?Now I need to change my MYSQL data every time...I hope you can understand me,thanks.


Re: Get IP of server? - GospodinX - 05.05.2018

I dont understand.I just want when i run server on X IP,that i use different MySQL data ,then on Y IP..If you can understand me..


Re: Get IP of server? - GospodinX - 05.05.2018

Yes I'm try and i'm not find answer for my question,okey? It's reason why I'm asking here,what is problem?

Thanks


Re: Get IP of server? - Dayrion - 05.05.2018

https://sampwiki.blast.hk/wiki/GetConsoleVarAsString + https://sampwiki.blast.hk/wiki/Server.cfg -> bind