LuaCommandProcessing
Posted: Fri May 12, 2017 10:33 pm
Hi
Can someone explain me how it works?
In my control.lua, I set up :
commands.add_command("clearDb","input db to clear",
function(db)
if not db or db=="trains" then
global.trains={}
end
if not db or db=="trainstations" then
global.trainStations={}
end
end
)
Then, I call it in the lua console :
/c commands.clearDb()
But it says that the key "clearDb" doesn't exist... why!!!???
THanks
Hermios
Can someone explain me how it works?
In my control.lua, I set up :
commands.add_command("clearDb","input db to clear",
function(db)
if not db or db=="trains" then
global.trains={}
end
if not db or db=="trainstations" then
global.trainStations={}
end
end
)
Then, I call it in the lua console :
/c commands.clearDb()
But it says that the key "clearDb" doesn't exist... why!!!???
THanks
Hermios