Jump to content

PM system


Albinix

Recommended Posts

HI i'm making a pm system. But i got one problem, you can only send one word :S

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"

Link to comment

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 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...