This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Help me to compile this plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Troublemaker
Member
Join Date: Jun 2013
Old 11-04-2013 , 06:30   Help me to compile this plugin
Reply With Quote #1

Code:

#include <amxmodx>
#include <orpheu>
#define PLUGIN "Anti flood"
#define VERSION "1.0"
#define AUTHOR "kanagava"

new time_last_conn
new ip_old[256]
new ip_warn[256]
new Msg[256]
new OrpheuHook:handlePrintf
new warn
new old_time
new registered
public plugin_init()
{
* * register_plugin(PLUGIN, VERSION, AUTHOR)
* * set_task(5.0, "regfunctions")*
}

public regfunctions()
{
* * server_cmd("mp_logecho 1")
* * server_cmd("log on")
* * OrpheuRegisterHook(OrpheuGetFunction("SV_Conn ectClient"),"OnSV_ConnectClientPre", OrpheuHookPre)
* * OrpheuRegisterHook(OrpheuGetFunction("SV_Conn ectClient"),"OnSV_ConnectClientPost", OrpheuHookPost)
}

public OrpheuHookReturn:OnSV_ConnectClientPre()
{
* * registered=0
* * if(get_systime()-old_time <= 2)
* * {
* * * * handlePrintf = OrpheuRegisterHook( OrpheuGetFunction( "Con_Printf" ), "Con_Printf" , OrpheuHookPre);
* * * * registered=1
* * }
* * old_time=get_systime()
* * return OrpheuIgnored;
}


public OrpheuHookReturn:OnSV_ConnectClientPost()
{
* * if(registered)
* * {
* * * * OrpheuUnregisterHook(handlePrintf)
* * }
* * return OrpheuIgnored;
}



public OrpheuHookReturn:Con_Printf(const a[], const message[] )
{
* * registered=1
* * if (containi(message,"^" connected, address ^"")!=-1)
* * {
* * * * new len=255
* * * * new temp_right[256],temp_left[256],conn_ip[256]
* * * * formatex( Msg,charsmax( Msg ),"%s", message );
* * * * split(Msg, temp_left, len, temp_right, len, "^" connected, address ^"")
* * * * strtok(temp_right, conn_ip, len, temp_right, len, ':')
* * * * if (equal(conn_ip,ip_old) && !equal(conn_ip,"") && ((get_systime()-time_last_conn)<2))
* * * * {
* * * * * * warn=warn+1
* * * * * * if(warn>1 && equal(conn_ip,ip_warn))
* * * * * * {
* * * * * * * * log_amx("[NOFLOOD] Connection flood detected from ip %s",ip_old)
* * * * * * * * server_cmd("addip 120.0 %s",ip_old)
* * * * * * }
* * * * * * ip_warn=conn_ip
* * * * }
* * * * else
* * * * {
* * * * * * warn=0
* * * * }
* * * * ip_old=conn_ip
* * * * time_last_conn=get_systime()
* * }
* * return OrpheuIgnored;
}
Troublemaker is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-04-2013 , 07:43   Re: Help me to compile this plugin
Reply With Quote #2

Compile it locally with the Orpheu include file
__________________
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
Troublemaker
Member
Join Date: Jun 2013
Old 11-04-2013 , 10:35   Re: Help me to compile this plugin
Reply With Quote #3

Please do it for me
Troublemaker is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-04-2013 , 10:48   Re: Help me to compile this plugin
Reply With Quote #4

We can't, you must compile it yourself. There is a guide someone that explains how if you don't know, try searching
__________________
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
Troublemaker
Member
Join Date: Jun 2013
Old 11-06-2013 , 10:04   Re: Help me to compile this plugin
Reply With Quote #5

What to search?
Troublemaker is offline
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 11-06-2013 , 12:43   Re: Help me to compile this plugin
Reply With Quote #6

Quote:
Originally Posted by Troublemaker View Post
What to search?
http://bit.ly/1fjRKl7
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
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 23:44.


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