Raised This Month: $ Target: $400
 0% 

Do not see anything chat.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 09-23-2014 , 15:40   Do not see anything chat.
Reply With Quote #1

I have this code, but it does chat problems.

And now I'm doing /admin - admin not showing me online
Or write chat asjfkajfja
Does not show me anything

Code:
public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_clcmd("say" , "CmdBlock");
    register_clcmd("say_team" , "CmdBlock");
}

public CmdBlock(id)
{
    new szSaid[192];
    
    read_args(szSaid, charsmax(szSaid));
    remove_quotes(szSaid);
    
    if (contain(szSaid,"#") != 1 && strlen(szSaid) > 2 )
    {
        return 1;
    }
    return 0;
}
Snitch is offline
Send a message via Skype™ to Snitch
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 09-24-2014 , 01:37   Re: Do not see anything chat.
Reply With Quote #2

Quote:
Originally Posted by Snitch View Post
I have this code, but it does chat problems.

And now I'm doing /admin - admin not showing me online
Or write chat asjfkajfja
Does not show me anything

Code:
public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_clcmd("say" , "CmdBlock");
    register_clcmd("say_team" , "CmdBlock");
}

public CmdBlock(id)
{
    new szSaid[192];
    
    read_args(szSaid, charsmax(szSaid));
    remove_quotes(szSaid);
    
    if (contain(szSaid,"#") != 1 && strlen(szSaid) > 2 )
    {
        return 1;
    }
    return 0;
}
strlen(szSaid) > 2 )

maybe because you're blocking anything longer than 2 characters? change it to < or remove it completely
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 09-24-2014 , 16:42   Re: Do not see anything chat.
Reply With Quote #3

I do not want to hide the command as return 1;

Just do not see it when I do chat #
Quote:
snitch:
Will look like when I send #
Snitch is offline
Send a message via Skype™ to Snitch
NikKOo31
Senior Member
Join Date: May 2013
Location: Home
Old 09-25-2014 , 00:03   Re: Do not see anything chat.
Reply With Quote #4

What are you trying to do with that code? ._.
__________________
Hey ^_^
NikKOo31 is offline
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 10-09-2014 , 18:02   Re: Do not see anything chat.
Reply With Quote #5

Quote:
Originally Posted by NikKOo31 View Post
What are you trying to do with that code? ._.
if i put in Name # so no one will see it hide it from name

if my name is 1#Cstrike
so will see 1 Cstrike
only to this part, and hide from chat not block
Snitch is offline
Send a message via Skype™ to Snitch
NikKOo31
Senior Member
Join Date: May 2013
Location: Home
Old 10-10-2014 , 11:39   Re: Do not see anything chat.
Reply With Quote #6

Quote:
Originally Posted by Snitch View Post
if i put in Name # so no one will see it hide it from name

if my name is 1#Cstrike
so will see 1 Cstrike
only to this part, and hide from chat not block
You are doing it wrong. Hooking say and say_team will only block it from chat. Give me a min

Edit* try this instead

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_forward(FM_ClientUserInfoChanged"ForwardClientInfoChanged")
}

public 
ForwardClientInfoChanged(id,buffer
{
    new 
name[32]
    new 
newname[32]
    
get_user_name(idname31)
    
engfunc(EngFunc_InfoKeyValuebuffer"name"newname31)

    if(!
equal(name,newname))
    {
        
replace_all(newname31"#"" ")
        
engfunc(EngFunc_SetClientKeyValueidbuffer"name"newname)
        
//client_cmd(id, "name ^"%s^"", newname)
    
}
    return 
FMRES_IGNORED

Idk if the commented line is necesary. You'll need to test yourself
__________________
Hey ^_^

Last edited by NikKOo31; 10-10-2014 at 11:44.
NikKOo31 is offline
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 10-10-2014 , 18:32   Re: Do not see anything chat.
Reply With Quote #7

Quote:
Originally Posted by NikKOo31 View Post
You are doing it wrong. Hooking say and say_team will only block it from chat. Give me a min

Edit* try this instead

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_forward(FM_ClientUserInfoChanged"ForwardClientInfoChanged")
}

public 
ForwardClientInfoChanged(id,buffer
{
    new 
name[32]
    new 
newname[32]
    
get_user_name(idname31)
    
engfunc(EngFunc_InfoKeyValuebuffer"name"newname31)

    if(!
equal(name,newname))
    {
        
replace_all(newname31"#"" ")
        
engfunc(EngFunc_SetClientKeyValueidbuffer"name"newname)
        
//client_cmd(id, "name ^"%s^"", newname)
    
}
    return 
FMRES_IGNORED

Idk if the commented line is necesary. You'll need to test yourself
Worked, Thank i have more question

if u can hide '#' only from that nicks:
Code:
1#Cstrike_GIGN_Label #Cstrike_GIGN_Label
Code:
d #Spec_Help_Text #Spec_Duck
because my name was Snitch#Dll.

and no # hide.
Snitch is offline
Send a message via Skype™ to Snitch
NikKOo31
Senior Member
Join Date: May 2013
Location: Home
Old 10-11-2014 , 14:07   Re: Do not see anything chat.
Reply With Quote #8

This worked fine

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new const hide_hashtag[][]=
{
    
"Cstrike",
    
"Spec"
}

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_forward(FM_ClientUserInfoChanged"ForwardClientInfoChanged")
}

public 
ForwardClientInfoChanged(id,buffer
{
    new 
name[32]
    new 
newname[32]
    
get_user_name(idname31)
    
engfunc(EngFunc_InfoKeyValuebuffer"name"newname31)

    if(!
equal(name,newname) && contain(newname"#") != -1)
    {
        for(new 
0sizeof hide_hashtagi++)
        {
            if(
containi(newnamehide_hashtag[i]) != -1)
            {
                
replace_all(newname31"#"" ")
                
engfunc(EngFunc_SetClientKeyValueidbuffer"name"newname)
                
//client_cmd(id, "name ^"%s^"", newname)
                
return FMRES_HANDLED
            
}
        }
    }
    return 
FMRES_IGNORED

__________________
Hey ^_^
NikKOo31 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 17:56.


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