Function Creating
#7
No problem.
After reading the color processing over once again, I think it may work, although it's extremely poorly written.
The LOG function takes a single string as the argument and outputs the string into the server's console and logfile. Similar with LOGINFO, LOGWARNING and LOGERROR, each used for the appropriate severity of the logged message. They're documented in the API docs in the Globals section:
http://mc-server.xoft.cz/LuaAPI/Globals.html#functions

Oh wait. Who calls the LoadRules() function? Someone needs to call it once on server initialization - most likely in the Initialize function. Without it, the messages are not initialized so they won't display.
Also, you'll need to initialize the Messages variable. As it stands, Lua parses it as "global variable", thus it has the value nil by default, and using it as an (array-)table will crash the plugin.
I recommend making as much stuff as possible local:
local Rules = {}  -- the container for the rules, empty array by default
local function ShowRulesTo(Player)
...
function HandleRulesCommand(...)  -- must be global because it's called from another file
...
function LoadRules(...)  -- must be global because it's called from another file.
Reply
Thanks given by:


Messages In This Thread
Function Creating - by RKyle - 10-03-2014, 09:37 PM
RE: Function Creating - by Seadragon91 - 10-03-2014, 09:43 PM
RE: Function Creating - by RKyle - 10-03-2014, 09:46 PM
RE: Function Creating - by xoft - 10-03-2014, 09:48 PM
RE: Function Creating - by xoft - 10-03-2014, 09:50 PM
RE: Function Creating - by RKyle - 10-03-2014, 10:02 PM
RE: Function Creating - by xoft - 10-03-2014, 10:46 PM
RE: Function Creating - by RKyle - 10-04-2014, 12:01 AM
RE: Function Creating - by xoft - 10-04-2014, 12:49 AM



Users browsing this thread: 1 Guest(s)