Advertisement
niunzin

[LUA] Função para argumentos em comando

May 20th, 2013
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.30 KB | None | 0 0
  1. function split(str)
  2.     local t = {}
  3.     for w in str:gmatch("%S+") do table.insert(t,w) end
  4.     return t
  5. end
  6.  
  7. function eventChatCommand(player, mes)
  8.     args = split(mes)
  9.     command = table.remove(args, 1)
  10.     if(player == "Niunzin") then
  11.         if(command == "loadmap") then
  12.             tfm.exec.newGame(args[1])
  13.         end
  14.     end
  15. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement