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

add 'replace' function in plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 01-20-2018 , 15:22   add 'replace' function in plugin
Reply With Quote #1

hi guys.. i found plugin inside forum and need some help

PHP Code:
#include <amxmodx>

new const gBlockTexts[][] = {
    
"",
    
"",
    
"",
    
"",
    
"%"
};

public 
plugin_init() 
{
    
register_plugin("Block all bugs chat""1.0""BaD MaN");
    
    
register_clcmd("say""CmdSay");
    
register_clcmd("say_team""CmdSay");
}

public 
CmdSay(id
{
    new 
args[192];
    
read_args(argscharsmax(args));
    
remove_quotes(args);
    
    for(new 
0sizeof(gBlockTexts); i++)
   {
        if(
containi(argsgBlockTexts[i]) != -)
        {
            return 
PLUGIN_HANDLED;
        }
    }
    
    return 
PLUGIN_CONTINUE;

this plugin make fix to bugs color chat
and here in this line

PHP Code:
        if(containi(argsgBlockTexts[i]) != -)
        {
            return 
PLUGIN_HANDLED;
        } 
it's block chat when it's have any char from array gBlockTexts[]
i need the plugin don't block chat , just replace char's inside gBlockTexts[] if the chat contian it
__________________
arvEL. is offline
Send a message via Skype™ to arvEL.
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-20-2018 , 15:33   Re: add 'replace' function in plugin
Reply With Quote #2

Then remove return PLUGIN_HANDLED and add replace() native?
__________________
edon1337 is offline
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 01-20-2018 , 15:59   Re: add 'replace' function in plugin
Reply With Quote #3

Quote:
Originally Posted by edon1337 View Post
Then remove return PLUGIN_HANDLED and add replace() native?
how??
__________________
arvEL. is offline
Send a message via Skype™ to arvEL.
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-20-2018 , 16:01   Re: add 'replace' function in plugin
Reply With Quote #4

Quote:
Originally Posted by arvEL. View Post
how??
If you don't know how to use a basic native, you're not supposed to post in the Scripting section.
PHP Code:
native replace(text[], len, const what[], const with[]); 
If you search you'll find lots of topics that contain replace() native.
__________________

Last edited by edon1337; 01-20-2018 at 16:02.
edon1337 is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 01-20-2018 , 16:02   Re: add 'replace' function in plugin
Reply With Quote #5

PHP Code:
if(containi(argsgBlockTexts[i]) != -
       
replace(argscharsmax(args), gBlockTexts[i], "****"
https://www.amxmodx.org/api/string/replace
__________________
retired chump

Last edited by DjSoftero; 01-20-2018 at 16:03. Reason: php tags
DjSoftero 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 04:13.


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