#dimension #fn #driver #intervals #timeout #global #meta #ok #events #interval


Rust server-side API for writing your gamemodes on alt:V

66 releases (2 stable)

15.1.0 Oct 22, 2023
15.0.0-rc.4 Aug 24, 2023
15.0.0-rc.1 Jul 23, 2023
0.3.1 Apr 17, 2023
0.2.0 Jun 13, 2020

#100 in Hardware support

Download history 219/week @ 2023-08-05 23/week @ 2023-08-12 76/week @ 2023-08-19 103/week @ 2023-08-26 106/week @ 2023-09-02 17/week @ 2023-09-09 29/week @ 2023-09-16 4/week @ 2023-09-23 76/week @ 2023-09-30 2/week @ 2023-10-07 107/week @ 2023-10-14 130/week @ 2023-10-21 98/week @ 2023-10-28 2/week @ 2023-11-04 8/week @ 2023-11-11 145/week @ 2023-11-18

257 downloads per month

MIT license


Server-side alt:V API for Rust


altv::events::on_player_connect(|event| {
    let name = event.player.name()?;
    altv::log!("player with name: {name} connected!");

New server-side Rust module for alt:V platform (WIP)

Big thanks to the creator of the first Rust module, as their work helped me understand how to start my own module


API documentation can be found here

How to use

Before start writing your server-side in Rust you need to install LLVM

If you are on Windows, don't forget to set LIBCLANG_PATH as an environment variable

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

Video format of this tutorial if you are more into video tutorials

  1. Create new cargo package with cargo new altv-resource --lib

  2. Configure cargo to compile your crate as cdylib in your Cargo.toml

crate-type = ['cdylib']
  1. After that you can install altv crate with: cargo add altv

  2. Next step will be to add main function to your resource (src/lib.rs)

use altv::prelude::*; // Entity, WorldObject traits

#[altv::main] // This is required
fn main() -> impl altv::IntoVoidResult {
    altv::log!("~gl~hello world");
  1. Now you can build your resource with cargo build

  2. In target/debug/ you should see the .dll or .so you just compiled (if you don't see it, make sure you set lib.crate-type to ["cdylib"], see step 2)

  3. Create new alt:V resource, in resources directory of your server

  4. Copy compiled .dll or .so to resource directory

  5. Create resource.toml with this content:

type = 'rs'
main = 'example.dll' # your compiled .dll or .so
  1. Don't forget to add resource to server.toml

  2. Now you can download rust-module .dll or .so from latest release or with cargo-altvup

  3. Copy it to modules directory of your server

  4. Add rust-module to server.toml like that:

modules = ['rust-module']
  1. Now if you have done everything correctly, you should see green "hello world" message in server console


~212K SLoC