SA-MP Forums Archive
[Include] Anti .amx theft v1.0 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Anti .amx theft v1.0 (/showthread.php?tid=342078)



Anti .amx theft v1.0 - richardcor91 - 12.05.2012

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


Re: Anti .amx theft v1.0 - Mark_Weston - 12.05.2012

Thats is pretty neat, great job!


Re: Anti .amx theft v1.0 - LaGrande - 12.05.2012

Cool!


Re: Anti .amx theft v1.0 - Roperr - 12.05.2012

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


Re: Anti .amx theft v1.0 - richardcor91 - 12.05.2012

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


Respuesta: Anti .amx theft v1.0 - [Vector] - 12.05.2012




Re: Anti .amx theft v1.0 - paulor - 12.05.2012

I've seen it before!

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


Re: Anti .amx theft v1.0 - richardcor91 - 12.05.2012

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


Re: Anti .amx theft v1.0 - paulor - 12.05.2012

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 ...


Re: Anti .amx theft v1.0 - richardcor91 - 12.05.2012

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


Re: Anti .amx theft v1.0 - Edvin - 13.05.2012

Nice work!


Re: Anti .amx theft v1.0 - (SC)=Sky= - 13.05.2012

Very Nice!