Raised This Month: $ Target: $400
 0% 

Hiding said '' register_clcmd ''


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 10-31-2009 , 05:47   Hiding said '' register_clcmd ''
Reply With Quote #1

Quote:
register_clcmd("say hi", ..);
I want to hide the register_clcmd, so if I write '' hi '', '' hi '' should be hided in chat.

And the 2. thing, how can I make, that if the word hi is in chat, that it does the function:

Like that .hi, _hi,/hi

I don't want to regiser this, is there an other way?

Last edited by KadiR; 10-31-2009 at 05:54.
KadiR is offline
vitorrd
Senior Member
Join Date: Jul 2009
Old 10-31-2009 , 05:56   Re: Hiding said '' register_clcmd ''
Reply With Quote #2

Either register the three commands or hook SayText (not recommended).
Return PLUGIN_HANDLED in your command to avoid showing it, PLUGIN_CONTINUE to let the server continue processing it (which will end up in it being sent to the chat).
vitorrd is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 10-31-2009 , 06:51   Re: Hiding said '' register_clcmd ''
Reply With Quote #3

Hook "say" and read args there.
__________________
xPaw is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-01-2009 , 05:29   Re: Hiding said '' register_clcmd ''
Reply With Quote #4

Best is to register all commands and let amxx check them in client_command.
Hook say cmd is rather when you want to detect a word in a sentence.

You can use this stock to register all commands :

PHP Code:
register_saycmd(saycommand[], function[], flags = -1info[] = ""FlagManager = -1)
{
    new 
temp[64];
    
formatex(temp63"say /%s"saycommand);
    
register_clcmd(temp, function, flagsinfoFlagManager);
    
formatex(temp63"say .%s"saycommand);
    
register_clcmd(temp, function, flagsinfoFlagManager);
    
formatex(temp63"say_team /%s"saycommandFlagManager);
    
register_clcmd(temp, function, flagsinfo);
    
formatex(temp63"say_team .%s"saycommandFlagManager);
    
register_clcmd(temp, function, flagsinfoFlagManager);
    
formatex(temp63".%s"saycommand);
    
register_clcmd(temp, function, flagsinfoFlagManager);
    
formatex(temp63"/%s"saycommand);
    
register_clcmd(temp, function, flagsinfoFlagManager);


Then, do :

register_saycmd("hi", ...

/hi, .hi will work in chat, say and say_team, and also in console.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 11-01-2009 , 07:08   Re: Hiding said '' register_clcmd ''
Reply With Quote #5

Your stock's name fails.
SnoW is offline
Send a message via MSN to SnoW
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 11-01-2009 , 07:28   Re: Hiding said '' register_clcmd ''
Reply With Quote #6

Quote:
Originally Posted by SnoW View Post
Your stock's name fails.
Whats wrong with it ?
__________________
xPaw is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 11-01-2009 , 11:07   Re: Hiding said '' register_clcmd ''
Reply With Quote #7

Quote:
Originally Posted by xPaw View Post
Whats wrong with it ?
It registers console commands as well, but the name is saycmd. ;)
SnoW is offline
Send a message via MSN to SnoW
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 11-01-2009 , 11:23   Re: Hiding said '' register_clcmd ''
Reply With Quote #8

Quote:
Originally Posted by SnoW View Post
It registers console commands as well, but the name is saycmd. ;)
That doesnt really matter, you can name it like SnoW_Is_Cool( ... )
__________________
xPaw is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-01-2009 , 17:18   Re: Hiding said '' register_clcmd ''
Reply With Quote #9

Quote:
Originally Posted by xPaw View Post
That doesnt really matter, you can name it like SnoW_Is_Cool( ... )
Would fail, whatever the content of the function.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-01-2009 , 11:22   Re: Hiding said '' register_clcmd ''
Reply With Quote #10

Dear God, what a tragedy.
__________________
Arkshine is offline
Reply


Thread Tools
Display Modes

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:41.


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