{"id":30267115,"url":"https://github.com/xxshady/altv-rust","last_synced_at":"2025-10-10T10:35:12.632Z","repository":{"id":103677485,"uuid":"582118781","full_name":"xxshady/altv-rust","owner":"xxshady","description":"SUSPENDED","archived":false,"fork":false,"pushed_at":"2025-02-21T16:32:09.000Z","size":244702,"stargazers_count":33,"open_issues_count":4,"forks_count":4,"subscribers_count":4,"default_branch":"release","last_synced_at":"2025-09-26T05:59:56.467Z","etag":null,"topics":["altv","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/altv","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xxshady.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-12-25T18:53:27.000Z","updated_at":"2025-08-11T20:04:42.000Z","dependencies_parsed_at":"2023-12-29T17:32:56.994Z","dependency_job_id":"9a688f1b-e678-4389-9b8f-404ca6b796b6","html_url":"https://github.com/xxshady/altv-rust","commit_stats":null,"previous_names":[],"tags_count":163,"template":false,"template_full_name":null,"purl":"pkg:github/xxshady/altv-rust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xxshady%2Faltv-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xxshady%2Faltv-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xxshady%2Faltv-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xxshady%2Faltv-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xxshady","download_url":"https://codeload.github.com/xxshady/altv-rust/tar.gz/refs/heads/release","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xxshady%2Faltv-rust/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279003544,"owners_count":26083595,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["altv","rust"],"created_at":"2025-08-15T23:27:09.443Z","updated_at":"2025-10-10T10:35:12.596Z","avatar_url":"https://github.com/xxshady.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# This project is suspended\n\nCurrently on hold due to unclear situation with alt:V.\n\n# alt:V API for Rust\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg height=\"150px\" src=\"https://github.com/user-attachments/assets/f6ef83ce-9833-4c80-a740-bbed4fcdd4c3\"/\u003e\n\u003c/div\u003e\n\n[![crates.io](https://img.shields.io/crates/v/altv.svg)](https://crates.io/crates/altv)\n\n```rust\naltv::events::on_player_connect(|event| {\n  let name = event.player.name()?;\n  altv::log!(\"player with name: {name} connected!\");\n  Ok(())\n});\n```\n\nNew server-side [Rust](https://www.rust-lang.org) module for [alt:V](https://altv.mp) platform\n\n**Big** thanks to the [creator](https://github.com/justdimaa) of the [first Rust module](https://github.com/justdimaa/altv-rs), as their work helped me understand how to start my own module\n\n## Client-side part\n\nAt first it was [native implementation](https://github.com/xxshady/altv-rust/tree/clientside-shit) using [wasmtime](https://wasmtime.dev/) without JavaScript.\n[It worked](https://youtu.be/6HoV71wxJ8I), but because alt:V does not allow you to use custom client-side modules (.dll)\nin production without approval, integration into the client core, constant maintenance and more than 0 people using this module,\nI switched to a more realistic approach, [JavaScript WASM](https://github.com/xxshady/altv-esbuild-rust-wasm/tree/clientside-api-prototype)\n\n## Docs\n\nAPI documentation can be found [here](https://docs.rs/altv)\n\n## How to use\n\nFirst you need to [install](https://rust-lang.github.io/rust-bindgen/requirements.html#installing-clang) LLVM because it's required by autocxx crate\n\n\u003e [!WARNING]\n\u003e Currently on Windows latest version of LLVM [doesn't work](https://github.com/google/autocxx/issues/1327#issuecomment-2075460893) with Rust module, you need to install 17.0.1, for example with winget you can do it using this command `winget install LLVM.LLVM --version 17.0.1` (add `--force` if it fails)\n\n\u003e [!IMPORTANT]\n\u003e On Windows set LIBCLANG_PATH as an environment variable pointing to the bin directory of your LLVM install. For example, if you installed LLVM to D:\\programs\\LLVM, then you'd set the value to be D:\\programs\\LLVM\\bin. You also need to have installed Visual Studio with MSVC compiler (usually installed with Rust using Rustup)\n\n\u003e [!NOTE]\n\u003e If you have similar error: `src/alt_bridge.h:5:10: fatal error: 'memory' file not found` when installing or building altv_internal_sdk, try [this](https://stackoverflow.com/questions/26333823/clang-doesnt-see-basic-headers/75546125#75546125)\n\n\u003c!-- // TODO: update it --\u003e\n\u003c!-- [Video format of this tutorial](https://youtu.be/PRIJsRdjiGg) if you are more into video tutorials --\u003e\n\n1. Use [`altvup`](./altvup/README.md) to install `rust-module` binary and alt:V server files\n\n2. Create new cargo package with `cargo new altv-resource --lib`\n\n3. Configure cargo to compile your crate as dynamic library in your `Cargo.toml`\n\n```toml\n[lib]\ncrate-type = ['cdylib']\n```\n\n4. After that you can install [`altv`](https://crates.io/crates/altv) crate with: `cargo add altv`\n\n5. Next step will be to add main function to your resource (`src/lib.rs`)\n\n```rust\nuse altv::prelude::*;\n\n#[altv::main] // This is required\nfn main() -\u003e impl altv::IntoVoidResult {\n  altv::log!(\"~gl~hello world\");\n}\n```\n\n6. Now you can build your resource with `cargo build`\n\n7. In `target/debug/` you should see the dynamic library (`.dll` or `.so`) you just compiled (if you don't see it, make sure you set `lib.crate-type` to `['cdylib']`, see step 3)\n\n8. Create new alt:V resource, in `resources` directory of your server\n\n9. Copy compiled dynamic library (`.dll` or `.so`) to resource directory\n\n10. Create [`resource.toml`](https://docs.altv.mp/articles/configs/resource.html) with this content:\n\n```toml\ntype = 'rs'\n\n# your compiled crate as .dll or .so\nmain = 'example.so'\n# note: if you are developing on windows and your production server is running\n#       on linux you can use .module extension for your file (so here it will be example.module) \n#       and then there will be no need to change resource.toml between linux and windows\n```\n\n11. Don't forget to add resource to [`server.toml`](https://docs.altv.mp/articles/configs/server.html)\n\n```toml\n# ...\nresources = ['your-rust-resource']\n# ...\n```\n\n12. Now you can start `altv-server`\n\n\u003e [!NOTE]\n\u003e If you are on Linux don't forget to run `chmod +x` for `altv-server` and `altv-crash-handler`:\n\n```shell\nchmod +x altv-server\nchmod +x altv-crash-handler\n```\n\n13. If you have done everything correctly, you should see green \"hello world\" message in the console\n\n14. For development purposes it's also possible to [reload](https://docs.rs/altv/latest/altv/reloading_docs/index.html) Rust resources dynamically.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxxshady%2Faltv-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxxshady%2Faltv-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxxshady%2Faltv-rust/lists"}