AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   how to edit this chat plugin (https://forums.alliedmods.net/showthread.php?t=295506)

Neon123 03-27-2017 18:57

how to edit this chat plugin
 
hi , please i need to edit this plugin , I tried but I could not

now this plugin does -> say: 1***

i need to edit the count of numbers alloweds -> say: 1234*****

PHP Code:

#include <amxmodx>
#include <amxmisc>
 
#define PLUGIN    "Block Numbers"
#define AUTHOR    "Jim"
#define VERSION    "1.0"
 
public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say""hook")
    
register_clcmd("say_team""hook")
}
 
public 
hook(id)
{
    if(
access(idADMIN_CHAT))
        return 
PLUGIN_CONTINUE
    
    
static cmd[9]
    
read_argv(0cmd8)
    
    static 
speech[192]
    
read_args(speech191)
    
remove_quotes(speech)
    
speech[191] = '^0'
    
    
new ij
    
while(speech[i++])
    {
        if(
'0' <= speech[i] <= '9')
        {
            
speech[i] = '*'
            
j++
        }
    }
    if(!
j)
        return 
PLUGIN_CONTINUE
    
    engclient_cmd
(idcmdspeech)
    return 
PLUGIN_HANDLED



OciXCrom 03-27-2017 20:13

Re: how to edit this chat plugin
 
?

What is this supposed to do? I don't understand. You want only 4 numbers allowed per say message?

Neon123 03-27-2017 23:49

Re: how to edit this chat plugin
 
this plugin allows only 1 number per message , the rest are replaced with "*"

I want to allow more numbers , only 4 numbers per message the rest of numbers are replaced with "*" for avoid spam ips

Neon123 03-27-2017 23:51

Re: how to edit this chat plugin
 
i tried while(speech[i >= 4]) but the server crashes

yas17sin 03-28-2017 07:56

Re: how to edit this chat plugin
 
this part i think :
PHP Code:

if('0' <= speech[i] <= '9'

to :
PHP Code:

if('4' <= speech[i] <= '9'


PRoSToTeM@ 03-28-2017 08:34

Re: how to edit this chat plugin
 
Are you trying to block writing IP in chat?

Natsheh 03-28-2017 11:48

Re: how to edit this chat plugin
 
Yup he is..

OciXCrom 03-28-2017 13:33

Re: how to edit this chat plugin
 
PHP Code:

#include <amxmodx>

new g_pMaxNumbers

public plugin_init()
{
    
register_plugin("Max Numbers in Chat""1.0""OciXCrom")
    
register_clcmd("say""OnSay")
    
register_clcmd("say_team""OnSay")
    
g_pMaxNumbers register_cvar("mnc_max_numbers""4")
}

public 
OnSay(id)
{
    static 
szArgs[192], szCommand[9], iLeniMaxiNumbersi
    read_args
(szArgscharsmax(szArgs))
    
remove_quotes(szArgs)
    
    
iLen strlen(szArgs)
    
iMax get_pcvar_num(g_pMaxNumbers)
    
iNumbers 0
    
    
for(0iLeni++)
    {
        if(
isdigit(szArgs[i]))
        {
            if(
iNumbers iMax)
                
szArgs[i] = '*'
            
else iNumbers++
        }
    }
    
    if(
iNumbers)
    {
        
read_argv(0szCommandcharsmax(szCommand))
        
engclient_cmd(idszCommandszArgs)
        return 
PLUGIN_HANDLED
    
}
    
    return 
PLUGIN_CONTINUE



Neon123 03-28-2017 22:35

Re: how to edit this chat plugin
 
thank you OciXCrom you are a genius

Neon123 03-28-2017 22:53

Re: how to edit this chat plugin
 
i have used the plugin but this happens

http://i68.tinypic.com/npqoe8.jpg

should be 1234**


All times are GMT -4. The time now is 18:02.

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