Albinix Posted January 15, 2011 Posted January 15, 2011 HI i'm making a pm system. But i got one problem, you can only send one word function PMHandler(player,command,id,message) ... end addCommandHandler("pm",PMHandler) can you make so spaces are allowed in one of the command arguments (in my case the message argument)? if i write "/pm 1 hi all" it will only output "hi" not "hi all"
proracer Posted January 15, 2011 Posted January 15, 2011 Learn from this script. https://community.multitheftauto.com/index.php?p=resources&s=details&id=1562
SDK Posted January 15, 2011 Posted January 15, 2011 Commandhandlers work this way: function testFunction( player, command, word1, word2, word3, word4 ) If you want to get all words, use this: function testFunction(player, command, word1, ... ) allWords = table.concat(arg, " ") -- this will be all words from word2 to the last word in one string Learn Lua - Learn to script - GUI scripting Scripter tools - Find/fix errors yourself(!) Don't pm me for scripting help, keep it for the Scripting subforum!
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