Raised This Month: $ Target: $400
 0% 

Toggled by someone saying a certain word.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-26-2010 , 10:11   Re: Toggled by someone saying a certain word.
Reply With Quote #1

Quote:
Originally Posted by PropKiller View Post
It comes up with an error, that says: Undefined symbol "msg". Is there something I should have changed from your example? (Again, im new.)
His example is incomplete and incorrect .

Remember you are talking with AMX'ers .

Code:
if( StrContains(your_string_var_here, "blank", false) != -1 )
{
    // string contains "blank"
}
My example is incomplete so you must make it complete .
__________________
fysiks is offline
RedRobster
Veteran Member
Join Date: Apr 2010
Location: Your Closet
Old 06-26-2010 , 11:12   Re: Toggled by someone saying a certain word.
Reply With Quote #2

Quote:
Originally Posted by fysiks View Post
His example is incomplete and incorrect .

Remember you are talking with AMX'ers .

Code:
if( StrContains(your_string_var_here, "blank", false) != -1 )
{
    // string contains "blank"
}
My example is incomplete so you must make it complete .
I apologize. Didn't notice that it will return -1 if it doesn't contain it.

**For your request about getting the strings, http://docs.sourcemod.net/api/index....id=473&I'm not going to try to show you again...as I clearly have an extremely limited knowledge of SourceMod.

Last edited by RedRobster; 06-26-2010 at 11:15.
RedRobster is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-26-2010 , 11:28   Re: Toggled by someone saying a certain word.
Reply With Quote #3

Quote:
Originally Posted by RedRobster View Post
http://docs.sourcemod.net/api/index....id=473&I'm not going to try to show you again...as I clearly have an extremely limited knowledge of SourceMod.
Actually it would be GetCmdArgString()
__________________
fysiks is offline
RedRobster
Veteran Member
Join Date: Apr 2010
Location: Your Closet
Old 06-26-2010 , 11:32   Re: Toggled by someone saying a certain word.
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
Actually it would be GetCmdArgString()
Ah, yeah. Sorry. He's hooking "say", not doing a console command.
RedRobster is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 06-26-2010 , 16:54   Re: Toggled by someone saying a certain word.
Reply With Quote #5

For some reason I use to think it was this simple:

PHP Code:
#include <amxmodx>

#define PLUGIN    "Switch Enable"
#define AUTHOR    "Shadow"
#define VERSION    "1.0"

new bool:gSwitch[33/*= false*/

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd"say blah""cmdSwitch" )
    
register_clcmd"say_team blah""cmdSwitch" )
}

public 
cmdSwitchid )
{
    if( 
gSwitch[id] == false )
    {
        
gSwitch[id] = true;
        
client_printid"Enabled" )
    }
    if( 
gSwitch[id] == true )
    {
        
gSwitch[id] = false;
        
client_printid"Disabled" )
    }

__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX 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 14:43.


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