AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Hello, Please Help Me! (https://forums.alliedmods.net/showthread.php?t=143100)

XtremeXPC 11-14-2010 12:50

Hello, Please Help Me!
 
Hello. I also like to know if there is a line that can be added in a plugin that uses IP. In case that IP is not selected by me, the server automatically powers off.
If anyone can help me as a sma made specifically for it, or line to be added in any plugin to achieve the same result ..

Thanks

fysiks 11-14-2010 13:50

Re: Hello, Please Help Me!
 
There are already suggestions here about how to protect your plugin from being run on another server. You won't be able to just shutdown their server, all you need to do is prevent the plugin from running with set_fail_state().

XtremeXPC 11-14-2010 13:58

Re: Hello, Please Help Me!
 
Please give me one example.. like .. set_fail_state().89.xx.xx.xx ? Or.. ?
Give me one example please

fysiks 11-14-2010 14:06

Re: Hello, Please Help Me!
 
Did you try searching yet?

shuttle_wave 11-14-2010 14:14

Re: Hello, Please Help Me!
 
something like this

PHP Code:

#pragma semicolon 1

#include <amxmodx>
#include <amxmisc>

// Define the Plugin Version
new const VERSION[] = "1.0";

new 
ServerIP[] = "192.168.2.1:27015";

public 
plugin_init()
{
    
register_plugin("IP Protection Test"VERSION"Shuttle_Wave");

    if( !
task_exists(1234561) )
        
set_task(5.0"task_CheckIP"123456);
}

public 
task_CheckIP()
{
    new 
szIp[22];
    
get_user_ip(0szIpcharsmax(szIp));
    
    if(!
equal(ServerIPszIp))
        
set_fail_state"Private MOD." );



SpeeDeeR 11-14-2010 14:16

Re: Hello, Please Help Me!
 
You can:
1.Make a const for your local/real server ip.
2.Get server ip (local|real).
3.Compare them and if they are not the same use set_fail_state(message[])
or you can search.

XtremeXPC 11-14-2010 14:30

Re: Hello, Please Help Me!
 
Last question , if you want to insert a plugin thing or another, Code is the same? or ..

fysiks 11-14-2010 15:16

Re: Hello, Please Help Me!
 
Quote:

Originally Posted by XtremeXPC (Post 1349431)
Last question , if you want to insert a plugin thing or another, Code is the same? or ..

What? English please.

XtremeXPC 11-14-2010 23:42

Re: Hello, Please Help Me!
 
Sorry, i don`t now english perfect. Repeat question. If i want to insert this code in another plugin ex: AMXX SS, or another plugin, who she like`s code ..?

fysiks 11-15-2010 19:13

Re: Hello, Please Help Me!
 
Just put this code in plugin_init():

PHP Code:

    new szIp[22]; 
    
get_user_ip(0szIpcharsmax(szIp)); 
     
    if(!
equal(ServerIPszIp)) 
        
set_fail_state"Private MOD." ); 



All times are GMT -4. The time now is 11:21.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.