{"id":17224154,"url":"https://github.com/thenormalnij/mta-package","last_synced_at":"2025-04-14T00:35:56.087Z","repository":{"id":78208427,"uuid":"568435759","full_name":"TheNormalnij/MTA-package","owner":"TheNormalnij","description":"Package library binding via module for MTA","archived":false,"fork":false,"pushed_at":"2024-10-30T02:20:57.000Z","size":249,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T14:51:53.054Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheNormalnij.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-11-20T14:28:48.000Z","updated_at":"2025-02-15T16:00:42.000Z","dependencies_parsed_at":"2024-10-29T06:22:06.542Z","dependency_job_id":"184ca925-6675-4391-8bc0-71a8adf1285a","html_url":"https://github.com/TheNormalnij/MTA-package","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheNormalnij%2FMTA-package","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheNormalnij%2FMTA-package/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheNormalnij%2FMTA-package/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheNormalnij%2FMTA-package/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheNormalnij","download_url":"https://codeload.github.com/TheNormalnij/MTA-package/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248802635,"owners_count":21163891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T04:10:19.326Z","updated_at":"2025-04-14T00:35:56.068Z","avatar_url":"https://github.com/TheNormalnij.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Building\r\n\r\n## Linux\r\n```bash\r\ncmake -B ./build ./\r\ncmake --build ./build\r\n```\r\n\r\n## Windows\r\nFor x86 MTA server:\r\n```bat\r\ncmake -A Win32 . -B build\r\ncmake --build build --config Release\r\n```\r\n\r\nfor x64 MTA server:\r\n```bat\r\ncmake -A x64 . -B build\r\ncmake --build build --config Release\r\n```\r\n\r\n# Installation\r\n\r\nYou can get prebuilded packages on [GitHub releases page](https://github.com/TheNormalnij/MTA-package/releases)\r\n\r\n## Windows\r\n\r\n* 32 bit: Copy 32 bit `ml_package.dll` into the `MTA San Andreas\\server\\mods\\deathmatch\\modules\\` directory.\r\n* 64 bit: Copy 64 bit `ml_package.dll` into the `MTA San Andreas\\server\\x64\\modules\\` directory.\r\n\r\nThen, add the following line in `mtaserver.conf`:\r\n\r\n```xml\r\n  \u003cmodule src=\"ml_package.dll\" /\u003e\r\n```\r\n## GNU/Linux\r\n\r\n* 32 bit: Copy 32 bit ml_package.so into the `mods/deathmatch/modules/` directory.\r\n* 64 bit: Copy 64 bit ml_package.so into the `x64/modules/` directory.\r\n\r\nThen, add the following line in `mtaserver.conf`:\r\n\r\n```xml\r\n  \u003cmodule src=\"ml_package.so\" /\u003e\r\n```\r\n\r\n# Usage\r\n\r\n```lua\r\n-- You can use absolute path for require function\r\n-- The module start searching from 'mods/deathmatch/resources' folder\r\nlocal module = require \"folder1.folder2.resourceName.resourceFile\"\r\n\r\n-- Relative path is supported too. It starts with \":\"\r\nlocal module = require \":resourceName.resourceFile\"\r\n\r\n-- You can use \"mods/deathmatch/lua/server\" folder for shared code\r\nlocal fooModule = require \"mysmalllib\"\r\nlocal barModule = require \"mylib.libfile\"\r\n```\r\n\r\n# LuaRocks integration\r\n\r\n[LuaRocks](https://luarocks.org/) has some usefull native modules for Lua. `require` supports native modules.\r\n\r\n## Linux\r\n\r\n1. Install Lua and luarocks\r\n```sh\r\nsudo apt install luarocks lua5.1\r\n```\r\n\r\n2. Copy `scripts/luarocks.sh` from this repository to your MTA server forlder.\r\n\r\n3. Now you can use `luarocks.sh` to build native modules\r\n```sh\r\n./luarocks.sh install rapidjson\r\n```\r\n\r\n```lua\r\nlocal rapidjson = require \"rapidjson\"\r\n```\r\n\r\n## Windows x86 only\r\n\r\n1. Install Visual Studio and CMake via Visual Studio Installer\r\n2. Copy `scripts/luarocks.ps1` from this repository to your MTA server forlder.\r\n\r\n3. Now you can use `luarocks.ps1` to build native modules with using powerschell console\r\n```powershell\r\n.\\luarocks.ps1 install rapidjson\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthenormalnij%2Fmta-package","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthenormalnij%2Fmta-package","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthenormalnij%2Fmta-package/lists"}