MAB Posted August 22, 2015 Posted August 22, 2015 how to know if the chat message of a player contains a word? i mean i want to know if the player typed a word between his message to do a function? You can find me here.
darhal Posted August 22, 2015 Posted August 22, 2015 u mean using a commands ? for e.g: /gc text ? #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
JR10 Posted August 22, 2015 Posted August 22, 2015 If you don't mean commands then use onPlayerChat and string.find. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
darhal Posted August 22, 2015 Posted August 22, 2015 if u mean commands use this : function test(plr, cmd, ...) text = table.concat({..}, " ") outputChatBox("Some CHAT :" ..text) end addComandHandler("gc", test) -- FOR EXAMPLE /gc #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
MAB Posted August 22, 2015 Author Posted August 22, 2015 JR i need two things from . 1.example about what u r saying 2. your skype / facebook because i need to talk to u in arabic You can find me here.
JR10 Posted August 23, 2015 Posted August 23, 2015 addEventHandler('onPlayerChat', root, function(msg, type) if (type == 0 and string.find(msg, 'word') then --do something --source here is the player who sent the message end end) Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now