Uknown Command
#13
(Found out this is not true)It really depends. When you call those functions from the global code in the file (code not wrapped within any function), it will not work. If you call the function as a reaction to something MCServer calls (such as the Initialize() method, or the hook handlers etc.), then it will work, because at that time the globals will be fully primed.

So, for example, this WON'T work:
function cool()
  hi()
end

function hi()
  print("hi")
end

function intermediate()
  cool()
end

-- Global call, fails:
intermediate()

You should not use this anyway, you should call any initialization in the Initialize() function and then react to callbacks from the server; only use global calls for trivial things, such as setting up global singletons etc.

(Use [ shcode=lua ] code [ /shcode ] in the forum to post Lua code)
Reply
Thanks given by:


Messages In This Thread
Uknown Command - by Shadowraix - 05-10-2015, 12:10 PM
RE: Uknown Command - by xoft - 05-10-2015, 03:51 PM
RE: Uknown Command - by Shadowraix - 05-10-2015, 04:15 PM
RE: Uknown Command - by xoft - 05-10-2015, 04:22 PM
RE: Uknown Command - by Shadowraix - 05-11-2015, 04:56 AM
RE: Uknown Command - by worktycho - 05-11-2015, 05:32 AM
RE: Uknown Command - by xoft - 05-11-2015, 07:28 AM
RE: Uknown Command - by Shadowraix - 05-11-2015, 09:42 AM
RE: Uknown Command - by xoft - 05-11-2015, 04:45 PM
RE: Uknown Command - by Shadowraix - 05-12-2015, 06:49 AM
RE: Uknown Command - by xoft - 05-12-2015, 07:02 AM
RE: Uknown Command - by Shadowraix - 05-12-2015, 07:07 AM
RE: Uknown Command - by xoft - 05-12-2015, 07:22 AM
RE: Uknown Command - by Shadowraix - 05-12-2015, 07:27 AM
RE: Uknown Command - by xoft - 05-12-2015, 07:24 AM



Users browsing this thread: 2 Guest(s)