[Include] Anti .amx theft v1.0
#1

Hi!
Here's a simple but efficient include that you can use to forbid the use of your server .amx files in other servers in case they were stolen! It simply crashes server when the script is not being used in the host of his owner.

How to use:

1. Open the include, and change this line:

Code:
#define IP_PORT "127.0.0.1:7777" //Put your server IP:Port here
2. Put the include in your pawno/include folder, open the filterscript or gamemode you want to protect and put this:

Code:
#include <a_samp>
//(...)
#include <anti_theft>
//(...)
3. Compile and make sure in your server.cfg file you have this:

Code:
(...)
port 7777 //your server port here
bind 127.0.0.1 //your server ip here
Pastebin download: http://pastebin.com/5pzdag9M

Bugs/Problems:

Well, I didn't find a way to identify if the script is a filterscript or a gamemode, unless you used #define FILTERSCRIPT in your script. That's why I'm hooking both OnGameModeInit and OnFilterScriptIinit functions at the same time. But I believe it won't cause problems.

Any doubt, suggestion, ask here!

Have fun!
Riccor
Reply
#2

Thats is pretty neat, great job!
Reply
#3

Cool!
Reply
#4

Well, this is nice, although I don't see any occasions of .amx files getting stolen from people.

It usually happens with multiple server owners, where one owner takes off with the script... That's why you're supposed to limit access
Reply
#5

You're right Roperr. And in fact it's not usual, but I actually created it because someone accessed my server ftp and website some weeks ago (I still don't know how since I confirmed it was not my managers fault) and it was easy for him delete or copy whatever he want. I only have .amx for obvious security reasons, but by copying all these files, it could be easy to put other host running my server, which is not cool and in that situation there's nothing I could do. Fortunately, it didn't happen

And now I feel much more comfortable by using this code. :P
Reply
#6

Reply
#7

I've seen it before!

https://sampforum.blast.hk/showthread.php?tid=337359
Reply
#8

LOL Actually I didn't see it before. And it's funny because it is in portuguese (I'm portuguese xD)

Well, anyway:
1. That is a tutorial, not an include;
2. This include uses both ip and port parameters at same time;
3. This one is in english and crash server, instead of just exit game. muhaha :P
Reply
#9

Quote:
Originally Posted by richardcor91
View Post
LOL Actually I didn't see it before. And it's funny because it is in portuguese (I'm portuguese xD)

Well, anyway:
1. That is a tutorial, not an include;
2. This include uses both ip and port parameters at same time;
3. This one is in english and crash server, instead of just exit game. muhaha :P
Who said you can not use a tutorial to include one! Now you may not have seen but the logic is much like it ...
Reply
#10

With the sentence "This a tutorial, not an include", I'm talking about my include functionality vs tutorial functionality - it's much easier for users use this than use tutorial.
And yes, logic is the same, and it means I was not the first thinking about this solution. But, at least, this is the first include doing it
Reply
#11

Nice work!
Reply
#12

Very Nice!
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)