23.09.2011, 17:37
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>
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.1NOTE: 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.