Raised This Month: $ Target: $400
 0% 

Hide chat Triggers


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Caldeum
Senior Member
Join Date: Jul 2010
Location: United Kingdom
Old 08-08-2012 , 04:27   Hide chat Triggers
Reply With Quote #1

Please can anyone convert this code to amxmodx? and add triggers.ini file where i can add custom triggers?

PHP Code:
public OnPluginStart()
{
    
RegConsoleCmd("say"OnSay);
    
RegConsoleCmd("say_team"OnSay);
    
    
HiddenChatTriggers CreateTrie( );
    
SetTrieValue(HiddenChatTriggers"rank"true);
}

public 
Action:OnSay(clientargs)
{
    
decl String:arg[8];
    
GetCmdArgString(argsizeof arg);
    
StripQuotes(arg);
    
    new 
dummy;
    
    if (
GetTrieValue(HiddenChatTriggersargdummy))
    {
        return 
Plugin_Handled;
    }
    
    switch (
arg[0])
    {
        case 
'/''!''.':
        {
            if (
GetTrieValue(HiddenChatTriggersarg[1], dummy))
            {
                return 
Plugin_Handled;
            }
        }
    }
    return 
Plugin_Continue;

__________________
Of all the things I lost, I miss my brain the most.
Caldeum is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-08-2012 , 09:45   Re: Hide chat Triggers
Reply With Quote #2

To translate this code into Pawn:

Code:
new Trie:g_tTriggers; public plugin_init( ) {     register_clcmd( "say", "CmdSay" );     register_clcmd( "say_team", "CmdSay" );         g_tTriggers = TrieCreate( );     TrieSetCell( g_tTriggers, "rank", 1 ); } public CmdSay( iPlayer ) {     new szArgs[ 8 ];     read_args( szArgs, charsmax( szArgs ) );     remove_quotes( szArgs );         new iStart = ( szArgs[ 0 ] == '/' || szArgs[ 0 ] == '!' || szArgs[ 0 ] == '.' ) ? 1 : 0;         return TrieKeyExists( g_tTriggers, szArgs[ iStart ] ) ? PLUGIN_HANDLED : PLUGIN_CONTINUE; }

This is Scripting Help, so I expect you to be able to know how to code and be able to add the part for the file yourself, or ask for help if needed.
If you can't code, then I'll move this to Suggestions/Requests where it can be done for you.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 08-08-2012 at 14:14.
Exolent[jNr] is offline
Caldeum
Senior Member
Join Date: Jul 2010
Location: United Kingdom
Old 08-08-2012 , 13:21   Re: Hide chat Triggers
Reply With Quote #3

ok thanks. i check this code doesn't work for me. Any help?
__________________
Of all the things I lost, I miss my brain the most.
Caldeum is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-08-2012 , 14:14   Re: Hide chat Triggers
Reply With Quote #4

I had the start index check backwards. Should work now.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Caldeum
Senior Member
Join Date: Jul 2010
Location: United Kingdom
Old 08-08-2012 , 14:41   Re: Hide chat Triggers
Reply With Quote #5

Code is hiding /rank and message of rank, i don't see message of trigger.
__________________
Of all the things I lost, I miss my brain the most.
Caldeum is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-08-2012 , 14:47   Re: Hide chat Triggers
Reply With Quote #6

Put this plugin after the rank plugin.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Caldeum
Senior Member
Join Date: Jul 2010
Location: United Kingdom
Old 08-08-2012 , 15:20   Re: Hide chat Triggers
Reply With Quote #7

Thanks. Love you
__________________
Of all the things I lost, I miss my brain the most.
Caldeum is offline
Caldeum
Senior Member
Join Date: Jul 2010
Location: United Kingdom
Old 08-19-2012 , 05:58   Re: Hide chat Triggers
Reply With Quote #8

When another player type /rank i see his message how to hide not only when i type but when other player too?
__________________
Of all the things I lost, I miss my brain the most.
Caldeum 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 05:43.


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