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

I don't understand from who you use this protection? I mean from the person who can change this settings gamemode port bind should have ftp acces. Or I didnt understod, but for what or who are these protections?
Reply
#3

These are codes that can be used in your script to avoid others using it on their host without .pwn.
Reply
#4

This is actually good. GoodJob Dude.
Reply
#5

What if there is no bind set in server.cfg?
Reply
#6

Quote:
Originally Posted by Mister0
View Post
I don't understand from who you use this protection? I mean from the person who can change this settings gamemode port bind should have ftp acces. Or I didnt understod, but for what or who are these protections?
If someone got your GM he can't running it.

Quote:
Originally Posted by Spmn
View Post
What if there is no bind set in server.cfg?
This example can be on stored server.
Anyway, you have more 3 ways.
Reply
#7

That's pretty good!
Reply
#8

Sorry if I sound stupid, but I don't get the forth one.

If you're checking to see if the gm name in the server.cfg is the same as the one defined in the script, how would that protect you if someone was to steal your .amx file? I don't imagine they'd change the name in the server.cfg or the actual file name.

Other than that, the rest of them are good, I might actually use one of them in the future.
Reply
#9

Quote:
Originally Posted by DTV
View Post
Sorry if I sound stupid, but I don't get the forth one.

If you're checking to see if the gm name in the server.cfg is the same as the one defined in the script, how would that protect you if someone was to steal your .amx file? I don't imagine they'd change the name in the server.cfg or the actual file name.

Other than that, the rest of them are good, I might actually use one of them in the future.
All the ways working with same mission.
Checking if the Define and Server.cfg is same, if not the server is turn off.
Reply
#10

Sorry? But why would people steal your amx when all the textdraws and everything else shows another website? Not to mention in-game names would show your server's name and stuff.
Reply
#11

Quote:
Originally Posted by BurnZ
View Post
Sorry? But why would people steal your amx when all the textdraws and everything else shows another website? Not to mention in-game names would show your server's name and stuff.
I dont know, its happen.
If you was just reading and no mere responding, you would understand that it blocks the possibility of any use in GM.
Reply
#12

I devided my script (and do so with all of my scrips) in includes (pawno/include/dayz(for example)/here all files).

Like functions in one, commands in another, then one for admins commands... Defines and so on... This way even if my .pwn gets stolen anyhow by host or anyone it'be useless for them as my main gm only has samp callbacks & includes.

#best way for me!
Reply
#13

Quote:
Originally Posted by iLearner
View Post
I devided my script (and do so with all of my scrips) in includes (pawno/include/dayz(for example)/here all files).

Like functions in one, commands in another, then one for admins commands... Defines and so on... This way even if my .pwn gets stolen anyhow by host or anyone it'be useless for them as my main gm only has samp callbacks & includes.

#best way for me!
Because all your scripts uses CNRSF as base.

@LutscheR That's not what i mean.
Reply
#14

Quote:
Originally Posted by iLearner
View Post
I devided my script (and do so with all of my scrips) in includes (pawno/include/dayz(for example)/here all files).

Like functions in one, commands in another, then one for admins commands... Defines and so on... This way even if my .pwn gets stolen anyhow by host or anyone it'be useless for them as my main gm only has samp callbacks & includes.

#best way for me!
That makes no sense... For a lot of reasons.

One being... Why will you have your .pwn file on your host if it is pretty much unusable to start with?...
Reply
#15

Best way to protect the gamemode: don't use free hosts/cheap shitty hosts nor give anyone access to your files. More secure way: use your own VPS.
Reply
#16

Quote:
Originally Posted by Jayse
View Post
Best way to protect the gamemode: don't use free hosts/cheap shitty hosts nor give anyone access to your files. More secure way: use your own VPS.
HAHA, You're right there
Reply
#17

Sickattack I meant 'even if somehow (maybe by mistake?) the file gets uploaded'
Reply
#18

Quote:
Originally Posted by iLearner
View Post
Sickattack I meant 'even if somehow (maybe by mistake?) the file gets uploaded'
LOL. Linux host doesn't even require the pawno folder.
Reply
#19

Your reply makes no sense. #logic.exe not found
Reply
#20

Nice
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)