AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Off-Topic (https://forums.alliedmods.net/forumdisplay.php?f=15)
-   -   Help me to compile this plugin (https://forums.alliedmods.net/showthread.php?t=229254)

Troublemaker 11-04-2013 06:30

Help me to compile this plugin
 
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;
}

YamiKaitou 11-04-2013 07:43

Re: Help me to compile this plugin
 
Compile it locally with the Orpheu include file

Troublemaker 11-04-2013 10:35

Re: Help me to compile this plugin
 
Please do it for me

YamiKaitou 11-04-2013 10:48

Re: Help me to compile this plugin
 
We can't, you must compile it yourself. There is a guide someone that explains how if you don't know, try searching

Troublemaker 11-06-2013 10:04

Re: Help me to compile this plugin
 
What to search?

joshknifer 11-06-2013 12:43

Re: Help me to compile this plugin
 
Quote:

Originally Posted by Troublemaker (Post 2057529)
What to search?

http://bit.ly/1fjRKl7


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

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