LuaRocks is the package manager for Lua modules.
Small tricks allow you to use it on MTA server.
Installing
Linux x64:
Windows x86:
Usage example:
Installing packages is done by typing commands such as:
Linux:
luarocks install lua-cjson
Windows:
luarocks.exe install lua-cjson
Now you are ready to load this package from MTA. Do this in your Lua script file:
-- You should run this function once in your resource
initLuaPackage()
-- Load library
local json = require "cjson"
-- Use it
print( json.encode({ key = "example" }) )
It's done.
Tell me in PM, if you have any remarks and additional information for this tutorial. Thx