07.10.2013, 20:58
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
// 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
pawn Код:
|
Read this post (http://forum.sa-mp.com/showpost.php?...73&postcount=5), just an example.
|