Marlboro™ Posted July 27, 2017 Posted July 27, 2017 Hello all! In this tutorial I will show you how to protect plugins through an IP address. If you have a server and you don't want other possible hackers or even managers steal your files in FTP this is the easier way. Firstly we need a easy file which we will call "protection.inc". This is a type of file which allow usage of it's codes into an script (.sma file). Here is the code for protection: public ip_protection() { // Protection for servers new szIP[33] get_user_ip(0, szIP, charsmax(szIP), 0) if( !equali(szIP, "198.168.1.2:27015") ) // Put here your IP addres together with port { server_cmd("shutdownserver"); set_fail_state("This plugin is private! Contact Skype: sotiraqsa7"); //Message on console after plugin fails } } After copying text, paste it on notepad and save as "protection.inc" in folder Counter-Strike/cstrike/addons/amxmodx/scripting/include. Be careful to save the file in the format of .inc or the include won't work. Now as I said we need to use these codes for protecting the plugin. So open the .sma file of plugin you want to protect. In the beginning of the code where are declared includes write: #include <protection> Then find the main function which is public plugin_init. After you found it add there this: public plugin_init() { ip_protection() Warning! Make sure to write "ip_protection()" inside braces or plugin won't be compiled! Then compile the plugin and add it to your server. If somebody runs the plugin it will look like this: Warning! This method is used only for hosted or VPS servers. Any attempt of using it in local server won't be successful because every time you start New Game in Counter Strike IP changes and it is impossible to be static. This was the whole tutorial. Feel free to ask any questions if any problem occurs! Cheers! 6 1
Recommended Posts