Quote:
Originally Posted by SpiffyBiff
I've been trying to get this to work on my server without looking too much into the actual coding. I'm working purely on the examples here, and running into problems.
Here's what my player_say.cfg says:
Quote:
setinfo word1 0
setinfo word2 0
setinfo word3 0
setinfo word4 0
setinfo word5 0
setinfo word6 0
setinfo word7 0
setinfo word8 0
es_token word1 "event_var(text)" 1
es_token word2 "event_var(text)" 2
es_token word3 "event_var(text)" 3
es_token word4 "event_var(text)" 4
es_token word5 "event_var(text)" 5
es_token word6 "event_var(text)" 6
es_token word7 "event_var(text)" 7
es_token word8 "event_var(text)" 8
if (word1 equalto "join") then ma_say "[bA] is an invite only clan"
if (word2 equalto "join") then ma_say "[bA] is an invite only clan"
if (word3 equalto "join") then ma_say "[bA] is an invite only clan"
if (word4 equalto "join") then ma_say "[bA] is an invite only clan"
if (word5 equalto "join") then ma_say "[bA] is an invite only clan"
if (word6 equalto "join") then ma_say "[bA] is an invite only clan"
if (word7 equalto "join") then ma_say "[bA] is an invite only clan"
if (word8 equalto "join") then ma_say "[bA] is an invite only clan"
if (word1 equalto "recruit") then ma_say "[bA] is an invite only clan"
if (word2 equalto "recruit") then ma_say "[bA] is an invite only clan"
if (word3 equalto "recruit") then ma_say "[bA] is an invite only clan"
if (word4 equalto "recruit") then ma_say "[bA] is an invite only clan"
if (word5 equalto "recruit") then ma_say "[bA] is an invite only clan"
if (word6 equalto "recruit") then ma_say "[bA] is an invite only clan"
if (word7 equalto "recruit") then ma_say "[bA] is an invite only clan"
if (word8 equalto "recruit") then ma_say "[bA] is an invite only clan"
if (word1 equalto "site") then ma_say "http://www.baclan.net"
if (word2 equalto "site") then ma_say "http://www.baclan.net"
if (word3 equalto "site") then ma_say "http://www.baclan.net"
if (word4 equalto "site") then ma_say "http://www.baclan.net"
if (word5 equalto "site") then ma_say "http://www.baclan.net"
if (word6 equalto "site") then ma_say "http://www.baclan.net"
if (word7 equalto "site") then ma_say "http://www.baclan.net"
if (word8 equalto "site") then ma_say "http://www.baclan.net"
if (word1 equalto "hax") then ma_say "Nope, you just suck"
if (word2 equalto "hax") then ma_say "Nope, you just suck"
if (word3 equalto "hax") then ma_say "Nope, you just suck"
if (word4 equalto "hax") then ma_say "Nope, you just suck"
if (word5 equalto "hax") then ma_say "Nope, you just suck"
if (word6 equalto "hax") then ma_say "Nope, you just suck"
if (word7 equalto "hax") then ma_say "Nope, you just suck"
if (word8 equalto "hax") then ma_say "Nope, you just suck"
if (word1 equalto "gay") then ma_say "Somewhere, the Village People are crying"
if (word2 equalto "gay") then ma_say "Somewhere, the Village People are crying"
if (word3 equalto "gay") then ma_say "Somewhere, the Village People are crying"
if (word4 equalto "gay") then ma_say "Somewhere, the Village People are crying"
if (word5 equalto "gay") then ma_say "Somewhere, the Village People are crying"
if (word6 equalto "gay") then ma_say "Somewhere, the Village People are crying"
if (word7 equalto "gay") then ma_say "Somewhere, the Village People are crying"
if (word8 equalto "gay") then ma_say "Somewhere, the Village People are crying"
if (word1 equalto "ip") then ma_say "This server's IP is 66.225.249.170:27015"
if (word2 equalto "ip") then ma_say "This server's IP is 66.225.249.170:27015"
if (word3 equalto "ip") then ma_say "This server's IP is 66.225.249.170:27015"
if (word4 equalto "ip") then ma_say "This server's IP is 66.225.249.170:27015"
if (word5 equalto "ip") then ma_say "This server's IP is 66.225.249.170:27015"
if (word6 equalto "ip") then ma_say "This server's IP is 66.225.249.170:27015"
if (word7 equalto "ip") then ma_say "This server's IP is 66.225.249.170:27015"
if (word8 equalto "ip") then ma_say "This server's IP is 66.225.249.170:27015"
if (word1 equalto "lag") then ma_say "Stop making excuses"
if (word2 equalto "lag") then ma_say "Stop making excuses"
if (word3 equalto "lag") then ma_say "Stop making excuses"
if (word4 equalto "lag") then ma_say "Stop making excuses"
if (word5 equalto "lag") then ma_say "Stop making excuses"
if (word6 equalto "lag") then ma_say "Stop making excuses"
if (word7 equalto "lag") then ma_say "Stop making excuses"
if (word8 equalto "lag") then ma_say "Stop making excuses"
|
Now, the reason I added 8 possible words instead of the 3 shown previously in the thread because I obviously wanted it to catch the trigger word if it's past the 3rd word in the phrase. I don't know if this is how I would do it however.
Basically, I'm not getting any response when I type the trigger words in my server. If this looks wrong or there's an easier way to do this, then please let me know. Thanks.
|
First of all, you need to validate that EventScripts is installed correctly. Do you know if it's working for sure? I.e., if you place an es_msg at the beginning of the player_say.cfg (like the following) does it broadcast a message whenever anyone says something?
Code:
// player_say.cfg test
es_msg Someone said something: event_var(text)
To help you straight away with this particular code-- basically you don't want to put quotes around event_var(text)-- that guarantees that it won't be expanded because EventScripts will ignore it. So you'd want to remove the quotation marks when using es_token:
Code:
es_token word1 event_var(text) 1
es_token word2 event_var(text) 2
es_token word3 event_var(text) 3
es_token word4 event_var(text) 4
es_token word5 event_var(text) 5
es_token word6 event_var(text) 6
es_token word7 event_var(text) 7
es_token word8 event_var(text) 8
I'd also recommend using es_tell rather than ma_say, but that's just me. For example,
Code:
if (word1 equalto "lag") then es_tell event_var(userid) "Stop making excuses"
All of this being said, there's a quicker/simpler way to do something similar for each word. You can use es_string's replace function to kinda search for a substring. This is faster, but will also find "lag" in a word like "slagsworth" which you may not want:
Code:
es_setinfo mytext event_var(text)
es_string mytext replace "lag" "___"
// if the new text is now different from the old text, we know the word was found and replaced
if (server_var(mytext) notequalto event_var(text)) then es_tell event_var(userid) "Stop making excuses"
I hope this helps. Also, I have moved most EventScripts discussion over to my new forums. If you want more people helping, visit the forum in my signature.
Best of luck!
-Mattie