SA-MP Forums Archive
IP of the host the server is running on? - 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: IP of the host the server is running on? (/showthread.php?tid=440469)



IP of the host the server is running on? - Dr.Einstein - 29.05.2013

Is there a special function to get the IP of where the server is running on? Well, I know one way.. connecting an NPC and getting its IP. Is there another way?


AW: IP of the host the server is running on? - Mellnik - 29.05.2013

If there is "bind" specified in the .cfg you could use https://sampwiki.blast.hk/wiki/GetServerVarAsString


Re: IP of the host the server is running on? - Richie© - 29.05.2013

You can do it this way, but you have to put the IP in server.cfg under 'bind'.
pawn Код:
new serverip[16];
GetServerVarAsString("bind", serverip, sizeof (serverip));



Re: IP of the host the server is running on? - Knappen - 29.05.2013

If he is going to bind his server to an IP, he might as well just write the IP into a string manually : )


Re: IP of the host the server is running on? - Dr.Einstein - 30.05.2013

Quote:
Originally Posted by Knappen
Посмотреть сообщение
If he is going to bind his server to an IP, he might as well just write the IP into a string manually : )
Well said.


Re: IP of the host the server is running on? - Knappen - 30.05.2013

Why do you want to get the IP of your server?