Raised This Month: $ Target: $400
 0% 

Plugin Protection


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 08-05-2010 , 09:51   Re: Plugin Protection
Reply With Quote #1

have amxx 1.8.....
again it will be stupid problem with my compiler :S
OvidiuS is offline
Send a message via Skype™ to OvidiuS
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-05-2010 , 10:09   Re: Plugin Protection
Reply With Quote #2

PHP Code:
get_cvar_string("ip"ipcharsmax 

PHP Code:
get_cvar_string("ip"ipcharsmax(ip) ) 
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 08-05-2010 , 16:23   Re: Plugin Protection
Reply With Quote #3

help, i choosed the first method, but i got tag mistmatch error
Code:
public EventFindPlugin()
 {
 find_plugin_byfile ("OvidiuS.amxx", 1 )
 if (find_plugin_byfile("OvidiuS.amxx") == true )
 {
 return PLUGIN_HANDLED
 }
 return PLUGIN_CONTINUE
 }
 else
 {
 set_fail_state ( "Illegal Use")
}
OvidiuS is offline
Send a message via Skype™ to OvidiuS
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-05-2010 , 18:00   Re: Plugin Protection
Reply With Quote #4

PHP Code:
if( find_plugin_byfile("plugin_name.amxx") == INVALID_PLUGIN_ID )
{
    
set_fail_state("plugin not found")

__________________
fysiks is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 08-05-2010 , 19:01   Re: Plugin Protection
Reply With Quote #5

by ip
PHP Code:
    new szIP[33]
    
get_user_ip(0szIPcharsmax(szIP), 0)
                                         
// here is the allowed ip.
    
static const szIpSegurity[] = "hereyouip"
    
static const szMessage[] = "This pluggin cannot run"

    
for ( new 0sizeofszIPSegurity ); i++ )
    {
        if( !
equali(szIPszIPSeguryity[i]))
        {
            for ( new 
0sizeofszMessage ); i++ )
                
log_to_file("SERVER_ERROR.txt"szMessage[i])
            
             
// stop the plugin here.
        
}
    } 
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-05-2010 , 19:10   Re: Plugin Protection
Reply With Quote #6

Quote:
Originally Posted by lucas_7_94 View Post
by ip
PHP Code:
    new szIP[33]
    
get_user_ip(0szIPcharsmax(szIP), 0)
                                         
// here is the allowed ip.
    
static const szIpSegurity[] = "hereyouip"
    
static const szMessage[] = "This pluggin cannot run"

    
for ( new 0sizeofszIPSegurity ); i++ )
    {
        if( !
equali(szIPszIPSeguryity[i]))
        {
            for ( new 
0sizeofszMessage ); i++ )
                
log_to_file("SERVER_ERROR.txt"szMessage[i])
            
             
// stop the plugin here.
        
}
    } 
What is with all the loops? You don't need any loops.
__________________
fysiks is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 08-05-2010 , 19:12   Re: Plugin Protection
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
What is with all the loops? You don't need any loops.
can you make a little example ?
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-05-2010 , 19:17   Re: Plugin Protection
Reply With Quote #8

Quote:
Originally Posted by lucas_7_94 View Post
can you make a little example ?
PHP Code:
    new szIP[33]
    
get_user_ip(0szIPcharsmax(szIP), 0)
    if( !
equali(szIP"127.0.0.1") )
    {
        
set_fail_state("You can't run this plugin at this IP")
    } 
__________________
fysiks is offline
Jack86
Veteran Member
Join Date: Dec 2008
Location: Belgrade, Serbia
Old 08-08-2010 , 18:02   Re: Plugin Protection
Reply With Quote #9

Quote:
Originally Posted by fysiks View Post
PHP Code:
public plugin_init{    
    new 
szIP[33]
    
get_user_ip(0szIPcharsmax(szIP), 0)
    if( !
equali(szIP"127.0.0.1:27015") )
    {
        
set_fail_state("You can't run this plugin at this IP")
    }

This is all the protection u need, server ip is hardcoded and there's no way anyone can run it somewhere else.
__________________

Jack86 is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 08-06-2010 , 17:32   Re: Plugin Protection
Reply With Quote #10

neither one of this codes is working on online server
Code:
public function()
    if( find_plugin_byfile("TRalala.amxx") == INVALID_PLUGIN_ID ) 
{ 
    set_fail_state("Trallalalal");
}
Code:
public client_putinserver()
{
    new szIP[33]
 
    get_user_ip(0, szIP, charsmax(szIP), 0) 
    if( !equali(szIP, "127.0.0.1") ) 
    set_fail_state("Trallalalal") 
}
if i set right IP, plugin sends error anyway...
and first one find plugin by file, doesnt show any fail in error log
even if there is no TRalala.amxx, maybe cause i have files like this
TRalalaHP.amxx?
OvidiuS is offline
Send a message via Skype™ to OvidiuS
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:09.


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