Raised This Month: $ Target: $400
 0% 

how to edit this chat plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Neon123
Senior Member
Join Date: Jan 2016
Old 03-27-2017 , 18:57   how to edit this chat plugin
Reply With Quote #1

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

Neon123 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-27-2017 , 20:13   Re: how to edit this chat plugin
Reply With Quote #2

?

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

Last edited by OciXCrom; 03-27-2017 at 20:14.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Neon123
Senior Member
Join Date: Jan 2016
Old 03-27-2017 , 23:49   Re: how to edit this chat plugin
Reply With Quote #3

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 is offline
Neon123
Senior Member
Join Date: Jan 2016
Old 03-27-2017 , 23:51   Re: how to edit this chat plugin
Reply With Quote #4

i tried while(speech[i >= 4]) but the server crashes
Neon123 is offline
yas17sin
Veteran Member
Join Date: Oct 2016
Location: Morocco/Sale
Old 03-28-2017 , 07:56   Re: how to edit this chat plugin
Reply With Quote #5

this part i think :
PHP Code:
if('0' <= speech[i] <= '9'
to :
PHP Code:
if('4' <= speech[i] <= '9'
__________________
FINISHED WORKING ON : Attack On Titan Mod (100% Done).

FB Acc : FaceBook Account.

pic: http://prntscr.com/fszkke not good quality

Last edited by yas17sin; 03-28-2017 at 08:09.
yas17sin is offline
Send a message via ICQ to yas17sin
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 03-28-2017 , 08:34   Re: how to edit this chat plugin
Reply With Quote #6

Are you trying to block writing IP in chat?
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-28-2017 , 11:48   Re: how to edit this chat plugin
Reply With Quote #7

Yup he is..
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-28-2017 , 13:33   Re: how to edit this chat plugin
Reply With Quote #8

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

__________________

Last edited by OciXCrom; 03-29-2017 at 10:15.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Neon123
Senior Member
Join Date: Jan 2016
Old 03-28-2017 , 22:35   Re: how to edit this chat plugin
Reply With Quote #9

thank you OciXCrom you are a genius
Neon123 is offline
Neon123
Senior Member
Join Date: Jan 2016
Old 03-28-2017 , 22:53   Re: how to edit this chat plugin
Reply With Quote #10

i have used the plugin but this happens



should be 1234**
Neon123 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 18:02.


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