GetServerIp - 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: GetServerIp (
/showthread.php?tid=468357)
GetServerIp -
xyzcod2 - 07.10.2013
How can i get server ip and secure my server. I mean I get my server ip in gamemodeinit and if its IP i've set its true, but if its not its shut down server. Its security of stealing amx. Help plz
Re: GetServerIp -
xyzcod2 - 07.10.2013
someone?
Re: GetServerIp -
DanishHaq - 07.10.2013
Not possible as far as I know...
Re: GetServerIp -
-Prodigy- - 07.10.2013
pawn Код:
// top of your GM:
#define GM_IP "192.168.0.1"
// OnGameModeInit
new iHost[35], iBind[15];
GetServerVarAsString("bind", iBind, sizeof(iBind)); // "bind" = IP defined in your server.cfg
format(iHost, sizeof(iHost), "%s:%d", iBind, GetServerVarAsInt("port"));
// now compare strings
//if compare strings : GM_IP and iHost == true
{
// You can use this server!
}
else SendRconCommand("exit"); // else close the server
Re: GetServerIp -
efrim123 - 07.10.2013
You just need a good host that provides a good security too
thats all
Re: GetServerIp -
xyzcod2 - 08.10.2013
Quote:
Originally Posted by -Prodigy-
pawn Код:
// top of your GM: #define GM_IP "192.168.0.1"
// OnGameModeInit new iHost[35], iBind[15];
GetServerVarAsString("bind", iBind, sizeof(iBind)); // "bind" = IP defined in your server.cfg format(iHost, sizeof(iHost), "%s:%d", iBind, GetServerVarAsInt("port"));
// now compare strings //if compare strings : GM_IP and iHost == true { // You can use this server! } else SendRconCommand("exit"); // else close the server
|
i set everything what u said me, but, what i should set here: //if compare strings : GM_IP and iHost == true?
and ye, what i should add in server.cfg?
Re: GetServerIp -
Konstantinos - 08.10.2013
Read this post (
http://forum.sa-mp.com/showpost.php?...73&postcount=5), just an example.
Re: GetServerIp -
xyzcod2 - 08.10.2013
Quote:
Originally Posted by Konstantinos
|
OOOO, THANKS A LOT! IT WORKS

)
REP +