GetServerIp
#1

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
Reply
#2

someone?
Reply
#3

Not possible as far as I know...
Reply
#4

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
Reply
#5

You just need a good host that provides a good security too
thats all
Reply
#6

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?
Reply
#7

Read this post (http://forum.sa-mp.com/showpost.php?...73&postcount=5), just an example.
Reply
#8

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
OOOO, THANKS A LOT! IT WORKS )
REP +
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)