Raised This Month: $32 Target: $400
 8% 

fix a plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mankled
Senior Member
Join Date: Oct 2019
Old 11-27-2019 , 01:24   fix a plugin
Reply With Quote #1

can someone fix this plugin, cus isn't working

PHP Code:
#include <amxmodx>

//Uncomment the line bellow to avoid chat duplicates
//#define AVOID_DUPLICATES

#define SPAM_MAXCOUNT 3
#define BLOCK_DURATION 30
#define CHAT_DELAY 1.5

new Float:g_flChatDelay[33], bool:g_bMuted[33], g_iCount[33]

#if defined AVOID_DUPLICATES
new g_MsgSay
#endif

public plugin_init()
{
register_plugin("ANTI CHAT SPAMMER""1.0""ZinoZack47")
register_clcmd("say""HookSay")
register_clcmd("say_team""HookSay")

#if defined AVOID_DUPLICATES
g_MsgSay get_user_msgid ("SayText")
register_message(g_MsgSay"avoid_duplicated")
#endif
}

#if defined AVOID_DUPLICATES
public avoid_duplicated(MsgIdMsgDestReceiver)
return 
PLUGIN_HANDLED
#endif

public HookSay(id)
{
if (
g_bMuted[id])
return 
PLUGIN_HANDLED

static szMsg[192]
read_args(szMsgcharsmax(szMsg))
remove_quotes(szMsg)

if(!
szMsg[0] || szMsg[0] == '/' || szMsg[0] == '@' || szMsg[0] == '!')
return 
PLUGIN_CONTINUE;

if (
get_gametime() - g_flChatDelay[id] < CHAT_DELAY)
{
g_flChatDelay[id] = get_gametime()
g_iCount[id]++
if(
g_iCount[id] > SPAM_MAXCOUNT)
{
client_print(idprint_center"You have been muted for %d Seconds"BLOCK_DURATION)
g_bMuted[id] = true
set_task
(float(BLOCK_DURATION), "UnmutePlayer"id)
return 
PLUGIN_HANDLED
}
}

return 
PLUGIN_CONTINUE
}

public 
UnmutePlayer(id)
{
g_bMuted[id] = false
g_iCount
[id] = 0
}

public 
client_disconnected(id)
{
g_bMuted[id] = false
g_iCount
[id] = 0
g_flChatDelay
[id] = 0.0

Mankled is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 11-27-2019 , 10:48   Re: fix a plugin
Reply With Quote #2

Please be more descriptive as to your problem and post any compilation errors and/or server logs.
redivcram is offline
Mankled
Senior Member
Join Date: Oct 2019
Old 11-27-2019 , 13:04   Re: fix a plugin
Reply With Quote #3

there's no erros when compiling, but in-game it doesn't work. its an anti chat flood, when the player says the same message more than X times less than X time, he will be muted for X time.



@EDIT
i say the same message more than 10 times and it doesn't work when "#define SPAM_MAXCOUNT 3" is 3

Last edited by Mankled; 11-27-2019 at 13:05.
Mankled is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 11-27-2019 , 13:46   Re: fix a plugin
Reply With Quote #4

Code:
if(!szMsg[0] || szMsg[0] == '/' || szMsg[0] == '@' || szMsg[0] == '!')
return PLUGIN_CONTINUE;
i guess the problem is here.
Also default amxmodx antiflood.sma package already does that, need to add messages and change values only.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Mankled
Senior Member
Join Date: Oct 2019
Old 11-27-2019 , 23:47   Re: fix a plugin
Reply With Quote #5

Quote:
Originally Posted by ^SmileY View Post
Code:
if(!szMsg[0] || szMsg[0] == '/' || szMsg[0] == '@' || szMsg[0] == '!')
return PLUGIN_CONTINUE;
i guess the problem is here.
Also default amxmodx antiflood.sma package already does that, need to add messages and change values only.
still not working
Mankled is offline
Mankled
Senior Member
Join Date: Oct 2019
Old 11-29-2019 , 12:37   Re: fix a plugin
Reply With Quote #6

UP
Mankled is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-29-2019 , 13:48   Re: fix a plugin
Reply With Quote #7

What did you exactly try (if anything) from the last post in this thread to say that it's still not working?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Mankled
Senior Member
Join Date: Oct 2019
Old 12-02-2019 , 23:55   Re: fix a plugin
Reply With Quote #8

could someone help me? please
Mankled is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-03-2019 , 07:36   Re: fix a plugin
Reply With Quote #9

Don't be ignorant.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 12-03-2019 , 09:04   Re: fix a plugin
Reply With Quote #10

PHP Code:
#include <amxmodx>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

#define MAX_FLOOD_REPEAT    4
#define MIN_FLOOD_TIME         0.75
#define MIN_FLOOD_NEXT_TIME    4.0

new g_Flood[MAX_PLAYERS+1];
new 
Float:g_Flooding[MAX_PLAYERS+1];

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_clcmd("say","HookSay");
    
register_clcmd("say_team","HookSay");
}

public 
HookSay(id)
{
    new 
Float:NexTime get_gametime();
        
    if(
g_Flooding[id] > NexTime)
    {
        if(
g_Flood[id] >= MAX_FLOOD_REPEAT)
        {
            
//client_print(id, print_center, "You flood the chat/console and mute for %d Seconds", g_Flood)
            
g_Flooding[id] = NexTime MIN_FLOOD_TIME MIN_FLOOD_NEXT_TIME;
            return 
PLUGIN_HANDLED;
        }

        
g_Flood[id]++;
    }
    else if(
g_Flood[id])
    {
        
g_Flood[id]--;
    }
        
    
g_Flooding[id] = NexTime MIN_FLOOD_TIME;

    return 
PLUGIN_CONTINUE;

__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
Reply


Thread Tools
Display Modes

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 19:57.


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