Raised This Month: $ Target: $400
 0% 

Speech


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Unidentified
Senior Member
Join Date: Aug 2005
Location: Compton, L.A. Thug
Old 12-27-2005 , 18:29   Speech
Reply With Quote #1

When I used this, It gives a response to everything 'EXCEPT' the containi I put. Looky.

Code:
public plugin_init(){     register_clcmd("say","HandleSay") } public HandleSay(id) {     new Speech[192]     read_args(Speech,192)     remove_quotes(Speech)     if( (containi(Speech, "my trigger") == -1)) {         client_print(id,print_chat, "My response")     }     return PLUGIN_CONTINUE }

What's causing this? It's becoming annoying.
Unidentified is offline
Sneakpeek
Member
Join Date: Dec 2005
Location: Who cares really?
Old 12-27-2005 , 18:35  
Reply With Quote #2

I belive its just
Code:
if((containi(Speech, "my trigger")))

and not with the
Code:
== -1

...at the end.

Because that would print your response if your message does not contain "my trigger"
Sneakpeek is offline
Unidentified
Senior Member
Join Date: Aug 2005
Location: Compton, L.A. Thug
Old 12-27-2005 , 18:37  
Reply With Quote #3

No. Same result.
Unidentified is offline
Sneakpeek
Member
Join Date: Dec 2005
Location: Who cares really?
Old 12-27-2005 , 18:40  
Reply With Quote #4

Oh now I see whats wrong.

Code:
new Speech[192] read_args(Speech, 191) //You had 192 here

(It still aint "== -1" at the end as I said in the first post)

And btw, you had two "(" at your if statement.
(Cant remeber the word for it )

Code:
//It should be if(containi(Speech, "my trigger")) //And not if((containi(Speech, "my trigger")))
Sneakpeek is offline
Belsebub
Senior Member
Join Date: Feb 2005
Location: Sweden
Old 12-27-2005 , 18:43  
Reply With Quote #5

should be
Code:
if( containi(Speech, "my trigger") != -1)
Belsebub 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 07:28.


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