Raised This Month: $51 Target: $400
 12% 

fix a plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Mankled
Senior Member
Join Date: Oct 2019
Old 12-03-2019 , 12:53   Re: fix a plugin
Reply With Quote #11

Quote:
Originally Posted by Shadows Adi View Post
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;


could u put to show a message like this when the player got muted: "You've been muted for 30 seconds. Wait 30s, REASON: Flooding". and the seconds will going down each time he types, example if he types something after 4 seconds, the message will be: "You've been muted for 30 seconds. Wait: 26s, REASON: Flooding".
Mankled is offline
Mankled
Senior Member
Join Date: Oct 2019
Old 12-06-2019 , 13:18   Re: fix a plugin
Reply With Quote #12

UP
Mankled is offline
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 09:55.


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