[Include] GetServerIP
#1

GetServerIP v1


Well, I saw this thread, and I thought - why not script it?

It's only a simple HTTP request for a php script to return the IP. It's stored in a variable for later use.

ChangeLog:
Quote:

Version 1:
-Initial release.
Usage:
Insert this code on top of your game mode after #include <a_samp>
pawn Код:
#include <GSIP>
And use this function anywhere you like:
pawn Код:
GetServerIP();
An example:
pawn Код:
public OnPlayerConnect(playerid)
{
    new msg[100];
    format(msg,sizeof(msg)," Our server IP is %s",GetServerIP());
    SendClientMessage(playerid,-1,msg);
}
Installing:
Download and save to pawn/includes folder!

Download:
Version 1.1

NOTE: You CAN'T use this function in OnGameModeInit/OnFilterScriptInit. I don't think there's a way to fix it.


Feel free to do anything you want with it.
Reply


Messages In This Thread
GetServerIP - by wups - 23.09.2011, 17:37
Re: GetServerIP - by IstuntmanI - 23.09.2011, 17:41
Re: GetServerIP - by Edvin - 23.09.2011, 17:44
Re: GetServerIP - by Double-O-Seven - 23.09.2011, 17:47
Re: GetServerIP - by IstuntmanI - 23.09.2011, 17:49
Re: GetServerIP - by HyperZ - 23.09.2011, 17:56
Re: GetServerIP - by Sasino97 - 23.09.2011, 17:57
Re: GetServerIP - by wups - 23.09.2011, 17:58
Re: GetServerIP - by Lorenc_ - 23.09.2011, 18:03
Re: GetServerIP - by Fat - 23.09.2011, 18:04

Forum Jump:


Users browsing this thread: 1 Guest(s)