[Tutorial] Four ways to protect the GM
#1

Hello Everybody


Hello, I will share with you four ways, very simple, your modem protection.




The first way, check server IP:

pawn Code:
#include <a_samp>


#define IP "0.0.0.0"


public OnGameModeInit()
{
    new ServerIP[16];    
    GetServerVarAsString("bind", ServerIP, sizeof(ServerIP));    
    if(strcmp(ServerIP, IP, false)) SendRconCommand("exit");    
    return 1;    
}
Pastebin: Here.

So what we have here, anyway?
We ran a test if the server IP compatible to write server IP in "server.cfg" file.
If is not compatible, the server is shut down.




Second way, check server slots:
pawn Code:
#include <a_samp>


#undef MAX_PLAYERS
#define MAX_PLAYERS 32


public OnGameModeInit()
{
    if(GetMaxPlayers() != MAX_PLAYERS) SendRconCommand("exit");
    return 1;
}
Pastebin: Here.

So what we have here, anyway?
Initially lowered the maximum setting of the slots on the server (default 500) and set the desired amount to us.
Then we ran a test if the server slots compatible to write server slots in "server.cfg" file.
If is not compatible, the server is shut down.




Third way, check server port:
pawn Code:
#include <a_samp>


#define Port 7777


public OnGameModeInit()
{
    if(GetConsoleVarAsInt("port") != Port) SendRconCommand("exit");
    return 1;
}
Pastebin: Here.

So what we have here, anyway?
We ran a test if the server port compatible to write server port in "server.cfg" file.
If is not compatible, the server is shut down.




Fourth way, check GM name:
pawn Code:
#include <a_samp>


#define GameModeAMX "NameAMX"


public OnGameModeInit()
{
    new SGameModeAMX[32];
    GetConsoleVarAsString("gamemode0", SGameModeAMX, sizeof(SGameModeAMX));
    if(strcmp(SGameModeAMX, GameModeAMX, false)) SendRconCommand("exit");
    return 1;
}
Pastebin: Here.

So what we have here, anyway?
We ran a test if the server GM name compatible to write server GM name in "server.cfg" file.
If is not compatible, the server is shut down.




.My Pastebin: Here

** Sorry for my English, see you soon...
Reply


Messages In This Thread
Four ways to protect the GM - by TheLustcheR - 26.10.2016, 14:34
Re: Four ways to protect the GM - by Mister0 - 26.10.2016, 18:00
Re: Four ways to protect the GM - by Logic_ - 26.10.2016, 18:35
Re: Four ways to protect the GM - by ISmokezU - 26.10.2016, 18:47
Re: Four ways to protect the GM - by Spmn - 26.10.2016, 21:14
Re: Four ways to protect the GM - by TheLustcheR - 26.10.2016, 22:12
Re: Four ways to protect the GM - by XBrianX - 27.10.2016, 00:04
Re: Four ways to protect the GM - by DTV - 27.10.2016, 00:32
Re: Four ways to protect the GM - by TheLustcheR - 27.10.2016, 10:50
Re: Four ways to protect the GM - by BurnZ - 27.10.2016, 12:33
Re: Four ways to protect the GM - by TheLustcheR - 27.10.2016, 13:31
Re: Four ways to protect the GM - by iLearner - 28.10.2016, 07:13
Re: Four ways to protect the GM - by BurnZ - 28.10.2016, 07:26
Re: Four ways to protect the GM - by SickAttack - 28.10.2016, 07:40
Re: Four ways to protect the GM - by Jayse - 28.10.2016, 08:04
Re: Four ways to protect the GM - by TheLustcheR - 28.10.2016, 09:13
Re: Four ways to protect the GM - by iLearner - 28.10.2016, 10:55
Re: Four ways to protect the GM - by BurnZ - 28.10.2016, 10:58
Re: Four ways to protect the GM - by iLearner - 28.10.2016, 18:31
Re: Four ways to protect the GM - by Eoussama - 28.10.2016, 18:34
Re: Four ways to protect the GM - by BurnZ - 29.10.2016, 00:20
Re: Four ways to protect the GM - by iLearner - 29.10.2016, 09:26
Re: Four ways to protect the GM - by BurnZ - 29.10.2016, 09:42
Re: Four ways to protect the GM - by AbyssMorgan - 29.10.2016, 10:05
Re: Four ways to protect the GM - by TheLustcheR - 29.10.2016, 21:00
Re: Four ways to protect the GM - by AbyssMorgan - 30.10.2016, 07:00
Re: Four ways to protect the GM - by TheLustcheR - 30.10.2016, 09:48
Re: Four ways to protect the GM - by Variable™ - 30.10.2016, 17:23
Re: Four ways to protect the GM - by Threshold - 31.10.2016, 14:19

Forum Jump:


Users browsing this thread: 1 Guest(s)