AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   fix a plugin (https://forums.alliedmods.net/showthread.php?t=319932)

Mankled 12-03-2019 12:53

Re: fix a plugin
 
Quote:

Originally Posted by Shadows Adi (Post 2675508)
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 12-06-2019 13:18

Re: fix a plugin
 
UP


All times are GMT -4. The time now is 11:54.

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