Raised This Month: $ Target: $400
 0% 

Problem with Say triggers - Resolved


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nomarky
SourceMod Donor
Join Date: Sep 2007
Old 08-15-2008 , 12:55   Problem with Say triggers - Resolved
Reply With Quote #1

Having a little trouble getting this to work

PHP Code:
public Action:SayHook(clientargs)
{
    if(
GetConVarInt(helpEnabled) == 1)
    {   
        new 
String:speech[128];
        
GetCmdArgString(speechsizeof(speech));
        
        new 
startidx 0;
        if (
speech[0] == '"')
        {
            
startidx 1;
            
            new 
len strlen(speech);
            if (
speech[len-1] == '"')
            {
                
speech[len-1] = '\0';
            }
        }
        
        if(
strcmp(speech[startidx],"list sounds",false) == || 
           
strcmp(speech[startidx],"soundlist",false) == 0)
        {
        
PrintToChat(client"Say !soundlist in chat for sounds list");
        return 
Plugin_Handled;    
        
        }else if{ 
           
strcmp(speech[startidx],"servers",false) == 0)        
        {
        
PrintToChat(client"Say !servers in chat for server menu");
        return 
Plugin_Handled;    
        }    
            
        return 
Plugin_Continue;
    }    

Basically it works fine untill I add the second trigger text ("servers") and then it won't compile. Would like to get this working as it helps players find features on the server, which may not use the triggers they are used to elsewhere.

Any ideas?

Last edited by Nomarky; 08-15-2008 at 15:47.
Nomarky is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 08-15-2008 , 13:30   Re: Problem with Say triggers
Reply With Quote #2

It's if () instead of if {}, just like you did the first time.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
Nomarky
SourceMod Donor
Join Date: Sep 2007
Old 08-15-2008 , 15:13   Re: Problem with Say triggers
Reply With Quote #3

Doh!! Thanks.

Can anyone tell me how to do the same thing, but leave the original chat text displayed on the server?

Edit: Removing "return Plugin_Handled;" does this...

Last edited by Nomarky; 08-15-2008 at 15:46. Reason: Sussed it...
Nomarky 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 13:48.


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