From a8034e6ffd7cba3abaa73bb32424017704899a0d Mon Sep 17 00:00:00 2001 From: deluvas1911 Date: Mon, 12 Feb 2024 11:20:54 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=208cbc7850?= =?UTF-8?q?e2b195940f50d7be8a6ef3f9a8040417=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- articles/configs/server.html | 3 +++ index.json | 2 +- manifest.json | 2 +- search-index.json | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/articles/configs/server.html b/articles/configs/server.html index f53b25b981..fda1aab016 100644 --- a/articles/configs/server.html +++ b/articles/configs/server.html @@ -258,6 +258,9 @@

The server.toml configur # Obfuscate resource names hashClientResourceName = true +# Disables creation of props marked as "optional" +disableOptionalProps = false + # The amount of server side managed entities per type that can be streamed at the same time per player. If more than the set amount of entities are in streaming range, the closest n entities (as defined below) of the specific type will be streamed. Changing these values can cause performance and stability issues. [maxStreaming] peds = 128 # Max 220, shared type for server side created NPC peds + player peds diff --git a/index.json b/index.json index 0695234044..163e4620d3 100644 --- a/index.json +++ b/index.json @@ -1 +1 @@ -{"articles/audio.html":{"type":"article","href":"articles/audio.html","title":"Audio API","keyword":"Audio API In alt:V there's an API that allows server developers to play sounds (remote or local) or audio streams (remote) in world through GTA sound system. This allows to play sounds with spatial and environmental effects without need to load them via modding. The system also supports custom filters (see Voice docs ) and GTA audio categories. Usage Audio class in JS API reference AudioOutputWorld class in JS API reference AudioOutputAttached class in JS API reference AudioOutputFrontend class in JS API reference Audio class in C# API reference AudioOutputWorld class in C# API reference AudioOutputAttached class in C# API reference AudioOutputFrontend class in C# API reference In order to use Audio API you need to create Audio instance and add one or multiple audio outputs to it. Audio outputs There are three types of audio outputs in alt:V API: AudioOutputWorld - outputs audio on a specified world coordinates AudioOutputAttached - outputs audio from specified entity AudioOutputFrontend - outputs audio on a local player (non-spatial, no environmental effects) By default all outputs use radio audio category. Audio constructor Constructor of the Audio class accepts three arguments: source - path to the audio file, supports: /path/to/file - path to file in current resource @assetname/path/to/file - path to file in asset pack https://example.com/path/to/file - path to a remote file volume - volume of the audio, value between 0 and 1 radio - whether the file is an endless audio stream (e.g. web radio) Audio filters You can apply audio filters to an audio output object. See Audio filters for more info. const output = new alt.AudioOutputAttached(alt.Player.local); output.filter = alt.hash('walkietalkie'); Example const output = new alt.AudioOutputAttached(alt.Player.local); // const output = new alt.AudioOutputFrontend(); // const output = new alt.AudioOutputWorld(new alt.Vector3(0, 0, 71)); const audio = new alt.Audio(\"https://upload.wikimedia.org/wikipedia/commons/c/c8/Example.ogg\"); audio.on(\"inited\", () => { alt.log(`inited`); }); audio.on(\"streamStarted\", () => { alt.log(`streamStarted`); }); audio.on(\"streamEnded\", () => { alt.log(`streamEnded`); }); audio.on(\"streamPaused\", () => { alt.log(`streamPaused`); }); audio.on(\"streamReset\", () => { alt.log(`streamReset`); }); audio.on(\"streamSeek \", (time) => { alt.log(`streamSeek: ${time}`); }); audio.on(\"volumeChange \", (vol) => { alt.log(`volumeChange: ${vol}`); }); audio.on(\"error\", (code, message) => { alt.log(`error: ${code} | ${message}`); }); audio.addOutput(output); audio.play(); Warning Don't forget to destroy both Audio and all unused AudioOutputs after you're done with your sound! Audio categories GTA has an audio category system, which defines basic audio parameters like volume, distance, etc. Audio categories are located in categories.dat22.rel file. While it's possible to stream your own category file ( audio:/config/categories.dat22.rel , see Replacements docs for more info), you can modify existing categories (e.g. unused ones) on runtime using AudioCategory API. AudioCategory class in JS API reference AudioCategory class in C# API reference Examples Change volume of all radio sounds. const category = alt.AudioCategory.getForName(\"radio\"); category.volume = 10; Repurpose unused category to use in your own sounds, for example to have a radio like audio category that is much louder. Audio categories starting with video_editor_* are in most cases unused and can be used for this. const radio = alt.AudioCategory.getForName(\"radio\"); // Using the game radio audio category as source const category = alt.AudioCategory.getForName(\"video_editor_weapons_guns_bullet_impacts\"); // This will be our target 'custom' audio category category.volume = 1000; category.distanceRolloffScale = radio.distanceRolloffScale; category.plateauRolloffScale = radio.plateauRolloffScale; category.occlusionDamping = radio.occlusionDamping; category.environmentalFilterDamping = radio.environmentalFilterDamping; category.sourceReverbDamping = radio.sourceReverbDamping; category.distanceReverbDamping = radio.distanceReverbDamping; category.interiorReverbDamping = radio.interiorReverbDamping; category.environmentalLoudness = radio.environmentalLoudness; category.underwaterWetLevel = radio.underwaterWetLevel; category.stonedWetLevel = radio.stonedWetLevel; category.pitch = radio.pitch; category.lowPassFilterCutoff = radio.lowPassFilterCutoff; category.highPassFilterCutoff = radio.highPassFilterCutoff; // Lets use our 'custom' audio category to play audio const output = new alt.AudioOutputFrontend(\"video_editor_weapons_guns_bullet_impacts\"); const audio = new alt.Audio(\"https://upload.wikimedia.org/wikipedia/commons/c/c8/Example.ogg\"); audio.addOutput(output); audio.play(); You can find list of all available categories in AudioCategories enum See Audio filters for alt:V Voice examples using audio categories.","lang":""},"articles/audio_filters.html":{"type":"article","href":"articles/audio_filters.html","title":"Audio filters","keyword":"Audio filters alt:V Audio and Voice APIs support custom filters. Filters should be created on client side and allow server developers to add effects such as distortion, compressor, echo etc. Usage AudioFilter class in JS API reference AudioFilter class in C# API reference Audio categories You can set audio category on a filter. The category will only have effect for voice channels. There are three default audio categories intended for voice provided by alt:V: altv_voice_proximity altv_voice_megaphone altv_voice_whisper Example const walkieTalkieFilter = new AudioFilter('walkietalkie') walkieTalkieFilter.addBqfEffect(0, 1400, 0, 0.86, 0, 0, 1); walkieTalkieFilter.addBqfEffect(1, 900, 0, 0.83, 0, 0, 2); walkieTalkieFilter.addDistortionEffect(0, -2.95, -0.05, -0.08, 0.5, 3); const megaphoneFilter = new AudioFilter('megaphone'); megaphoneFilter.addBqfEffect(0, 2000, 0, 1, 0, 0, 1); megaphoneFilter.addBqfEffect(1, 1000, 0, 0.86, 0, 0, 2); megaphoneFilter.addDistortionEffect(0, -2.95, -0.05, -0.08, 0.25, 3); megaphoneFilter.addCompressor2Effect(5, -15, 3, 10, 200, 4); megaphoneFilter.audioCategory = 'altv_voice_megaphone'; const whisperFilter = new AudioFilter('whisper'); whisperFilter.audioCategory = 'altv_voice_whisper'; Controlling volume In case default volume of specific audio categories is too quiet, you can edit audio categories. See Audio category for more info.","lang":""},"articles/auto_reconnect.html":{"type":"article","href":"articles/auto_reconnect.html","title":"Auto reconnect","keyword":"Auto reconnect This article will explain the auto reconnect feature introduced in the 9.0 update. What is auto reconnect The auto reconnect allows the server to send a post request to the local client in order to initialize a connection / reconnection to the server. This feature is only available when the client and server are in debug mode and is intended for a smoother local development. It is important to note that you can also send the post request when you want, meaning it's possible to wait for your server to finish his startup procedure (fetching data from database, loading modules..). Script usage Javascript Typescript C# const RETRY_DELAY = 2500; const DEBUG_PORT = 9223; async function getLocalClientStatus() { try { const response = await fetch(`http://127.0.0.1:${DEBUG_PORT}/status`); return response.text(); } catch (error) { return null; } } async function connectLocalClient() { const status = await getLocalClientStatus(); if (status === null) return; if (status !== \"MAIN_MENU\" && status !== \"IN_GAME\") { setTimeout(() => connectLocalClient(), RETRY_DELAY); return; } try { await fetch(`http://127.0.0.1:${DEBUG_PORT}/reconnect`, { method: \"POST\", body: \"serverPassword\", // only needed when a password is set in the server.toml }); } catch (error) { console.log(error); } } connectLocalClient(); const enum Status { Loading = \"LOADING\", MainMenu = \"MAIN_MENU\", DownloadingFiles = \"DOWNLOADING_FILES\", Connecting = \"CONNECTING\", InGame = \"IN_GAME\", Disconnecting = \"DISCONNECTING\", Error = \"ERROR\", } const RETRY_DELAY = 2500; const DEBUG_PORT = 9223; async function getLocalClientStatus(): Promise { try { const response = await fetch(`http://127.0.0.1:${DEBUG_PORT}/status`); return response.text() as unknown as Status; } catch (error) { return null; } } async function connectLocalClient(): Promise { const status = await getLocalClientStatus(); if (status === null) return; if (status !== Status.MainMenu && status !== Status.InGame) { setTimeout(() => connectLocalClient(), RETRY_DELAY); return; } try { await fetch(`http://127.0.0.1:${DEBUG_PORT}/reconnect`, { method: \"POST\", body: \"serverPassword\", // only needed when a password is set in the server.toml }); } catch (error) { console.log(error); } } connectLocalClient(); using AltV.Net.Async; using System.Runtime.Serialization; using Timer = System.Timers.Timer; namespace Example { class ExampleResource : AsyncResource { private const int DebugPort = 9223; private const int RetryDelay = 2500; private readonly HttpClient _httpClient = new(); private readonly Timer _timer = new(RetryDelay); private enum ClientStatus { [EnumMember(Value = \"LOADING\")] Loading, [EnumMember(Value = \"MAIN_MENU\")] MainMenu, [EnumMember(Value = \"DOWNLOADING_FILES\")] DownloadingFiles, [EnumMember(Value = \"CONNECTING\")] Connecting, [EnumMember(Value = \"IN_GAME\")] InGame, [EnumMember(Value = \"DISCONNECTING\")] Disconnecting, [EnumMember(Value = \"ERROR\")] Error } private async Task GetLocalClientStatus() { try { var status = await _httpClient.GetStringAsync($\"http://127.0.0.1:{DebugPort}/status\"); var enumValue = typeof(ClientStatus).GetFields() .FirstOrDefault(f => f.GetCustomAttribute()?.Value == status)? .GetValue(null); return enumValue != null ? (ClientStatus)enumValue : ClientStatus.Error; } catch { return ClientStatus.Error; } } private async Task ConnectLocalClient() { var status = await GetLocalClientStatus(); if (status == ClientStatus.Error) return; if (status != ClientStatus.MainMenu && status != ClientStatus.InGame && !_timer.Enabled) { _timer.Start(); return; } if (status == ClientStatus.InGame && _timer.Enabled) { _timer.Stop(); return; } try { await _httpClient.PostAsync( $\"http://127.0.0.1:{DebugPort}/reconnect\", // Only needed when a password is set in the server.toml, otherwise pass null instead of StringContent new StringContent(\"serverPassword\") ); } catch (Exception ex) { Console.WriteLine($\"Reconnect failed: {ex}\"); } } public override void OnStart() { _timer.Elapsed += (_, _) => _ = ConnectLocalClient(); _ = ConnectLocalClient(); } public override void OnStop() { } } }","lang":""},"articles/branches.html":{"type":"article","href":"articles/branches.html","title":"Branches","keyword":"Branches In alt:V there are multiple development branches, which represent different development states of the alt:V client and server. The server and the client needs to be on the same branch to be able to connect. For normal users the release branch is recommended. Branch Overview Here you will get a overview of the available branches: Release This branch is for production, it is consider as stable. This is the only branch, where the masterlist is available. If you run a public server, this server should run this branch. The icon is colored green. RC (Release Candidate) This branch is for the next update, every update that will come to release will be at least 1-2 weeks before in this branch. It can be considered as mostly stable, here the last bugs will be fixed before they are merged to release. If you run a public server, you should use this branch before updates to update your server code to a new version of alt:V. The icon is colored orange. Dev (Development) This branch contains the newest features, not all features will be moved to RC. This branch can contain bugs and unfinished features, the features also can change. If you want the newest features you can test them on this branch and help us finding bugs. The icon is colored blue. Internal This branch isn't public and can only be used by developers of alt:V. This icon is colored violet. How to change the Branch? Changing the branch is easy, for the client you need to open the altv.toml and change the branch to the value you want to use (release, rc, dev). For the server you need to download the new files for the branch you want again from the alt:V Website or using altv-pkg .","lang":""},"articles/bytecode_module.html":{"type":"article","href":"articles/bytecode_module.html","title":"Bytecode module","keyword":"Bytecode module The bytecode module transforms your clientside code to V8 bytecode on the serverside before the files are sent to the client. Thus, it makes stealing the original source files by dumping them clientside completely impossible . But it is still possible to dump the generated bytecode and reverse the logic, so the module does not 100% protect your code from being stolen. But again, that is a very time intensive and exhausting process, so it would be very hard to reverse actually accurate working code from the bytecode. Also, the structure of the V8 bytecode keeps changing over time and is barely documented at all , and there is currently no known public \"tool\" to reverse V8 bytecode into valid JavaScript code. It is recommended to only use the bytecode module in production . This is because the source files are missing for the client, so it is not possible to generate a stack trace or any other additional debug information, making debugging errors and other issues a lot harder. Setting up the bytecode module Setting up the bytecode module is a relatively easy process, just follow the steps below: Download the bytecode module , and place the downloaded .dll or .so in your modules directory Add js-bytecode-module to the modules array in the server.toml For every resource you want to use the bytecode module for set the client-type in the resource.toml to jsb Start the server Now every time you start the server you should get logs similiar to this one: Converted file to bytecode: path/file.js There is still an optional step left, but this step is only needed when the code is using dynamic import to import any files, that are not otherwise imported. As the module compiles all imported files recursively, by starting from the main file and compiling all its dependencies (modules imported with the import statement), it is not possible for the module to know the files that are dynamically imported. So these have to be manually specified, so they are also compiled. To do this just: Add all files that should additionally be compiled to the extra-compile-files array in the resource.toml That array accepts the same paths as the client-files option does, so it is possible to include a whole folder for example. Download The module can be downloaded from the following sources: The official alt:V downloads page The CDN directly - Windows / Linux The bytecode module releases page Troubleshooting Help! I have an error saying... First of all, make sure your code runs without any errors . If the code has any errors in the top level code (like syntax errors), the module will fail to compile. If the code runs fine without the bytecode module but the module still reports an error, contact us on Discord .","lang":""},"articles/cdn.html":{"type":"article","href":"articles/cdn.html","title":"Setup CDN","keyword":"Setup CDN CDN (Content delivery Network) is a function to speedup the download of the resources for connecting users and to relive the server. The CDN can be provided with any filehosting server that supports HTTP/HTTPS. It's working as followed: The client connects to the CDN Server, which provides the resource files for the client. After the download is complete, the client connects to the alt:V Server. Step-by-Step Tutorial Example values In this tutorial following example values are used: Key Value Description cdnUrl http://connect.example.com/ The url to the cdn server. Server IP 127.0.0.1 The IP address of the alt:V server. Server Port 7788 The Port of the alt:V server. Step-by-Step Example Add useCdn = true to server.toml . Add cdnUrl = \"http://connect.example.com\" to server.toml . Start you server with params --host 127.0.0.1 --port 7788 --justpack Add all generated files from the folder cdn_upload to your CDN server, the files should be placed in the root of the domain. (You should be abble to access connect.json under http://connect.example.com/connect.json ). For direct connect use your cdnUrl connect.example.com CDN meta file Caution With alt:V 16.0 a new file called cdn-meta.bin got added to the process. Make sure to keep this file in your server's bin directory. The cdn-meta.bin file is an important file in your server's bin folder, containing information about custom vehicles, peds and weapons. This file has 2 primary purposes: it stops the server from parsing this data on every start you don't need to have these resources directly on your server, only on CDN","lang":""},"articles/cdn_links.html":{"type":"article","href":"articles/cdn_links.html","title":"CDN Links","keyword":"CDN Links Here you can find the CDN-Links(=Content Delivery Network) for the alt:V files. It's recommended to use the Downloads-Page where the files get automatically bundled for you. Valid values for ${BRANCH} are: release , rc and dev . update.json file contains build number, file locations and sha1 hashes. Link Generator You can also use this Generate to create the needed links, just select the components you need and if you need the links for the update.json. label { display: block; } const branchArray = [\"release\", \"rc\", \"dev\"]; const osArray = [\"x64_win32\", \"x64_linux\"]; document.getElementById(\"CDN_Link_Generator-interface\").innerHTML = generateInterface(); /** * @returns {string} */ function generateInterface() { let interfaceStr = \"\"; interfaceStr += \"
\"; interfaceStr += \"
\"; interfaceStr += \"
\"; interfaceStr += \"
\"; interfaceStr += \"
\"; interfaceStr += \"
\"; interfaceStr += \"
\"; interfaceStr += \"
\"; interfaceStr += \"
\"; interfaceStr += \"
\"; interfaceStr += \"
\"; return interfaceStr; } /** * @returns {void} */ function generate() { let branch = Number.parseInt(document.getElementById(\"branch\").value, 10); let os = Number.parseInt(document.getElementById(\"os\").value, 10); let update = document.getElementById(\"update\").checked; let server = document.getElementById(\"server\").checked; let voice = document.getElementById(\"voice\").checked; let csharp = document.getElementById(\"csharp\").checked; let javascript = document.getElementById(\"javascript\").checked; let javascriptv2 = document.getElementById(\"javascriptv2\").checked; let bytecodeModule = document.getElementById(\"js-bytecode\").checked; document.getElementById(\"CDN_Link_Generator-links\").innerHTML = generateLinks([server, voice, csharp, javascript, javascriptv2, bytecodeModule],branch,os,update); } /** * @param {boolean[]} selection * @param {number} branchIndex * @param {number} osIndex * @param {boolean} listUpdate * @returns {string} */ function generateLinks(selection, branchIndex, osIndex, listUpdate) { let returnStr = \"\"; returnStr += \"
\"; if(selection[0]) returnStr += generateServerLinks(branchIndex, osIndex, listUpdate); if(selection[1]) returnStr += generateVoiceServerLinks(branchIndex, osIndex, listUpdate); if(selection[2]) returnStr += generateCSLinks(branchIndex, osIndex, listUpdate); if(selection[3]) returnStr += generateJSLinks(branchIndex, osIndex, listUpdate); if(selection[4]) returnStr += generateJSV2Links(branchIndex, osIndex, listUpdate); if (selection[5]) { returnStr += generateJSBytecodeLinks(branchIndex, osIndex, listUpdate); } if(!selection[0] && !selection[1] && !selection[2] && !selection[3] && !selection[4] && !selection[5]) returnStr += \"You didn't select any components :(\"; else if(selection[4] && (branchArray[branchIndex] === \"release\" || branchArray[branchIndex] === \"rc\")) returnStr += \"js-module-v2 is not ready for production. It is only available on dev branch. See https://github.com/altmp/altv-js-module-v2/tree/v1-compatibility for more information.\"; returnStr += \"<\\/pre>\"; return returnStr; } /** * @param {number} branchIndex * @param {number} osIndex * @param {boolean} listUpdate * @returns {string} */ function generateServerLinks(branchIndex, osIndex, listUpdate) { let returnStr = \"\"; if(listUpdate) returnStr += \"https://cdn.alt-mp.com/server/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/update.json
\" returnStr += \"https://cdn.alt-mp.com/data/\" + branchArray[branchIndex] + \"/update.json
\" if(osIndex === 0) { returnStr += \"https://cdn.alt-mp.com/server/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/altv-crash-handler.exe
\" returnStr += \"https://cdn.alt-mp.com/server/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/altv-server.exe
\"; } else { returnStr += \"https://cdn.alt-mp.com/server/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/altv-crash-handler
\" returnStr += \"https://cdn.alt-mp.com/server/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/altv-server
\"; } returnStr += \"https://cdn.alt-mp.com/data/\" + branchArray[branchIndex] + \"/data/vehmodels.bin
\"; returnStr += \"https://cdn.alt-mp.com/data/\" + branchArray[branchIndex] + \"/data/vehmods.bin
\" returnStr += \"https://cdn.alt-mp.com/data/\" + branchArray[branchIndex] + \"/data/clothes.bin
\" returnStr += \"https://cdn.alt-mp.com/data/\" + branchArray[branchIndex] + \"/data/pedmodels.bin
\" returnStr += \"https://cdn.alt-mp.com/data/\" + branchArray[branchIndex] + \"/data/rpfdata.bin
\" returnStr += \"https://cdn.alt-mp.com/data/\" + branchArray[branchIndex] + \"/data/weaponmodels.bin
\" return returnStr; } /** * @param {number} branchIndex * @param {number} osIndex * @param {boolean} listUpdate * @returns {string} */ function generateVoiceServerLinks(branchIndex, osIndex, listUpdate) { let returnStr = \"\"; if(listUpdate) returnStr += \"https://cdn.alt-mp.com/voice-server/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/update.json
\"; if(osIndex === 0) returnStr += \"https://cdn.alt-mp.com/voice-server/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/altv-voice-server.exe
\"; else returnStr += \"https://cdn.alt-mp.com/voice-server/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/altv-voice-server
\"; return returnStr; } /** * @param {number} branchIndex * @param {number} osIndex * @param {boolean} listUpdate * @returns {string} */ function generateCSLinks(branchIndex, osIndex, listUpdate) { let returnStr = \"\"; if(listUpdate) returnStr += \"https://cdn.alt-mp.com/coreclr-module/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/update.json
\"; returnStr += \"https://cdn.alt-mp.com/coreclr-module/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/AltV.Net.Host.dll
\"; returnStr += \"https://cdn.alt-mp.com/coreclr-module/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/AltV.Net.Host.runtimeconfig.json
\"; if(osIndex === 0) returnStr += \"https://cdn.alt-mp.com/coreclr-module/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/modules/csharp-module.dll
\"; else returnStr += \"https://cdn.alt-mp.com/coreclr-module/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/modules/libcsharp-module.so
\"; return returnStr; } /** * @param {number} branchIndex * @param {number} osIndex * @param {boolean} listUpdate * @returns {string} */ function generateJSLinks(branchIndex, osIndex, listUpdate) { let returnStr = \"\"; if(listUpdate) returnStr += \"https://cdn.alt-mp.com/js-module/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/update.json
\"; if(osIndex === 0) returnStr += \"https://cdn.alt-mp.com/js-module/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/modules/js-module/libnode.dll
\"; else returnStr += \"https://cdn.alt-mp.com/js-module/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/modules/js-module/libnode.so.108
\"; if(osIndex === 0) returnStr += \"https://cdn.alt-mp.com/js-module/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/modules/js-module/js-module.dll
\"; else returnStr += \"https://cdn.alt-mp.com/js-module/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/modules/js-module/libjs-module.so
\"; return returnStr; } /** * @param {number} branchIndex * @param {number} osIndex * @param {boolean} listUpdate * @returns {string} */ function generateJSV2Links(branchIndex, osIndex, listUpdate) { let returnStr = \"\"; if(listUpdate) { if(branchArray[branchIndex] == \"dev\") returnStr += \"https://cdn.alt-mp.com/js-module-v2/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/update.json
\"; } if(osIndex === 0) { if(branchArray[branchIndex] == \"dev\") returnStr += \"https://cdn.alt-mp.com/js-module-v2/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/libnodev2.dll
\"; } else { if(branchArray[branchIndex] == \"dev\") returnStr += \"https://cdn.alt-mp.com/js-module-v2/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/libnodev2.so
\"; } if(osIndex === 0) { if(branchArray[branchIndex] == \"dev\") { returnStr += \"https://cdn.alt-mp.com/js-module-v2/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/modules/js-module-v2.dll
\"; returnStr += \"https://cdn.alt-mp.com/js-module-v2/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/modules/js-module-v2.pdb
\"; } } else { if(branchArray[branchIndex] == \"dev\") returnStr += \"https://cdn.alt-mp.com/js-module-v2/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/libjs-module-v2.so
\"; } return returnStr; } /** * @param {number} branchIndex * @param {number} osIndex * @param {boolean} listUpdate * @returns {string} */ function generateJSBytecodeLinks(branchIndex, osIndex, listUpdate) { let returnStr = \"\"; if(listUpdate) returnStr += \"https://cdn.alt-mp.com/js-bytecode-module/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/update.json
\"; if(osIndex === 0) returnStr += \"https://cdn.alt-mp.com/js-bytecode-module/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/modules/js-bytecode-module.dll
\"; else returnStr += \"https://cdn.alt-mp.com/js-bytecode-module/\" + branchArray[branchIndex] + \"/\" + osArray[osIndex] + \"/modules/libjs-bytecode-module.so
\"; return returnStr; } Linux Server CoreClr/C# Module https://cdn.alt-mp.com/coreclr-module/${BRANCH}/x64_linux/update.json https://cdn.alt-mp.com/coreclr-module/${BRANCH}/x64_linux/AltV.Net.Host.dll https://cdn.alt-mp.com/coreclr-module/${BRANCH}/x64_linux/AltV.Net.Host.runtimeconfig.json https://cdn.alt-mp.com/coreclr-module/${BRANCH}/x64_linux/modules/libcsharp-module.so JS Module https://cdn.alt-mp.com/js-module/${BRANCH}/x64_linux/update.json https://cdn.alt-mp.com/js-module/${BRANCH}/x64_linux/modules/js-module/libjs-module.so https://cdn.alt-mp.com/js-module/${BRANCH}/x64_linux/modules/js-module/libnode.so.108 JS Module V2 https://cdn.alt-mp.com/js-module-v2/${BRANCH}/x64_linux/update.json https://cdn.alt-mp.com/js-module-v2/${BRANCH}/x64_linux/libjs-module-v2.so https://cdn.alt-mp.com/js-module-v2/${BRANCH}/x64_linux/libnodev2.so JS Bytecode Module https://cdn.alt-mp.com/js-bytecode-module/${BRANCH}/x64_linux/update.json https://cdn.alt-mp.com/js-bytecode-module/${BRANCH}/x64_linux/modules/libjs-bytecode-module.so Voice Server https://cdn.alt-mp.com/voice-server/${BRANCH}/x64_linux/update.json https://cdn.alt-mp.com/voice-server/${BRANCH}/x64_linux/altv-voice-server Server https://cdn.alt-mp.com/server/${BRANCH}/x64_linux/update.json https://cdn.alt-mp.com/server/${BRANCH}/x64_linux/altv-server https://cdn.alt-mp.com/server/${BRANCH}/x64_linux/altv-crash-handler https://cdn.alt-mp.com/data/${BRANCH}/update.json https://cdn.alt-mp.com/data/${BRANCH}/data/vehmodels.bin https://cdn.alt-mp.com/data/${BRANCH}/data/vehmods.bin https://cdn.alt-mp.com/data/${BRANCH}/data/clothes.bin https://cdn.alt-mp.com/data/${BRANCH}/data/pedmodels.bin https://cdn.alt-mp.com/data/${BRANCH}/data/rpfdata.bin https://cdn.alt-mp.com/data/${BRANCH}/data/weaponmodels.bin Other Stuff https://cdn.alt-mp.com/others/start.sh https://cdn.alt-mp.com/samples/resources.zip Windows Server CoreClr/C# Module https://cdn.alt-mp.com/coreclr-module/${BRANCH}/x64_win32/update.json https://cdn.alt-mp.com/coreclr-module/${BRANCH}/x64_win32/AltV.Net.Host.dll https://cdn.alt-mp.com/coreclr-module/${BRANCH}/x64_win32/AltV.Net.Host.runtimeconfig.json https://cdn.alt-mp.com/coreclr-module/${BRANCH}/x64_win32/modules/csharp-module.dll JS Module https://cdn.alt-mp.com/js-module/${BRANCH}/x64_win32/update.json https://cdn.alt-mp.com/js-module/${BRANCH}/x64_win32/modules/js-module/js-module.dll https://cdn.alt-mp.com/js-module/${BRANCH}/x64_win32/modules/js-module/libnode.dll JS Module V2 https://cdn.alt-mp.com/js-module-v2/${BRANCH}/x64_win32/update.json https://cdn.alt-mp.com/js-module-v2/${BRANCH}/x64_win32/modules/js-module-v2.dll https://cdn.alt-mp.com/js-module-v2/${BRANCH}/x64_win32/modules/js-module-v2.pdb https://cdn.alt-mp.com/js-module-v2/${BRANCH}/x64_win32/libnodev2.dll JS Bytecode Module https://cdn.alt-mp.com/js-bytecode-module/${BRANCH}/x64_win32/update.json https://cdn.alt-mp.com/js-bytecode-module/${BRANCH}/x64_win32/modules/js-bytecode-module.dll Voice Server https://cdn.alt-mp.com/voice-server/${BRANCH}/x64_win32/update.json https://cdn.alt-mp.com/voice-server/${BRANCH}/x64_win32/altv-voice-server.exe Server https://cdn.alt-mp.com/server/${BRANCH}/x64_win32/update.json https://cdn.alt-mp.com/server/${BRANCH}/x64_win32/altv-server.exe https://cdn.alt-mp.com/server/${BRANCH}/x64_win32/altv-crash-handler.exe https://cdn.alt-mp.com/data/${BRANCH}/update.json https://cdn.alt-mp.com/data/${BRANCH}/data/vehmodels.bin https://cdn.alt-mp.com/data/${BRANCH}/data/vehmods.bin https://cdn.alt-mp.com/data/${BRANCH}/data/clothes.bin https://cdn.alt-mp.com/data/${BRANCH}/data/pedmodels.bin https://cdn.alt-mp.com/data/${BRANCH}/data/rpfdata.bin https://cdn.alt-mp.com/data/${BRANCH}/data/weaponmodels.bin Other Stuff https://cdn.alt-mp.com/others/start.sh https://cdn.alt-mp.com/samples/resources.zip Client https://cdn.alt-mp.com/client/${BRANCH}/x64_win32/update.json https://cdn.alt-mp.com/client/${BRANCH}/x64_win32/altv.exe Launcher https://cdn.alt-mp.com/launcher/${BRANCH}/x64_win32/update.json https://cdn.alt-mp.com/launcher/${BRANCH}/x64_win32/altv.exe https://cdn.alt-mp.com/launcher/${BRANCH}/x64_win32/altv.zip","lang":""},"articles/cef.html":{"type":"article","href":"articles/cef.html","title":"CEF - Chromium Embedded Framework","keyword":"CEF - Chromium Embedded Framework The Chromium Embedded Framework (also known as CEF) is a web browser engine used in alt:V to render clientside webpages and assets - like in your everyday web browser. CEF will use your system locale. Debug Mode To enable the debug mode/server on clientside for CEF, you have to enable the debug = true setting in your clientside configuration. Then, the debug server is available under localhost:9222 (in Chromium or older Chrome) or chrome://inspect (in newer Chrome). Tip CEF not working? Click here to see troubleshooting steps.","lang":""},"articles/changelogs/10_0.html":{"type":"article","href":"articles/changelogs/10_0.html","title":"10.0-Release","keyword":"10.0-Release Tip This update was released on 20.05.2022 Caution This update contains breaking changes , which can potentially break the functionality of your gamemode, please verify and change accordingly. - 10.1: - Fixed problems with syncedMetaData - 10.2: - Fixed a crash on connect if ressource is missing - Fixed a crash related to cef - Fixed a crash related to vehicles - CEF cache didnt get cleared - 10.3: - Fixed a crash related to disconnects - Fixed a crash related to early auth - Fixed a crash related to webviews - Disabled default ipl loading - 10.4: - Fixed discord oAuth api - Prevent alt:V from starting, if it's installed in GTA:V folder - Add ascii check for paths - 10.5: - Removed ascii check for paths - 10.6: - Fixed a common crash regarding to mlo's and vehicles - 10.7: - Show broken asset warnings only in debug mode - 10.8: - Add handling for invalid archetypes to avoid crashes - Add 2 more fixes to avoid crashes - 10.9: - Fixed a crash related to weapons - Fixed 2 crashes related to clothes - 10.10: - Fix a hook which was broken after 10.9 Client Added - windowFocusChange Event - netOwnerChange event for local player ownership changes - loading rml document from string - alt.setMinimapComponentPosition - alt.setMinimapIsRectangle - branch validation to launcher config - alt.getScreenResolution - windowResolutionChange event - webview size setter & getter - webview pos getter - isRemote getter for blips - increased 2d volume of sound api - discord oAuth api - alt.isCursorVisible() - c# client module - console connect command - important missing ipls will be loaded by default now - disable idle cam flag also disables vehicle idle cam now Fixed - clientside created blips didn't delete on reconnect - Rockstar launcher detected unexpected Files because of cef cache - serverside blip attached to entity is not deleted with entity - serverside created blip API category setter doesent update - resolution change did not apply for rmlui - webview visible setter before view is initialized didn't worked - webview size and pos parameter in constructor - pixelation in rmlui when resolution changes - resource import/export - missing collision for helicopters, what caused explosions Breaking changes - disabled document.execCommand in webviews Server Added - getServerConfig method - optimized synced meta data - support for resources in subfolders - error message when binding to invalid host address - serverStarted event - node inspector, source-maps, heap-profiler, profiler server.cfg entry for js module, global-fetch, global-webcrypto, network-imports (see https://docs.altv.mp/articles/configs/server.html for references) - props & clothes setters returns a bool now - collision & frozen setter, getter - don't disable props when inside a bike, helicopter, submarine - cancelable requestControl event - hasAutoAttachTrailer to vehicleModelInfo - isAccepted getter to ConnectionInfo - arm64 build support Fixed - blip rotation setter - vehicles created on resource start will be missing in resource start - empty resources got sended to client - last command being executed when pressed enter - checkpoint destroy - utf-8 with BOM destroyed server.cfg - GetResourceExports crashed the server - calling OnCreateBaseObject for objects that got created before other resource existed - netowner reset on migration in few cases Server & Client Added - resource class - resourceStop and resourceStart events now support async functions, and will wait until the async function is resolved - stringToSHA256 method - alt.Utils class JS Module - Updated nodeJS to v17.7.0 - Fixed emitClient & emitClientRaw not sending events properly when passing an array of players - Fixed JS module reserved commands are sent to users C# Server Module - Now AltV.Net NuGet depends on AltV.Net.Shared and AltV.Net.CApi. Consider that, if you specify dlls manually to move/deploy - Floating point values now can be received as int in the events and meta - Alt.Server was deprecated, use Alt.Core instead - Function.Create was deprecated, use Alt.CreateFunction instead - MValueBuffer2 constructor was deprecated, use Alt.CreateMValueBuffer instead - MValueWriter2 constructor was deprecated, use Alt.CreateMValueWriter instead - MValueObject old constructor was deprecated, use one with ICore as first argument - MValueArray old constructor was deprecated, use one with ICore as first argument - MValueAdapters API was deprecated, use corrseponding method from Alt instead - VehicleBuilder was deprecated, use Vehicle constructor instead - IColShape.IsPlayerIn was deprecated, use IColShape.IsEntityIn instead - IColShape.IsVehicleIn was deprecated, use IColShape.IsEntityIn instead - ICheckpoint.IsPlayerIn was deprecated, use ICheckpoint.IsEntityIn instead - ICheckpoint.IsVehicleIn was deprecated, use ICheckpoint.IsEntityIn instead - All entity async methods, and AltAsync async methods except for entity creation ones were deprecated. Use async entities instead. For more info see Async article in C# docs - AltInteractions Trigger method did trigger all types at once. Now, there's a TriggerAll method for that. Breaking changes - IServer was renamed to ICore - IEntityPool, IBaseObjectPool and IBaseBaseObjectPool method signatures were changed. (now they return a nullable entity, instead of returning boolean and entity via out variable) - Alt.GetAll* methods now return IReadOnlyCollection instead of ICollection","lang":""},"articles/changelogs/11_0.html":{"type":"article","href":"articles/changelogs/11_0.html","title":"11.0-Release","keyword":"11.0-Release Tip This update was released on 15.07.2022 Caution This update contains breaking changes , which can potentially break the functionality of your gamemode, please verify and change accordingly. - 11.1: - Fixed problems with streamSyncedMeta - 11.2: - Fixed currentammo getter - 11.3: - Crashes related to vehicle windows - 11.4: - Clothgetter fixes - 11.5: - Fixed problems with attach/detach event - 11.6: - Fixed attachedTo for empty vehicles Launcher - Fixed \"This PC\" crashes the game directory selection dialog - Fixed Startmenu shortcut - allow installation in appdata folder (default installation) - redesigned installation menu - improved high resolution support - added uninstaller - improved download progessbar on installation Client Added - weapondata api (https://docs.altv.mp/js/api/alt-client.WeaponData.html) - vehicle lockState, petrolTankHealth getter - focusdata api (overrideFocus, clearFocus, focusOverrideEntity, etc) - WheelCamber, WheelTrackWidth, WheelHeight, WheelTyreRadius, WheelRimRadius, WheelTyreWidth, fuelLevel, engineTemperature, oilLevel getter & setter - persistent localstorage for early auth - loadDefaultIpls method - voiceControlsEnabled, rmlControlsEnabled getter - sender element to rmlui events Fixed - weapon auto swap flag disabled vehicle weapons - playPedAmbientSpeechWithVoiceNative native - RMLUI style property - vehicle gear setter - permission dialog for optional permissions - cinematic camera key in vehicles while idlecam flag used Server Added - isSpawned, discordID getter - player currentAnimationDict, currentAnimationName, currentInterior getter - improved client-files wildcard support in ressource.cfg - autoenable headlightcolor mod if headlightColor setter is used - autoenable tireSmokeColor mod if tireSmokeColor setter is used - isEntityIn colshape method with entityID - duplicatePlayers config entry (see [server config article](~/articles/configs/server.md)) - vehicle lightState setter & getter - vehicle setTimedExplosion method - vehicle timedExplosionTime, timedExplosionCulprit, hasTimedExplosion getter - playerInteriorChange event - optimized stream synced meta data Fixed - Fix frozen and collision setter - Bicycles don't work sometimes - Size property doesn't work for areablip - playAmbientSpeech method - removed clothing & appearance missmatch message Server & Client Added - animationChange event - player forwardSpeed & strafeSpeed getter JS Module - Updated nodeJS launch options to support native ECMAScript module loader by default (removed experimental loader warning) → The js-module automatically detects esm files if one of the described cases are fullfilled, see: https://nodejs.org/docs/latest-v17.x/api/esm.html#enabling - Added extra-cli-args to server.cfg C# Module Contains Breaking changes - Breaking Change: Async baseobject classes now don't have generic arguments (`AsyncPlayer` -> `AsyncPlayer`) - Added new optional API that makes any API call on any thread fully safe, more info in csharp Discord channel pinned messages - Fixed OnPlayerDamage async attribute event handler - Added Alt.GetEntityById - Added Alt.Core.IsMainThread","lang":""},"articles/changelogs/12_0.html":{"type":"article","href":"articles/changelogs/12_0.html","title":"12.0-Release","keyword":"12.0-Release Tip This update was released on 26.07.2022 - 12.1: - Increased txd pool - Fixed modded minimap - 12.2: - attachentitytoentity native - 12.3: - Fixed dead desync - Dont load gta update dummy files - 12.4: - Fixed gta pool crashes - 12.5: - Fixed Crashes related to gadgets - 12.6: - Added spawned event on modelchange - Fixed licensehash - Fixed blips - 12.7: - More blip fixes - 12.8: - Fixed Blip route - 12.9: - Fixed Resolving of dependencies inside sub directories failed clientside - 12.10: - Fixed one more crash related to dependencies reload - 12.11: - Helicopter's explosion bug - 12.12: - Add support for GTA version 2699.16 - 12.13: - Fixed armor setter - Fixed towtruck sync - 12.14: - Fixed vehicle extras - 12.15: - Fix struct natives - 12.16: - Add logs for current crashes - 12.17: - Apply some more crash fixes - 12.18: - Fix player position setter - Fix crashes - 12.19: - Fix crashes - 12.20: - Fix crashdump generation - 12.21: - Fix player position setter - 12.22: - Fix explosion, projectile, fire events Client Added - Add support for GTA version 2699","lang":""},"articles/changelogs/13_0.html":{"type":"article","href":"articles/changelogs/13_0.html","title":"13.0-Release","keyword":"13.0-Release Tip This update was released on 07.12.2022 - 13.2: - Fixed client & server crash - 13.3: - Fixed more client & server crash related to events - 13.4: - Improve event performance - 13.5: - Serverside improvements - 13.6: - Serverside improvements - 13.7: - Serverside improvements - 13.8: - Serverside improvements - 13.9: - Add more event validations - 13.10: - Serverside improvements & crash fix - 13.11: - Serverside improvements - 13.12: - Fixed death event - 13.13: - Serverside improvements - 13.14: - Serverside improvements & crash fixes - 13.15: - Serverside improvements, vehicle base64 setter & getter improvements, improve weapons & weapons component getter - 13.16: - Improve streaming & fix migrations checks - 13.17: - Improve vehicle base64 setter & getter - 13.18: - Improve blips performance, fix vehicle creation - 13.19: - Fix position setter - 13.20: - Fix position setter, fix neon getter (js module only) - 13.21: - Colshape improvement - Improve vehicle base64 setter - Add checks when serializing entities - 13.22: - Improve emits inside disconnect event (js module only) - Serverside crash fix - 13.23: - Serverside crash fix - 13.24: - Fixed hasExtra property in getVehicleModelInfoByHash for modded vehicles - Fix server crash - Improve server performance - 13.25: - Fixed vehicle extra reading crash for modded vehicles - 13.26: - Improve dlc parser crashes - 13.27: - Add Support GTA 2802 - 13.28: - 3d webview crashes - fix ressource loading - 13.29: - attachto api - 13.30: - fix ressource loading - 13.31: - fix ressource loading - 13.32: - Revert 13.31 - 13.33: - fix 3d webviews - 13.34: - Fix crashes in scriptById getter - Fix crash in istalking getter - 13.35: - Improve networking - Fix addExplosion native - Small fix for setExtra - 13.36: - improve asset loading - Multiple cleanups and improvements - 13.37: - Improve caching - 13.38: - Disabled mod folder - Fix clear blood damage sync - 13.39: - Fix multiple server crash cases - Only one logfile got created clientside - Invalid polys fix was broken after gta update - 13.40: - Fixed Servercrash on disconnect - 13.41: - improved health setter/getter - 13.42: - Added clientside stamina getter & setter - Added clientside maxStamina getter & setter - Added more informations to pedmodelinfos (type, dlcName, defaultUnarmedWeapon, movementClipSet) - Changed name of roofstate getter & setter - (JS) Fixed resource valid getter - 13.43: - Reverted client js changes - 13.44: - (JS) extendet client utils timeouts - 13.45: - Add Support GTA 2824 - 13.46: - More fixes for GTA 2824 - 13.47: - Just some internal serverside changes - 13.48: - Add Support GTA 2845 - Updated NodeJS Module to v18 - 13.49: - Fix testProbeAgainstWater native Client Breaking changes - some natives got renamed Added - weapondata playerDamageModifier getter & setter - isPointOnScreen method - vehicle engineOn, getWheelSurfaceMaterial getter - localplayer getWeaponAmmo, weapons, getWeaponComponents getter - localplayer hasWeapon method - cef getEventListeners method - few new natives - logDebug to prints custom log if client is in debugmode - Object api - increased weapon component pool - increased decal defs pool (20000-20249 decal ids which copy settings from id 10000) - weapon shoot, weapon change, weapondamage event - once method to webview - dashboard light getters and setters Fixed - resource deps with subfolder clientside - memorybuffer method - playermodel getter returned new value with a delay - clear focus data didn't reset on disconnect - some natives didn't return boolean correctly (js clientside) - rmlui cursor setting Server Added - getPedModelInfoByHash method - bones info to getVehicleModelInfoByHash method - toggleWorldProfiler - worldProfiler server config entry - playerConnectDenied event - sendPlayerNames server config entry to disable sending player name to all clients on connect - player sendNames property - sendNames parameter to accept method in connection queue (default is true) - player dimension change event - Warning when DLC resource name not only contain lowercase letters, numbers or \"-\"/\"_\" as special character or its not starting with a letter - Add pedmodels.bin file to server data - scriptMaxSpeed, hybridExtraActive, hybridExtraState, counterMeasureCount, rocketRefuelSpeed properties to vehicle - getWeaponCapacity & setWeaponCapacity methods - getLocalMetaKeys method Fixed - Master server used default interface even if bound to different ip - getServerConfig() does not return variable values properly that start with numeric characters - server connected to external voice server with --justpack argument - setting password during runtime didn't work - server crash with invalid carcols.meta - server crash when enabling stdconsole without console enabled Breaking changes - attachTo now takes boneid instead of boneindex - Connection info authToken has a limit of 255 characters - config cli argument only works with toml configs now Server & Client Breaking changes - Automatically change all configurations for Client (alt.cfg/history.servers) to [toml](https://toml.io/en/) format - Change all configurations for Server (server.cfg/resource.cfg/stream.cfg) to [toml](https://toml.io/en/) format by using the command line argument \"--convert-config-format\" on server start Added - getSyncedMetaKeys, getStreamSyncedMetaKeys, getMetaKeys methods Fixed - blip route didn't update when setting pos - Blips' heading indicator showed as a dollar sign JS Module Added - Utils.inspect (ported util.inspect from NodeJS with small differences) - functions & classes in Utils (e.g. drawText3d, loadMapArea, Timeout class, etc.) - log, logDebug, logError, logWarning now use alt.Utils.inspect - player.spawn(model, pos) overload Fixed - HandlingData.handlingNameHash returned wrong hash Breaking changes - player, blips, vehicles all getter are readonly now (server & client) - emitClient & emitClientRaw with null, use emitAllClients & emitAllClientsRaw instead - Worker is deprecated C# Server Module Breaking changes - IPlayer DiscordId changed type from string to long - IConnectionInfo DiscordUserId changed type from string to long - By AsyncResource constructor the default of \"forceAsyncBaseObjects\" is set to \"true\". To go back to old behavior you need to set \"false\" - Refs were removed (Ref classes, .TryCreateRef etc) - ToAsync now returns null when providing async context Changed - Async events do not force entities to exist anymore (previously it was guaranteed that if entity exists at async event start, it will exist until async event finishes) - ToAsync does not force entity to exist anymore. If base entity will be destroyed, async entity will fallback to cached value (or default for specific type, if caching is disabled) Added - After entity is destroyed getters return last available information instead of throwing exception or returning default. This behavior can be reverted by setting \"Alt.CacheEntities\" to \"false\" - Added ability to configure behavior of handling setter/getter call on non existent entity via \"Alt.ThrowIfEntityDoesNotExist\". Default value is \"false\" C# Client Module Fixed - Func returned invalid result when invoked if sandboxing is enabled - (server) Alt.GetPedModelInfo() Added - AltAsync.WaitFor allows to wait asynchronously for some result. After awaiting the function automatically returns you to main thread","lang":""},"articles/changelogs/14_0.html":{"type":"article","href":"articles/changelogs/14_0.html","title":"14.0-Release","keyword":"14.0-Release Tip This update was released on 31.03.2023 - 14.1: - Fixed Wrong playercount - 14.2: - Fixed Some cef core fixes - 14.3: - Fixed cef performance issues - 14.4: - Fixed some master server problems - 14.5: - Masterserver fixes - 14.6: - Masterserver fixes - 14.7: - Masterserver fixes - 14.8: - Masterserver fixes - 14.9: - Masterserver fixes - 14.10: - Masterserver fixes - 14.11: - CI Changes - 14.13: - Streamermode fixes - 14.14: - Freeze on huge amount of entities fix - Vehicle teleport on owner change fix - Vehicle angular velocity shuttering fix - Dead body sync fix - 14.15: - Revert Vehicle angular velocity shuttering fix - 14.16: - Vehicle angular velocity shuttering fix - 14.17: - Revert network optimizations - 14.18: - weapon meta crashes - 14.19: - Fix linux client - 14.20: - Another fix for linux client - 14.21: - GTA 2944 compatibility Client Breaking changes - disabled cloth sync if setted via native Added - Render RMLUI under CEF - Updated RMLUI to 5.0 - RMLUI antialiasing - RMLUI fallback font - getPedBonePos method - Side Mouse buttons for voice keybinding - Display downloadspeed while downloading ressources - Server Permission translations - submit nickname on first start by pressing enter - adaptivity for client console layout - cef support while pause menu ped is active - Updated cef to v103 - general new UI - clear console command - ime support for rmlui - error message in launcher, if gta:v start fails - language selection on installation - debug, branch & skipprocessconfirmation cli arg - installer & uninstaller rework - general launcher rework Fixed - Disconnection modal displayed twice after reconnect - wrong menu after connect rejection - webview freezed on FileDialog - cursor type didnt reset on webview destroy - crashdump location folder - cursor in iframe inputs wasnt visible - scrolling in iframes - rmlui clipboard - blips & object got not destroyed on resource stop - vehiclelayout meta - alt + f4 in vehicle stopped vehicle immediately - crash while pressing ESC after ressource restart - launcher shortcut was system wide - website url of a server was always lowercase - inputs in webviews didnt trigger focus & blur events - GTA Sound options didnt save - webview stayed unfocus if data url was used - cloning ped in pause menu disappeared all UI's - testProbeAgainstWater native Server Added - \"all\" as setting language JS Module Added - (server) Display source path on deprecated methods usage - (Server) Automatically fix paths with special characters - (Server) partial TextEncoder and TextDecoder - (Server) Updated nodeJS to 18.13.1 - (Server) Possible to modify damage value in weapondamage event - (Client) Updated v8 to 10.2 - Allow emitting typed arrays Fixed - (client) webview, audio, websocket & rml geteventhandler returned removed ones - (client) crash in vehicle handling if entity is invalid - (client) Internal error. Icu error when using for example toLocaleString C# Module Breaking changes - OnRemove() method replaced by OnDestroy() Added - alt:V custom .NET project template - (client) Add all missing vehicle properties Fixed - (client) weapondata using properties Rework - Mark Remove() method as deprecated and add Destroy() method for consistent alt:V api","lang":""},"articles/changelogs/15_0.html":{"type":"article","href":"articles/changelogs/15_0.html","title":"15.0-Release","keyword":"15.0-Release Tip This update was released on 20.10.2023 - 15.1: - Fixed serverlist player count sort - 15.2: - UI Fixes - 15.3: - Fixes if alt:V path included invalid characters - 15.4: - Fixed config parsing - 15.5: - Temporary disabled backup - 15.6: - print stacktrace on crash - 15.7: - Fixed disconnect messages - 15.19: - Improved startup - 15.20: - Improved cloudauth - 15.21: - added removeHeadBlendData method to player - Improved cloudauth - 15.22: - Improved model loading - 15.24: - Crashes on game starting - 15.28: - Localizitation for crash reporter - 15.31: - Print error on asset errror - 15.32: - Fix Voice chat dimensions - 15.33: - Fix distorsion with noise suppression enabled - 15.36: - Fix voicechat crackles with louad sounds and normalization enabled - 15.37: - Fix vehicle pools - 15.38: - Improve asia region support - 15.40: - Fix colshape delete & create in same tick - 15.41: - Fix infinite sprint - Improve modelloading - Fix total events received - 15.48: - Fix Stream synced meta script event delete new value - 15.49: - Increase weapon component info pool - 15.57: - Always reconnect to masterlist on failure Client Breaking changes - Renamed Object to LocalObject - .id represents local id now, if you need same id as on server use .remoteID - getPermissionState returns bool now - setArtificialLightsState has no effect anymore, use DisableEmissiveLightsRendering config flag instead - Weapons no more be synced clienside, use server side methods instead. Ammo set by the server will override ammo set by client. - client to server events can't be more then 8kb Added - mute loading music - DISABLE_VEHICLE_ENGINE_SHUTDOWN_ON_LEAVE configflag to keep engines on when leaving a vehicle - FORCE_RENDER_SNOW configflag to enable snow on any weather - FORCE_HIDE_NIGHT_PROPS & FORCE_SHOW_NIGHT_PROPS - DISABLE_EMISSIVE_LIGHTS_RENDERING configflag to enable / disable emissive lights - audio, checkpoint, webview all getter - audio, webview, httpclient, websocketclient id getter - audio, blip remoteid getter - worldObjectPositionChange, worldObjectStreamIn & worldObjectStreamOut event - entityHitEntity event - audio filter, colshape, textlabel, weaponObject api - dimension getter, position & rotation setter for localplayer - httpclient, rmldocument, websocketclient, webview, checkpoint getbyID method - blip getByScriptID method - multiple webviews can be focused - resource config getter - vehicle rpm setter - warning if gta systems have performance issues - overwrite all game meta & dat files - DISABLE_SP_ENTER_VEHICLE_CLIPSET flag (true by default) - extendet texture budget - new setter & getter for object, checkpoint - localPed & localVehicle api - activityInputEnabled, activationLevel, noiseSuppressionEnabled, toggleInput methods - Extended Voice API Permission - isFullScreen method - cef hardware acceleration - improve resource loading speed - downloadspeed settings - entity frozen setter/getter - startEnteringVehicle & startLeavingVehicle events - webview reload method - sourceentity parameter to weaponDamage event - gpuAccelerationActive webview getter - playerBulletHit event - checkpoint icon color getter/setter - extend audio api by output classes - audiocategory data api - all getter for weapondata api - gta v backup system - resetMinimapComponentPosition method - localstorage has method - suspensionHeight setter & getter - 3d audio output for webview - alt.getVersion, alt.getBranch, alt.getLocale in webviews - player IsStealthy & IsCrouching getter - weaponTintIndex & currentWeapontintindex getter - vehicle steeringAngle setter - Discord Rich Presence can be deactivated/activated - getNetTime method - markers api - player taskData getter - playerStartTalking & playerStopTalking event Fixed - minimap textures couldn't be replaced - ap1_* ytds, vehshare.ytd, hud.ytd, minimap.ytd couldn't be replaced - gfx couldn't be replaced - cef flickering while marker is visible (native.drawRect(0, 0, 0, 0, 0, 0, 0, 0) workaround is no longer needed) - weapon dlc addon crashed the game on connect to the server - cef locale detection - webview didnt get destroyed - wrong reported resource downloadspeed - optional permissions - cancel button crashed client - voiceInputVolume sets volume in reverse - ladder sync - localplayer micLevel & isTalking getter - mouse cursor stucked in the middle of the screen if input was not set to raw - crash on invalid rml document input - multiple fixes related to the audio api - carmodcols can be loaded to use gta v chameleon colors - possible crash in getWheelSurfaceMaterial - wrong vehicle position on streamin after few restreams - playing animation directly after another one wasnt synced - entity models are not freed from memory - taskSynchronizedScene wasnt synced - tattoos disappeared randomly - (max)health, (max)armor getter from remoteplayers wasn't always correct - parachute sync - connect to server via ipv6 adress - position of towtruck hook on streamin - loadCloudHat native - custom numberplate limit - vehicle dirt rendering Server Breaking changes - Removed PlayerBeforeConnect event - Removed id support for entityinstreamingrange method - Removed entityWorkerCount server option - playerWeaponChange is not cancable anymore Added - unreliable events - vehicleHorn event (cancable) - vehicleSiren, playerSpawn event - getEntitiesInDimension, getEntitiesInRange, getClosestEntities methods - support for singleplayer rpf files - extend limit to 65.000 entities (players, vehicles, etc.) - colshape & blip, voicechannel id getter - checkpoint all getter - extend resource limit to 4GB - added priority, filter getter & setter for voiceserver - player playAnimation, clearTasks, playScenario method - streamsyncedmeta for checkpoints - vehicle quaternion setter & getter - objects Api - player socialClubName getter - socialClubName info in connectioInfo - option (spawnAfterConnect = true) to spawn player automatically at position 0,0,71 - no-regenerate-rpf-cache cmd line arg - error message if justpack gets used without valid host config - possible to enable only specific gta dlcs with the dlcWhitelist config option - player streamedEntities getter - hashClientResourceName server option - Modify gamepool size via server config - prometheus support - Missing maxDistance & isSpatial voicechannel getter - streamer, migration, syncSend, syncReceive thread count can be configured in server.toml - resource wildcard support in server.toml - getWeaponModelInfoByHash method, getAmmoHashForWeaponHash method & weaponmodels.bin file - ammo getter & setter method - canAttachCars & handlingNameHash to vehicleModelInfo - timestamp for entitys - hasWeapon, AmmoSpecialType, ammoFlags, ammoMax method for player - removeAllAmmo parameter for removeAllWeapons - blip dimension setter, blips can be shown to specific players - addDecoration, removeDecoration, clearDecorations, getDecorations method for player - setVoiceExternalPublic & setVoiceExternal method - player netOwnershipDisabled property - vehicle brakeLevel, accelerationLevel getter - requestSyncedScene, startSyncedScene, stopSyncedScene, updateSyncedScene events - vehicle hornActive getter - clientDeleteObject & clientRequestObject event - connectioninfo text to display text while in queue - entities limit can be increased in server.toml - playerheal event - setter & getter to set streaminglimits & threadcounts - vehicle passenger getter - cloudauth api - givePedScriptedTask event - attach api for objects - pedDamage, pedDeath, pedHeal events - every entity can have its own streaming distance - maxClientScriptEventSize & maxServerScriptEventSize config option - getLoadedVehicleModels method - allowUnknownRPCEvents server config option - blooddamage getter & setter Fixed - Dead body position sync - vehicle angular interpolator - vehicle flickers when the netowner changes - player model setter removed all weapons - setting health directly after model change, left hp at 200 - maxArmour resetted when player died - entity attachto api didnt accept all bone ids - voiceserver port config did not apply - attachTo was desync on netowner change - projectile sync - netownerChange event wasnt called when netowner got null Server & Client Breaking changes - Removed alt.Entity.getByID method Added - getByID & getByRemoteID method for baseobjects - getMetaKeys & getSyncedMetaKeys methods - ped's Api - virtual entitys api - isEnteringVehicle, isLeavingVehicle, isOnLadder, isInCover, isInMelee, isParachuting player getter - metachange event - voiceConnection event - getVoiceConnectionState method - new blip api methods - vehicle steeringAngle getter - player hasWeaponComponent method - server <-> client rpc api Fixed - radius blip wasn't visible - radius blip size property JS Module Breaking changes - Removed deprecated null in emitClient & emitClientRaw as target parameter Added - (Client) toggleStrictChecks for natives - (Server|Client) baseObjectCreate & baseObjectRemove event C# Module Breaking changes - Removed deprecated Alt.Server property - All element constructors are deprecated. Please only use Alt.Create* or AltAsync.Create* instead. In one of the next updates the constructors will be removed. - (server) ScriptEvents must now set the required return type. Otherwise a log will be output to the console and the event will not be registered Fixed - Fix OnRmlEvent Event","lang":""},"articles/changelogs/2_2.html":{"type":"article","href":"articles/changelogs/2_2.html","title":"2.2-Release","keyword":"2.2-Release Tip This update was released on 24.12.2020 Client Added - setRotationVelocity - Handling per vehicle - alt.takeScreenshot - alt.takeScreenshotGameOnly - alt.isInStreamerMode - Permission Change warning on resource restart - Blip.display - Vector3 functions - Added new alt.Player getter → Added currentWeaponComponents → Added currentWeapon → Added isInRagdoll → Added isAiming → Added armour → Added maxArmour → Added health → Added maxHealth → Added moveSpeed → Added aimPos → Added headRot → Added seat → Added entityAimingAt → Added entityAimOffset → Added isDead → Added flashlightActive - alt.resourceName getter - dynamic import - alt.isGameFocused - playerEnteringVehicle event - console.log, console.warn and console.error - alt.isKeyToggled - alt.isKeyDown - New Events → enteredVehicle Event (client) → leftVehicle Event (client) → changedSeat Event (client) Fixed - random trailer detachments - 2D Voice outside streaming range - --connecturl - path picker while installing - privileges problems when installed in path, which needs higher privileges - vehicle getters (gear, rpm, speed, wheel) - wrong type of wheels count - host and port command line argument - Cover Sync Bug - Invisible Animation Bug - Invisible Tattoo Bug - Vehicle Rotation - Blip getters - main menu drawing order - background web views don’t react when menu or console is open - Checkpoints - tow truck crashes - model getter - dead body sync - alt.getGxtText - crash with RemoveAllWeapons on animal models - control bug on removing weapons from animals - model desync if the model was not set by the server - player.rot - vehicle.handling - natives returning object instead of Vector3 instance - clear streamSyncedMeta on stream out - doubled triggered syncedMetaChange when DeleteSyncedMetaData used - disallow Installation in GTA V folder Removed - Removed sync of setPlayerModel native - Removed sync of setVehicleDoorsLocked native - Removed sync of setEntityVisible native Changed - Reworked Mod loading - Changed Versioning - Reorder connection validation - Pool errors, print hash instead of address - LowPriorityProps always enabled (removed setter from altv.cfg) - Improved SDK Version mismatch messages - Clientside JS Module is now open source - Increased file size for streaming to 32MB - Increase CombatMeleeManager_Groups pool - breakForce to brakeForce - HandlingData.getForModel to HandlingData.getForHandlingName - only script resources are using GTA Script threads - Launcher Improvements Server Added - vehicle getAttached - vehicle getAttachedTo - client-type to resource.cfg - vehicle.repair() - Player.clearBloodDamage - New events → vehicleAttach → vehicleDetach → netOwnerChange Fixed - bug with node_modules caching - weaponDamage Event - health & maxHealth - armour and MaxArmour - player heading setter - teleporting into colshape issue - slow alt.Player.all and alt.Vehicle.all getter Changed - Improved Long String Emits - IsRoofOpened to GetRoofState - SetRoofOpened to SetRoofState - Removed alt.DefaultDimension and alt.GlobalDimension (client) Server & Client Added - alt.version - alt.branch - Permission System - alt.Entity.all getter - alt.once, alt.onceClient and alt.onceServer - entity.visible","lang":""},"articles/changelogs/4_0.html":{"type":"article","href":"articles/changelogs/4_0.html","title":"4.0-Release","keyword":"4.0-Release Tip This update was released on 16.07.2021 Client Added - alt.setPedDlcProp, player.clearPedProp - alt.setPedDlcClothes - alt.loadYtyp - alt.unloadYtyp - alt.getVoiceActivationKey - Vector2 Class - pos and size parameter to WebView - auto-reconnect to voice - player voice volume - voiceInputVolume and voiceVolume console command - BigInt support for natives - event arg compression - streamedIn getter alt.Player.streamedIn / alt.Vehicle.streamedIn - Added WebSocketClient API → ws.on(‘open’, () => {}) → ws.on('close', (code, reason) => {}) → ws.on('error', reason () => {}) → ws.on('message', msg () => {}) → ws.addSubProtocol() → ws.getSubProtocols() → ws.setExtraHeader() → ws.getExtraHeaders() → ws.pingInterval → ws.autoReconnect → ws.perMessageDeflate → ws.start() → ws.stop() - Added HttpClient API → http.setExtraHeader() → http.getExtraHeaders() → http.get() → http.head() → http.post() → http.put() → http.delete() → http.connect() → http.options() → http.trace() → http.patch() - Added 3D & 2D Audio API → audio.source → audio.looped → audio.volume → audio.category → audio.currentTime → audio.maxTime → audio.playing → audio.addOutput() → audio.removeOutput() → audio.getOutputs() → audio.play() → audio.pause() → audio.stop() → audio.reset() → audio.seek() → audio.on('streamEnded', () => {}) → audio.on('error', (code, message) => {}) - js-module command - alt.getHeadshotBase64 - generic event handlers - webview once - static local storage methods - natives can handle entities directly without scriptID - error logs for natives - entity.isSpawned - same as entity.scriptID > 0 - html support for rss feed - toggleExtra - vehicle maxGear setter & getter - vehicle gear setter - vector 3 dot class - vehicle indicatorLights setter/getter - WebView getters (isReady, isOverlay) - WebView getter/setter focused - warning if heap limit is nearly reached - heap increament by 100mb if limit is nearly reached (max 4GB) - configflag to disable weaponswap if weapon is empty - currentAmmo getter for localplayer Fixed - vehicle rotation getter - alt.resourceLoaded was only available in debug - connect url - crash when pushing invalid args to natives - checkpoint functions - leftVehicle event on vehicle destroy - heap command - timers command - permissions-system if cdn was used - interiors after set playermodel while in interior - vehicle rotation bug - microtasks (e.g. wasm apis) Changed - Natives which accepted \"undefined\" needs 0 now - Update v8 to Version 9.2 - Extended Pool DrawableStore to 110 000 - Extend MapDataStore pool by 15k - Increased CNetworkDamageTracker pool Server Added - player.setProp, player.setDlcProp, player.getProp, player.getDlcProp & player.clearProp - player.setClothes, player.setDlcClothes & player.getClothes, player.getDlcClothes - alt.emitAllClients - player.isEntityInStreamRange - alt.setPassword - Vector2 Class - event arg compression - generic event handlers - isDead getter - setWheelFixed setter - support for player array on emit alt.emitClient([player, player], ...args) - vector 3 dot class - attachTo & detach - \\n support in disconnect reasons for line break - alt.Vehicle constructor now also accepts Vector3 for pos and rot instead of x, y, z params Changed - vehicle.getAttached() to vehicle.attached - vehicle.getAttachedTo() to vehicle.attachedTo - socialId to socialID - removed alt.getPlayersByName JS Module Changed - Update NodeJS to Version 14.15.2 - NodeJS Performance improvements C# Module Changed Reworked for .NET 5","lang":""},"articles/changelogs/6_0.html":{"type":"article","href":"articles/changelogs/6_0.html","title":"6.0-Release","keyword":"6.0-Release Tip This update was released on 01.10.2021 Caution This update contains breaking changes , which can potentially break the functionality of your gamemode, please verify and change accordingly. Client Added - setting to open console in seperate window (useExternalConsole) - console command external_console 0/1 - resourceError event - Vector3 cross, zero, one, up, down, forward, back, left, right, negativeInfinity & positiveInfinity - Vector2 zero, one, up, down, left, right, negativeInfinity & positiveInfinity - profiler api - more informations to timers command - MemoryBuffer size property - MemoryBuffer address property - possibility to clear cache via menu in launcher - native arg size missmatch error message - taskChange event - playerName event for earlyauth (requested via alt.emit(\"requestPlayerName\")) - allowed some html tags for custom launcher rss feed - setExtraHeader method for webview - setZoomLevel method for webview - possible to change position of watermark (alt.setWatermarkPosition) - scriptID getter to blip Fixed - server errors localization - timers command - resource loading order - hats in vehicle for remote players when serverside clothsetter was used - memory leak in timers - changing playermodel in interior - VehicleBlip & PedBlip - ime input method crash - abort button while downloading ressources - vehicle maxGear getter - problems with SLI - checkpoint color property - fist fight sync on first connect - weaponswap configflag deactivated vehicle weapons - crash if accessing blip name property - player visible getter always returned true - modifying vehicle handling crashed when out of streaming distance - alt:V voice position sync in interior Changed - updated CEF to 92 - urls need to start with ws/wss for websocket and http/https for http client - systemlocale will be used to define locale in cef Server Added - resourceError event - vehicleDamage event - Vector3.cross - armourdamage to playerDamage event - playerDamage event didnt trigger if victim has armour or health greater then 200 - errorlog if there is a missmatch for clothsetter (only available in debug) - streamed property - updated clothes bin to tuners dlc - weaponchange event is cancelable now - player movespeed getter - player IsInRagdoll getter - player isAiming getter - player aimPos getter - player headRot getter - alt-player-name to connect.json http header - invincible setter & getter for player - setIntoVehicle method for player - announceRetryErrorDelay & announceRetryErrorAttempts to server.cfg Fixed - playerDamage triggered if health changed via serverside setter - changing vehicle dimension, didn't remove the player from vehicle - getProps getter - problem with setClothes if texture, palette & drawable was 0 - Colshape not getting triggered for players connecting on the position of the Colshape - fixed wheelsCount getter after vehicle repair - prevent headlight color from reset after vehicle repair - setting invalid date & time values crashed the client - Server crashed, if player was inside coleshape while deleting it - bulk repair vehicles freezed the server Server & Client Added - isServer property - isClient property - shared module Fixed - possible fix for teleporting vehicles on netowner change JS Module Breaking changes - playerDamage has a new parameter (armourdamage). Weaponhash is now the 5th parameter instead of the 4th. C# Module Breaking changes - PlayerDamage has a new parameter (armourdamage). The parameter is the 5th parameter now. - AltV.Async: IVehicle.IsSpecialLightDamaged has been renamed to IsSpecialLightDamagedAsync - AltV.Async: IVehicle.IsWindowDamaged has been renamed to IsWindowDamagedAsync - AltV.Async: IVehicle.SetSpecialLightDamaged has been renamed to SetSpecialLightDamagedAsync - AltV.Async: IVehicle.SetWindowDamaged has been renamed to SetWindowDamagedAsync","lang":""},"articles/changelogs/7_0.html":{"type":"article","href":"articles/changelogs/7_0.html","title":"7.0-Release","keyword":"7.0-Release Tip This update was released on 30.11.2021 Caution This update contains breaking changes , which can potentially break the functionality of your gamemode, please verify and change accordingly. - 7.4: - Releasedate: 11.12.2021 - (client) fixed handling api after 7.0 release - (server) fixed invincible setter - (client) fixed webview events sometimes are not queued up correctly - 7.3: - Releasedate: 07.12.2021 - (server|client) getResourceExports is available on server & client now - (client) improved stacktrace - (server) fixed setDateTime setter to fix fps - (client) added heapspaces command - (server) fixed setDoorState for netowner - 7.2: - Releasedate: 03.12.2021 - (client) Fixed a crash if memory runs out - 7.1: - Releasedate: 30.11.2021 - (server) Fixed beforeconnect crashes Client Added - alt.Blip.all getter - ping getter - fps getter - refCount getter (debug-mode only) - help button in main menu, which points to the troubleshooting guide - native arg missmatch to resourceError event - worker api - allow relative paths in alt.File API - disable idlecam configflag - emitServerRaw (serverside js required) - natives from tuners dlc - getTotalPacketsSent & getTotalPacketsLost - webview event queue if webview isnt't ready yet - server ip & port getter Fixed - stacktrace for uncaught exceptions - isKeyDown & isKeyToggled functions were swapped - syncedmetadata crashed client sometimes Changed - Update v8 to Version 9.6 with i18n support - resize phInstGta pool to 16384 Breaking changes - stacktrace parameter in resourceError removed Server Added - Blip api - Vehicle velocity getter - player appearance setter & getter - player getters - -> isReloading - -> currentWeaponTintIndex - -> isSuperJumpEnabled - -> isCrouching - -> isStealthy - -> weapons - vehicles getter - -> driftModeEnabled - vehicles setter - -> driftModeEnabled - -> setSearchLightTo (entity parameter isn't working for now) - Trains api - beforePlayerConnect event - emitClientRaw & emitAllClientsRaw - hashServerPassword function - validation for invalid gta clothes via clothes setter Fixed - incorrect number plate index causes sync anomalies - vehicle stuck in air after setting position - outdated clothes.bin for tuners dlc clothes","lang":""},"articles/changelogs/8_0.html":{"type":"article","href":"articles/changelogs/8_0.html","title":"8.0-Release","keyword":"8.0-Release Tip This update was released on 20.12.2021 This update was a compatibility patch for the GTA Online DLC: The Contract - 8.0 / 8.1: - Add support for GTA version 2545 (The Contract DLC) - Fix clientside vehicle enter / exit events - 8.2: - Fix vehicle spawning - 8.3: - Fix DLC vehicle spawning - Fix vehicle.engineHealth getter - 8.4: - Fix trailer spawning - 8.5: - Add Quit and Reconnect button on server disconnect - Fix weapon autoswap animation glitch - Fix deleting vehicles via natives - 8.6: - Fix trailer sync - 8.7: - large projectiles wasn't synced - 8.8: - adjust some gta pools - 8.9: - Increase drawable related game pool sizes (DrawableStore & DwdStore) Client Added - Quit and Reconnect button on server disconnect Fixed - Support for GTA version 2545 (The Contract DLC) - Vehicle sync - Vehicle spawning - Vehicle enter / exit events - Deleting vehicles via natives - Weapon autoswap animation glitch - Attach API desync - Trailer attach desync - Trailer sync Server & Client Fixed - vehicle.engineHealth getter","lang":""},"articles/changelogs/9_0.html":{"type":"article","href":"articles/changelogs/9_0.html","title":"9.0-Release","keyword":"9.0-Release Tip This update was released on 04.02.2022 Caution This update contains breaking changes , which can potentially break the functionality of your gamemode, please verify and change accordingly. - 9.1: - Fixed crash in worker.pause & worker.resume - Change invalid timer id message to warning - 9.3: - Fixed model change - Fixed invisible player & vehicles after server start in some cases - 9.4: - Fixed bytecode related issues - 9.5: - Fixed ENB compatibility - 9.6: - Added cloth validation for overwritten gta dlc's, custom clothes & props - Reduced AttachmentExtension pool & extendet AnimStore pool - 9.7: - Add support for latest Rockstar Launcher Update - 9.8: - alt.isKeyDown returned true when key was pressed but game not focused - 9.10: - Add support for GTA version 2612 - 9.12: - Crashfix for GTA version 2612 - 9.13: - Disable placeholder files from gta version 2612 - 9.14: - Add support for GTA version 2628 - 9.15: - Fix crashes introduced in GTA version 2628 Client Added - debug http server for reconnect - isReloading getter - alt.Profiler.getMemoryProfile - alt.isCamFrozen() - password in connect url - spawned event - disabled social club menu - Option to exit Game Inside GTA:V Menu - alt.copyToClipboard - start menu shortcut - reuse last password on reconnect command if no password specified - alt.worldToScreen, alt.screenToWorld & alt.getCamPos - vehicle seatCount getter - Vector2 and RGBA support in webviews Fixed - netowner getter returned null - discord api wasn't working if it was started after alt:V launch - players didn't die at vehicle explosion - player got rejected if the server has no password, but pw field was not empty - player to player attach - \"Temp data already defined\"-Error - sometimes it wasn't possible to reconnect if you got a timeout once - weaponswap configflag deactivated vehicle weapons - setArtificialLightsState native - GetCursorPosition and SetCursorPosition was usable if game window was out of focus - getHeadshotBase64 crashes - AltV Voice LipSync Breaking changes - client mods that need d3d11.dll to work are now disabled until further notice Server Added - warning when Server is started with debug mode - string support in beforePlayerConnect event - voice channel GetPlayers and GetPlayerCount - server starts with default config if no server.cfg exists - alt.stopServer - IsEntityInStreamingRange accepts entity id now - Warning when specifying cdn url without protocol - don't stream in players that are not spawned - warning when announcing but CDN URL is empty - warning when health or armour setters are used with invalid values - 3 unknown train setter & getter - getVehicleModelInfoByHash - improved net owner calculations - improved server.cfg error message for Invalid token - polygon colshape - improved colshape remove performance - sync data optimization for high population areas - multithreaded sync - thread safe synced meta data - thread safe vehicle and player apis - improved server loop performance - connection queue - --help command-line option Fixed - Crash if entity id limit is reached - OnPlayerLeaveVehicle event is never fired when a player disconnects - Vehicle locked state setter - crashes when using restartResource or stopResource - fixed colshape entity race conditions causing error logs - fixed connect race condition keeping entity connected - train doors were always open - version getter was broken on linux - vehicle healthdata getter was broken on linux Breaking changes - vehicle base64 getters and setter are now checking the gta version and the old data before this change is incompatible Server & Client Added - localMeta Api - getAllResources method - alt.time & alt.timeEnd","lang":""},"articles/changelogs/index.html":{"type":"article","href":"articles/changelogs/index.html","title":"16.0.0-Release","keyword":"16.0.0-Release Warning This update is the latest. Tip This update was released on 12.01.2024 Server Added config masterlistRelay to server.toml, its default value is \"\" Added config mtu to server.toml, its default value is 1400 Added config enableSyncedMetaData to server.toml, its default value is true Added property versionMajor to ConnectionInfo to JS-Module and VersionMajor to IConnectionInfo to C#-Module Added property versionMinor to ConnectionInfo to JS-Module and VersionMinor to IConnectionInfo to C#-Module Added property modelHash to IVehicleModel to JS-Module and ModelHash to VehicleModelInfo to C#-Module Added property modelName to WeaponModelInfo to JS-Module Added method setBadge to alt.Vehicle to JS-Module and setBadge to Alt.Vehicle to c#-Module Added class VehicleBadgePosition to JS-Module and VehicleBadgePosition to C#-Module Added event playerConnectDenied to JS-Module and OnPlayerConnectDeniedEvent in C#-Module Added argument count to player.addDecoration to JS-Module and count to Player.AddDecoration to C#-Module Deprecated property build from ConnectionInfo in JS-Module Removed property MajorVersion from IConnectionInfo in C#-Module Client Added method alt.getServerTime to JS-Module and alt.ServerTime to C#-Module Added method alt.getPoolSize to JS-Module and alt.GetPoolSize to C#-Module Added method alt.getPoolCount to JS-Module and alt.GetPoolCount to C#-Module Added method alt.getPoolEntities to JS-Module and alt.GetPoolEntities to C#-Module Added method alt.getVoicePlayers to JS-Module and alt.GetVoicePlayers to C#-Module Added method alt.removeVoicePlayer to JS-Module and alt.RemoveVoicePlayer to C#-Module Added method alt.getVoiceSpatialVolume to JS-Module and alt.GetVoiceSpatialVolume to C#-Module Added method alt.setVoiceSpatialVolume to JS-Module and alt.SetVoiceSpatialVolume to C#-Module Added method alt.getVoiceNonSpatialVolume to JS-Module and alt.GetVoiceNonSpatialVolume to C#-Module Added method alt.setVoiceNonSpatialVolume to JS-Module and alt.SetVoiceNonSpatialVolume to C#-Module Added method alt.addVoiceFilter to JS-Module and alt.AddVoiceFilter to C#-Module Added method alt.removeVoiceFilter to JS-Module and alt.RemoveVoiceFilter to C#-Module Added method alt.getVoiceFilter to JS-Module and alt.GetVoiceFilter to C#-Module Added method alt.updateClipContext to JS-Module and alt.UpdateClipContext to C#-Module Added method getSyncInfo to Entity to JS-Module and SyncInfo to IEntity to C#-Module Added method addVolumeEffect to AudioFilter to JS-Module and AddVolumeEffect to AudioFilter to C#-Module Added class ISyncInfo to JS-Module and SyncInfo to C#-Module Added xml styling support to TextLabel ( more details )","lang":""},"articles/changelogs/upcoming.html":{"type":"article","href":"articles/changelogs/upcoming.html","title":"16.1.0-Release","keyword":"16.1.0-Release Warning This update isn't released yet.","lang":""},"articles/checkpoint.html":{"type":"article","href":"articles/checkpoint.html","title":"Checkpoint API","keyword":"Checkpoint API Since alt:V Update 15 there is a class for creating client side checkpoints. These client side checkpoints are easier to create and use, as they are automatically streamed on client side. Usage Checkpoint class in JS API reference Checkpoint class in C# API reference Tip Checkpoints inherit the ColShape class , thus colShape events work on it aswell. Example This example changes the Checkpoint Color to green when the local Player enters it. When the local Player is not inside of it, the checkpoint color will be red. alt.on('consoleCommand', commandName => { if (commandName !== 'addcp') return; const iconColor = new alt.RGBA(255, 255, 255, 100); const pos = alt.Player.local.pos.sub(0, 0, 1); const nextPos = pos.add(2, 1, 0); new alt.Checkpoint(2, pos, nextPos, 1, 2, new alt.RGBA(255, 0, 0, 100), iconColor, 100); }); function handleCheckpointEnterLeave(checkpoint, entity, state) { if (entity !== alt.Player.local) return; checkpoint.color = state ? new alt.RGBA(0, 255, 0, 100) : new alt.RGBA(255, 0, 0, 100); } alt.on('entityEnterColshape', (colShape, entity) => { if (!(colShape instanceof alt.Checkpoint)) return; handleCheckpointEnterLeave(colShape, entity, true); }); alt.on('entityLeaveColshape', (colShape, entity) => { if (!(colShape instanceof alt.Checkpoint)) return; handleCheckpointEnterLeave(colShape, entity, false); });","lang":""},"articles/cloud_auth.html":{"type":"article","href":"articles/cloud_auth.html","title":"Cloud Auth","keyword":"Cloud Auth With alt:V Update 15 there's a new unique player identifier verified by our Cloud Auth service. Unlike socialID, socialClubName, hwidHash or hwidExHash the new identifier cannot be spoofed, and therefore can be used for authentication and other sensitive systems. Warning In order to use the Cloud Auth feature on your server, you need to have Silver+ tier on alt:V Patreon . Link your Patreon account on Server Manager and make sure to have your server added there + a new server token generated to get access to the feature. FAQ What is cloud auth? Cloud auth is a unique identification solution developed by alt:V. This system uses the alt:V backend to create a special ID for each player, which is directly linked to their Rockstar account. How secure is cloud auth? The Cloud Auth system is highly secure. It utilizes our backend for setting up and confirming client identifiers, ensuring secure connections, protect against spoofing and adding an extra layer of security to the process. How does the cloud auth system work? When a client connects to the server, a request can be made to the alt:V backend. This request retrieves the associated unique identifier for the client's Rockstar account, which then can be used to verify and authenticate the client. Can a client spoof or tamper with the unique identifier? No, due to the involvement of our backend in the process, clients cannot spoof or manipulate their unique identifiers. Every operation is verified through our backend, making sure each player's unique ID stays correct and genuine. What can change the unique cloud auth identifier? The unique cloud auth identifier is strictly linked to your Rockstar account so changing the Rockstar account will change the ID. This ID isn't reliant on your hardware or any software. If a stricter verification method is needed, you can consider incorporating additional checks such as hardware ID and other options. Can I create my own cloud auth implementation or use it outside of alt:V? No, creating your own cloud auth implementation is not possible. Our backend plays a key role in the process and for safety reasons, we do not disclose detailed information about its workings. This makes it impossible to reproduce an independent cloud auth system. Usage Player cloudID in JS API reference Player CloudId in C# API reference IConnectionInfo cloudID in JS API reference IConnectionInfo CloudId in C# API reference In case of successful authentication cloud id property returns non-empty string In case of failure cloud id property returns an empty string, and result property returns error code Player cloudAuthResult in JS API reference Player CloudAuthResult in C# API reference IConnectionInfo cloudAuthResult in JS API reference IConnectionInfo CloudAuthResult in C# API reference Possible errors: NO_BENEFIT - The server doesn't have the required benefit unlocked VERIFY_FAILED - Your server failed to retrieve player's cloud id from alt:V service for unknown reason Enum in JS API reference Enum in C# API reference Example import * as alt from 'alt-server'; alt.on('playerConnect', (player) => { const result = player.cloudAuthResult; // 0 means success if (result !== 0) { alt.logError('Failed to authorize player:', player.name, 'error code:', result); return; } alt.log('Player:', player.name, 'connected with cloud id:', player.cloudID); });","lang":""},"articles/commandlineargs.html":{"type":"article","href":"articles/commandlineargs.html","title":"Command-line Arguments","keyword":"Command-line Arguments Command line arguments means you'll likely need to pass them to individual '.exe' or compiled server or client versions. --option1 --option2 --option3 Server launch options Key Description Notes --config [path] Path to server config file ([path] needs to be replaced with config path) --logfile [path] Path to log file, will only output one log file to specific path instead of putting them into the log folder ([path] needs to be replaced with log path) Has higher priority then --logfolder --logfolder [path] Path to log folder ([path] needs to be replaced with log folder path) Has lower priority then --logfile --no-logfile Disables the logging to log files --extra-res-folder [path] Path to additional resource folder ([path] needs to be replaced with the the additional resource folder path) --justpack Creates packages and a resources.json for cdn download in the root folder --host [host] Specifies the host which the server should bind to ([host] needs to be replaced with the host) --port [port] Specifies the port which the should bind to ([port] needs to be replaced with port) --convert-config-format Converts all \".cfg\" config files to \".toml\" format --no-regenerate-rpf-cache Don't generate a cache for rpf files --help Displays help text for all cli arguments Client launch options Key Description -noupdate Skips alt:V updates (only works on the dev branch ) -connecturl [url] Directly connects to specfied url ([url] needs to be replaced with the connectionurl) -debug Enables debug mode -branch [branch] Sets the branch to use ([branch] needs to be replaced with release, rc or dev) -skipprocessconfirmation Skips the confirmation message for closing an already running GTA V / alt:V instance -linux Enables linux mode Server Commands Key Description start [resourcename] Starts a server resource by name stop [resourcename] Stops a server resource by name restart [resourcename] Restarts a server resource by name","lang":""},"articles/configs/client.html":{"type":"article","href":"articles/configs/client.html","title":"The client configuration","keyword":"The client configuration After you downloaded and installed the alt:V Multiplayer client, you can find the altv.toml file in the installation folder. This file contains the settings of the client. Per default this file only contains the branch and the path to your GTA:V installation. After the first launch of alt:V there are more settings available in the altv.toml . However, there are more settings that you can apply. Most of these settings can also be applied in the main menu under Settings but some of them need to be set up directly in this file. List of possible client configurations Key Type Default Value Description name string alt:V nickname Your name that is displayed on a server. branch string release The branch on which the client will work. debug boolean (true/false) false Activates the debug mode. For example, a active debug mode enables the debug-console (accessible via F8) and allows you to use the reconnect command in the console. gtapath string - Path to your GTA5 directory. Usually, it is set up automatically thought the installation process. lang string en Language of your client. lastip string 0.0.0.0 (IPv4) The ip of the last server you played on. netgraph boolean(true/false) false Shows a netgraph on the bottom left. streamerMode boolean(true/false) false Enables or disables the streamer mode . textureBudgetPatch boolean(true/false) true Enable or disable the texture budget patch useSharedTextures boolean(true/false) true Enable or disable the shared textures (Hardware Acceleration for CEF) useExternalConsole boolean(true/false) false Enables or disables the external console (console popout). voiceActivationKey number 78 (N) Sets the key for Push-to-talk. You can get the key code here . voiceActivationEnabled boolean(true/false) false Enables or disables the voice activity input mode. voiceInputSensitivity number 20 If voiceActivationEnabled is enabled, this option will set the required sensitivity. voiceEnabled boolean(true/false) true Enables or disables the voice system for the client. voiceAutoInputVolume boolean(true/false) true Enables or disables the automatic determination of the input volume. voiceInputVolume number 100 Sets the input volume (Range: 0 - 200). voiceNoiseSuppression boolean(true/false) true Enables or disables the noise suppression. voiceVolume number 100 Sets the output volume (Range: 0 - 200). earlyAuthTestURL string - URL to your early auth website. Only usable in rc & dev branch. gameTimeout number 60 Maximum time (in seconds) the launcher should wait for GTA V to start. logsToKeep number 10 How many client & launcher logs should be kept until rotation starts. heapSize number 1024 The default memory size for the texture/asset VRAM budget limit (auto calculated from your pc specs) linuxCompatibility boolean(true/false) false Enable or disables Linux/MacOS related settings (See Discord #general Linux & MacOS Threads) discordRichPresence boolean(true/false) true Enable or Disable the Discord Rich Presence (\"Now Playing\" alt:V in Discord user profile) enableModDirectory boolean(true/false) false Enables the mod directory. See here for more info. Example altv.toml file branch = \"release\" debug = false gtapath = \"C:\\\\Program Files (x86)\\\\Steam\\\\steamapps\\\\common\\\\Grand Theft Auto V\" lang = \"en\" lastip = \"127.0.0.1:7788\" name = \"exampleName\" netgraph = false streamerMode = false useExternalConsole = false voiceActivationEnabled = false voiceActivationKey = 78 voiceAutoInputVolume = false voiceEnabled = false voiceInputSensitivity = 20 voiceInputVolume = false voiceNoiseSuppression = false voiceVolume = false","lang":""},"articles/configs/index.html":{"type":"article","href":"articles/configs/index.html","title":"Config files in alt:V","keyword":"Config files in alt:V This article will explain the different types of config files and the use of config files in alt:V. What are config files used for Config files are the files that give alt:V information about your server configuration. In a config file you specify e.g. your server name, the amount of slots, the type of your resource etc. There are several different config files in alt:V, which all have their own set of configuration options, usage and location. Important rules about the config files The config is written in TOML format Every line only contains one configuration option Every configuration option is a key value pair, so it starts with the key , then a = to seperate the key and the value, and after that the value Lines that start with a hashtag ( # ) are ignored and can be used for comments Empty lines are ignored","lang":""},"articles/configs/resource.html":{"type":"article","href":"articles/configs/resource.html","title":"The resource.toml configuration file","keyword":"The resource.toml configuration file The resource.toml configuration file is needed for every resource you have, it has to be located in the main directory of your resource. It has some configuration options for your resource like the type of your resource and its dependencies. Here is a list of all configuration options for the resource.toml and what they are used for: # The serverside type of your resource (the correct module for that type has to be loaded) type = \"js\" # The clientside type of your resource (the correct module for that type has to be loaded) client-type = \"js\" # The main serverside file that will get loaded when the server starts main = \"server.js\" # The main clientside file that will get loaded when the client starts client-main = \"client.js\" # The files that the client has access to (The client-main file does not have to be included here) client-files = [ \"myFile.js\", # You can also use glob patterns to give access to a whole directory \"client/*\" ] # The required permissions to play on the server (these have to be accepted, otherwise the player can't join) required-permissions = [ \"Screen Capture\" ] # The optional permissions to play on the server (these permissions can be declined by the user) optional-permissions = [ \"WebRTC\" ] # The dependencies of this resource (All dependencies get loaded before the resource) deps = [ \"myOtherResource\" ]","lang":""},"articles/configs/server.html":{"type":"article","href":"articles/configs/server.html","title":"The server.toml configuration file","keyword":"The server.toml configuration file The server.toml file is the most important configuration file, it is the main configuration file for your whole server, and will define important configurations like server name, amount of slots, loaded resources and more. The current server.cfg in yaml format is deprecated but will support too. Here is a list of all configuration options for the server.toml and what they are used for: # The display name of your server name = \"My server name\" # The binding address of your server (usually 0.0.0.0) host = \"0.0.0.0\" # The port of your server (default 7788) port = 7788 # The amount of players that can play on your server concurrently players = 256 # The password required to join your server password = \"mySecretPassword\" # If the server should be visible on the masterlist in the alt:V client announce = true # Token to announce the server to the masterlist token = \"superSecretToken\" # The gamemode your server is running gamemode = \"Freeroam\" # The website of your server website = \"example.com\" # The language of your server language = \"English\" # The description of your server description = \"My cool server\" # If the debug mode should be allowed (Debug mode allows debugging functions like reconnect or the CEF debugger) debug = false # The stream in distance for entities streamingDistance = 400 # The migration distance for entities migrationDistance = 150 # The timeout multiplier (must be >= 1) timeout = 1 # The delay that is used when the announceRetryErrorAttempts are reached (in ms) announceRetryErrorDelay = 10000 # Max retries until announceRetryErrorDelay will be used announceRetryErrorAttempts = 50 # Max players which can connect with the same ip address duplicatePlayers = 4096 # Enable or disable syncedMetadata enableSyncedMetaData = true # Key for shared resources. Can be used to share resources between multiple servers, so users don't have to download them separatedly sharedProjectKey = \"altv-shared\" # Display name for shared resources bundle (visible in alt:V client settings) sharedProjectName = \"alt:V shared\" # Max size of client to server script events in bytes maxClientScriptEventSize = 8192 # Max size of server to client script events in bytes maxServerScriptEventSize = 524288 #When false unknown rpc events will result in a kick allowUnknownRPCEvents = true # Define the map bound size mapBoundsMinX = -10000 mapBoundsMinY = -10000 mapBoundsMaxX = 65536 mapBoundsMaxY = 65536 mapCellAreaSize = 100 #smaller areas uses more ram and less cpu # Defines the rate (miliseconds) in which colshape calculations should occur colShapeTickRate = 200 # Defines the used logging streams (console, file, stdconsole) for the server logStreams = [ \"console\", \"file\" ] # The tags for your server (max. 4) tags = [ \"Freeroam\", \"Cool\" ] # Should connection queue be enabled for your server. # ConnectionQueueAdd & ConnectionQueueRemove serverside events are required to accept or decline connections connectionQueue = false # Should early auth be used for your server useEarlyAuth = false # The url for the early auth login page (only used when useEarlyAuth is true) earlyAuthUrl = \"https://example.com/login\" # Should a CDN be used for your server useCdn = false # The url for the CDN page # Outdated Notation: \"https://cdn.example.com\" cdnUrl = \"cdn.example.com:443\" # Should alt:V server send all clients player name on connect sendPlayerNames = true # Spawn player automatically at 0,0,71 after connect spawnAfterConnect = true # An array of all resources that should be loaded resources = [ \"myResource\", # Since alt:V 10.0 you can also use resources in subdirectories \"vehicles/firstVehicle\", \"vehicles/secondVehicle\", # Since alt:V 15.0 you can even use * wildcard character to use all folders as resources \"vehicles/*\", ] # An array of all modules that should be loaded modules = [ \"js-module\", \"csharp-module\" ] # If dlcWhitelist contains any dlcs, it will only enable these specific game DLCs. Useful when you want to maintain a list of 'supported' DLCs on your server because of game limits, ID shifts, etc. Below defined setting would make sure to only load the mpBeach, mpBusiness and patchday27ng R* dlc contents # See complete DLC list at go.altv.mp/dlc-list dlcWhitelist = [ \"mpBeach\", \"mpBusiness\", \"patchday27ng\" ] # Obfuscate resource names hashClientResourceName = true # The amount of server side managed entities per type that can be streamed at the same time per player. If more than the set amount of entities are in streaming range, the closest n entities (as defined below) of the specific type will be streamed. Changing these values can cause performance and stability issues. [maxStreaming] peds = 128 # Max 220, shared type for server side created NPC peds + player peds objects = 120 # Max 120, server side created objects vehicles = 128 # Max 220, server side created vehicles entities = 128 # Defined the max limit of entities, indepent of type, that can be streamed at the same time # Configure GTA game pool sizes to extend them. These game pools define the limits of certain aspects in the game, extending them can and will cause stability and performance issues. Please test changes carefully. # See this article for a complete list of game pools: https://docs.altv.mp/gta/articles/tutorials/overwrite_gameconfig.html [pools] \"DrawableStore\" = 240420 # Example of raised DrawableStore pool # Profiling entity creation, systems like streaming etc [worldProfiler] port = 7797 host = \"0.0.0.0\" # Configure the amount of threads used for different kind of processing in the alt:V server. You should in total never configure more threads than your server hardware has threads. # For example, when your hardware has 12 threads, use 8 for sync send, 2 for receive and all other at 1. [threads] streamer = 1 # Processing of streamed entities migration = 1 # Processing of netowner calculations syncSend = 8 # Processing of sending sync data, should be always the highest amount syncReceive = 2 # Processing of receiving sync data, should be around 1/4 of syncSend # Settings related to js-module [js-module] # \"https://nodejs.org/api/cli.html#--enable-source-maps\" source-maps = true # \"https://nodejs.org/api/cli.html#--heap-prof\" heap-profiler = true # Enable profiler profiler = true # \"https://nodejs.org/api/cli.html#--experimental-global-webcrypto\" global-webcrypto = true # \"https://nodejs.org/api/cli.html#--experimental-network-imports\" network-imports = true # Add extra cli arguments to the node environment \"https://nodejs.org/api/cli.html\" extra-cli-args = [\"--max-old-space-size=8192\"] # Enable node.js inspector [js-module.inspector] host = \"127.0.0.1\" port = 9229 # Settings related to c#-module [csharp-module] # Disable dependency (NuGet) check and download at server startup, this is recommended if you have a bad connection to the NuGet server (e.g china) disableDependencyDownload = true # Voice configuration (category needs atleast to exist in configuration, to enable voice chat) # See this article for more info: https://docs.altv.mp/articles/voice.html [voice] # The bitrate of the voice server bitrate = 64000 # The secret for the external server (only needed when using externalHost) # The secret must consist of numeric values only externalSecret = \"1234567890\" # The external host address (leave 127.0.0.1, if voice-server is on same machine) externalHost = \"127.0.0.1\" # The external host port externalPort = 7798 # The external host public address (should be the ip address of your server, not localhost!) externalPublicHost = \"xx.xx.xx.xx\" # The external host public port externalPublicPort = 7799","lang":""},"articles/configs/stream.html":{"type":"article","href":"articles/configs/stream.html","title":"The stream.toml configuration file","keyword":"The stream.toml configuration file The stream.toml configuration file is needed for every dlc resource, e.g. a new vehicle. It has some configuration options like the GXT values and meta files. Here is a list of all configuration options for the stream.toml and what they are used for: # An array containing all files that should be loaded for this dlc files = [ # You can also use glob patterns to give access to a whole directory \"stream/assets/*\" ] # The meta files your dlc uses [meta] \"stream/carcols.meta\" = \"CARCOLS_FILE\" \"stream/vehicles.meta\" = \"VEHICLE_METADATA_FILE\" \"stream/handling.meta\" = \"HANDLING_FILE\" # The GXT entries for your dlc [gxt] \"myveh\" = \"My vehicle\"","lang":""},"articles/connection_queue.html":{"type":"article","href":"articles/connection_queue.html","title":"Player connection queue","keyword":"Player connection queue This article will explain the player connection queue added in the 9.0 update. What is a connection queue Due to the current underlying networking, each player in the queue will actually occupy a slot and increase the player count. When the player queue is activated, the playerConnect event is triggered once the connection has been accepted. The connection queue will place the players attempting to connect to the server in a queue. You can then accept or decline the upcoming connection at any moment. Usage Config You have to set / add the following field in your server.toml connectionQueue = true Player queue events The connectionQueueRemove event is triggered when you accept / decline the connection or when the player disconnects by canceling the connection. Event Name Description connectionQueueAdd Event triggered once a player is added to the connection queue connectionQueueRemove Event triggered once a player is removed from the connection queue Connection info You have access to a connection info class instance as the first parameter of the connectionQueueAdd and connectionQueueRemove events. Functions Function Name Description connectionInfo.accept() Accept the player connection to the server. connectionInfo.decline(reason) Decline the player connection to the server with an optional reason. Properties Property Name Description connectionInfo.name Player name. connectionInfo.socialID Player social club id. connectionInfo.discordID Player discord id. connectionInfo.ip Player IP adress. connectionInfo.hwidHash Player hwidHash. connectionInfo.hwidExHash Player hwidExHash. connectionInfo.authToken Player auth token if early auth was used. connectionInfo.isDebug Whether the player client is in debug mode or not. connectionInfo.branch Player client branch. connectionInfo.build Player client build. connectionInfo.cdnUrl CDN url if used. connectionInfo.passwordHash Password hash entered in the server connection modal. Script usage Javascript Typescript C# async function getDataFromDatabase() { return new Promise(resolve => setTimeout(resolve(true), 5000)); } async function processPlayerInQueue(connectionInfo) { if (await getDataFromDatabase()); connectionInfo.accept(); } alt.on('connectionQueueAdd', processPlayerInQueue); alt.on('connectionQueueRemove', (connectionInfo) => { console.log(\"Player removed from the queue, even if I accept the connection now it's handled!\"); }); async function getDataFromDatabase(): Promise { return new Promise(resolve => setTimeout(resolve(true), 5000)); } async function processPlayerInQueue(connectionInfo: alt.ConnectionInfo): Promise { if (await getDataFromDatabase()); connectionInfo.accept(); } alt.on('connectionQueueAdd', processPlayerInQueue); alt.on('connectionQueueRemove', (connectionInfo: alt.ConnectionInfo) => { console.log(\"Player removed from the queue, even if I accept the connection now it's handled!\"); }); using AltV.Net.Async; using AltV.Net.Types; namespace Example { class ExampleResource : AsyncResource { private async Task GetDataFromDatabase() { await Task.Delay(5000); return true; } private async Task OnConnectionQueueAdd(IConnectionInfo connectionInfo) { if (await this.GetDataFromDatabase()) connectionInfo.Accept(); } private Task OnConnectionQueueRemove(IConnectionInfo _) { Console.WriteLine(\"Player removed from the queue, even if I accept the connection now it's handled!\"); return Task.CompletedTask; } public override void OnStart() { AltAsync.OnConnectionQueueAdd += this.OnConnectionQueueAdd; AltAsync.OnConnectionQueueRemove += this.OnConnectionQueueRemove; } public override void OnStop() { } } }","lang":""},"articles/connectprotocol.html":{"type":"article","href":"articles/connectprotocol.html","title":"Direct Connect Protocol","keyword":"Direct Connect Protocol This protocol can be used to connect to an alt:V server over the browser. Protocol format: altv://connect/ADDRESS?password=PASSWORD or altv://connect/ADDRESS ADDRESS is urlencoded connection address, exactly like used in \"Direct connect\" window PASSWORD (optional) is urlencoded password Example: my.cdn.server:80 -> altv://connect/my.cdn.server%3A80 http://my.cdn.server -> altv://connect/http%3A%2F%2Fmy.cdn.server [::1]:1234 with password test -> altv://connect/%5B%3A%3A1%5D%3A1234?password=test","lang":""},"articles/console.html":{"type":"article","href":"articles/console.html","title":"Client Console","keyword":"Client Console alt:V has a Client Console integrated which can be opened with the key \"F8\". It shows the output of clientside alt.log() , some additional informations and has an inputfield for commands, which can be accessed from a clientside script with the consoleCommand Event . But there are also some default Commands which are listed below, some of them need the debug mode of the client enabled. If the console is opened the Game Controls are disabled, which can be checked with alt.gameControlsEnabled() . Default Commands Command Debug needed Description netgraph [0/1] No Shows a netgraph on the minimap for fps and network informations. quit No Closes the game. heap No Shows \"Heap benchmark infos\" in console. heapspaces No Shows \"Heap spaces infos\" in console. timers No Shows \"Timers benchmark infos\" in console. reconnect [password] Yes Reconnects to the same server, password is the server password and optional. external_console [0/1] No Open console in a extra window. voiceVolume [0-200] No Sets the output volume. voiceInputVolume [0-200] No Sets the input volume. js-module No Shows informations about the js module. debugvehs No Shows \"Streamed in server vehicles info\" in console. rmldebug Yes Shows RMLUI debug window connect [ip:port or url] [password?] Yes Connects to a server. clear No Clears the console.","lang":""},"articles/contributing.html":{"type":"article","href":"articles/contributing.html","title":"How to Contribute","keyword":"How to Contribute This document includes a set of guidelines for contributing to alt:V documentation. Documentation structure Structure consists of one or more repositories linked to the core repository (you're currently in it). Core repository is responsible for including linked repositories in documentation generation process. We're using DocFx generator for that task. Each linked repository have directory structure that looks similar to this: └───docs │ build.cmd │ build.ps1 │ docfx.json │ index.md │ toc.yml │ ├───api └───articles docfx.json is the main configuration file, used locally for testing purposes. If you wish to learn more about its format, refer to this . build.cmd and build.ps1 are scripts written in PowerShell to test documentation locally before publishing changes to core repository. Later we'll explain how they work and how to use them. index.md and toc.yml are main Conceptual documents that are required (with some exceptions) in documentation. toc.yml file (Table of Contents or ToC) is YAML document that specifies documentation structure in current directory and is responsible for linking other subdirectories for ease of navigation. If you wish to learn more about its format, refer to this article . index.md file is Markdown document that appear in every directory and serves as a starting page. api contains API documentation, which is mostly generated automatically from source code of the project and later incorporated by documentation generator. When generated automatically, we don't edit these files directly, but we use files called overwrite documents, which allows us to overwrite files without editing source at all. articles contains Conceptual documentation, which will be the place where you'll spend the most of your time. In the opposition to api folder, files there are created manually by contributors. Linked repositories We include community created modules in our documentation and if you want to contribute to language specific documentation, switch to repository posted below: Language Repository JS C# Build tools As mentioned previously, every linked repository should contain build tools to easily test and verify your work. As of now, we're only providing ways to do that on Windows, where PowerShell is installed. Warning Other operating systems are not supported by us and by current documentation generator (although it might change in DocFx v3). Actual code is defined in build.ps1 , where build.cmd serves as wrapper (by default in Windows Explorer it's not allowed to execute PowerShell scripts by simply opening them). Command-line arguments: Argument Description Usage port Changes port used by DocFx to host website on. ./build.ps1 -port 80 cleanMetadata All generated output will be removed on each run. ./build.ps1 -cleanMetadata cleanOnly All dependencies will be removed only. ./build.ps1 -cleanOnly Initial setup To start adventure with contribution, you need programs installed such as Git, Node with npm package manager and if you wish to work with C# documentation, Visual Studio with \".NET desktop development\" workload or Visual Studio Build Tools with \".NET Desktop build tools\" workload. Fork the repository - https://github.com/altmp/altv-docs/fork Open a terminal on Windows. Move to the directory that you want to work in. Clone your repository, replace USER with your GitHub username: git clone https://github.com/USER/altv-docs Add the altmp/altv-docs repo as a remote repository git remote add upstream https://github.com/altmp/altv-docs Switch to the docs directory if there's one in your forked repository. It should have files as described in documentation structure. Generating and testing When build.ps1 script is executed, first we download dependencies such as DocFx tool, plugins, templates or linked repositories etc. Warning Keep in mind that currently we don't automatically update dependencies, but manually deleting them should trigger redownload. Next thing is project metadata generation, which is needed for API documentation. Lastly, DocFx build is executed and generated site will be available on localhost:8080 by default. To stop running script or update website with newest changes, simply terminate running script by pressing key combination Ctrl+C . After that, you can execute script again if needed. If everything works to this moment, you can now start contributing. Tip It's highly recommended that you should work on separate branch rather than master , so you can easily incorporate changes when repository gets updated. Creating articles Before you start creating/editing files, you should think about what you want to add first. Warning You can't write articles about GTA:V stuff, like modding, data etc. That stuff belongs to our wiki website. Title should be as short as possible, understandable and preferably catchy. Another thing to do is to choose proper category for your article. You should find available ones in articles/ directory, they look like folders. Now, if you plan on making only single article, you can go to step Single article . If not, you've to create category for them in case you haven't found one. Follow instructions defined in step Article series . Article series Just like before, you've to think of the name for your category and it also should be as short as possible, understandable and preferably catchy (also it can't be the same as article name). When you got one, create new folder with that name in articles/ directory. Tip Remember, name should be lowercase, alphanumeric and spaces should be replaced with hyphen. You can go inside that folder and create two files there named index.md and toc.yml . These files are required, though index.md can stay empty for now. Before we'll focus on making actual articles, we've to make your category visible in Table of Contents. Let's open articles/toc.yml file, which now looks similar to this: - name: Getting Started href: getting-started/ topicHref: getting-started/index.md - name: How to Contribute href: contributing.md We'll copy Getting Started item and append it just below with changed details. Caution Make sure that How to Contribute item is always at the bottom. Before: - name: Getting Started href: getting-started/ topicHref: getting-started/index.md - name: How to Contribute href: contributing.md After: - name: Getting Started href: getting-started/ topicHref: getting-started/index.md - name: Fancy Category href: fancy-category/ topicHref: fancy-category/index.md - name: How to Contribute href: contributing.md If you've done everything correctly to this point, your category should now be visible. Let's go back to our index.md file created earlier. Index file in our category should contain short summary and what articles are featured. Now we can move on to next step below. Single article Now you can create file in articles/ directory (or in your category directory) with title as filename and .md extension. Tip Remember, filename should be lowercase, alphanumeric and spaces should be replaced with hyphen. Now that file will be included in generation process, but it's not visible in Table of Contents (also abbreviated as ToC) yet. To happen so, we need to add new entry in toc.yml file in the same directory, so your file will be fully visible. Before: - name: Getting Started href: getting-started/ topicHref: getting-started/index.md - name: How to Contribute href: contributing.md After: - name: Getting Started href: getting-started/ topicHref: getting-started/index.md - name: Fancy Article href: fancy-article.md - name: How to Contribute href: contributing.md In case you're creating article series , your toc.yml file is more likely empty at the moment. You don't need to copy code above, you'll only need to add new item. Now we can switch to our file content and first text which will be title formatted as Heading 1 . Example: # Contribution ... content here ... If you encounter trouble with Markdown, you can refresh your memory here . Publishing your work Once you have finished working on your changes, you can submit a pull request to have your changes merged into the repository and included in the documentation. Before submitting a pull request, make sure that you've verified your work. If you've doubts or need help with something, feel free to ask in alt:V Discord server #scripting-offtopic .","lang":""},"articles/customlauncher.html":{"type":"article","href":"articles/customlauncher.html","title":"Introduction","keyword":"Introduction Caution Custom launchers that are required to connect to the server are only allowed if they are fully open source and the server is not listed on the masterlist. As an alternative to the custom launcher, it is possible to obtain a branded launcher. The branded launcher is available from the Patreon \"Diamond\" tier or higher and features several server-specific displays such as an RSS feed, launcher and UI background, logo, primary color, and server name. In order for a user to activate this branding, a \"Apply server skin\" checkbox is shown when connecting to the server, which is enabled by default. This article explains what information is required and how to request it. Samples You can check out the following examples for some of the available customizations: Launcher background Interface background and RSS feed Loading screen Activate the skin Requesting a launcher To request a launcher, you must have an active Patreon membership at the \"Diamond\" level or higher. The following data can be included optionally to customize the interface: All images must be in PNG format A launcher background with a resolution of 300x400 [ Example ] A logo with a resolution of 128x128 [ Example ] A UI background with a resolution of 1920x1080 or 3840x2160 [ Example ] A color to replace the primary color of the interface [ Example 1 ] [ Example 2 ] The link to an RSS feed. The exact format of the RSS feed is covered in the following topics. [ Example ] Once you have fulfilled all requirements and prepared the necessary media, join our Discord server and contact a member of the Public Relations team. RSS Feed Title The title of the RSS feed is visible above the feed. If the 'title' property of the RSS feed is an empty string, the translation of 'Latest news' in the users language will be used instead. Item Properties The following properties of the RSS feed entries are processed by the launcher: Property Required Description title No Title of the post, displayed at the beginning of the post link No Opens in the browser when the user clicks on the post pubDate Yes Date of publication of the post. Displayed at the end in the user's language-specific formatting description Yes Content of the post. Use of various HTML elements is allowed. The allowed elements are covered in the following topic. dc:creator No Creator of the post. Allows the use of HTML. HTML usage The following HTML elements are allowed and can be used in the RSS feed: address, article, aside, footer, header, h1, h2, h3, h4, h5, h6, hgroup, main, nav, section, blockquote, dd, div, dl, dt, figcaption, figure, hr, li, main, ol, p, pre, ul, a, abbr, b, bdi, bdo, br, cite, code, data, dfn, em, i, kbd, mark, q, rb, rp, rt, rtc, ruby, s, samp, small, span, strong, sub, sup, time, u, var, wbr, caption, col, colgroup, table, tbody, td, tfoot, th, thead, tr, img, del Special elements Tip Unless otherwise specified, the display styles of the elements listed below follow the display style of Discord. Spoiler content Displays a spoiler that can be revealed by the user clicking on it. Localized strings LOCALIZATION_KEY LOCALIZATION_KEY A list of translated strings can be found in the altv-locales repository. The usage of the localized strings is only possible in the properties description and dc:creator . Timestamps 1675455031 The timestamp behaves like a timestamp in Discord and displays the respective time in the user's timezone. The content of the span is a Unix timestamp and the possible formats are based on Discords syntax. If no other format is specified, the \"F\" format is used by default. Mentions @zziger Displays a mention. As the value of the attribute, a color in RGB syntax separated by a comma can be specified. If no value is specified, Discord's default mention color is used. Images Emoji \"emojiname\" Displays an image as a small inline element (1.375em height). Allowed in the description and dc:creator properties. Image row \"image \"image \"image Displays the given images in a horizontally scrollable list. The scrollbar is only shown when the width exceeds the possible display. Recommended for example for galleries. Quote
quote content
Displays the specified content as a quote. Code Inline Inline code Displays the specified text as code without line breaks. Block
  Multi line Code block  
","lang":""},"articles/dimensions.html":{"type":"article","href":"articles/dimensions.html","title":"Dimensions","keyword":"Dimensions In alt:V there exists a dimension system and it's implemented serverside. This system allows to have multiple players and vehicles on the same location without seeing each other. It's useful to implement eg Apartments, so you can have multiple Apartments on the same location, without interfiering with eachother. The dimensions are represented as an int32 this means the lowest possible dimension is -2147483648, the default is 0 and the highest is 2147483647. Min Value Max Value Name Description -2147483647 -1 Public Dimension This Dimension can see itself, the General Dimension and the Global Dimension (-1 can see 0, -2 can't see -1, 0 can't see -1, -1 can't see 1) 0 0 General Dimension This Dimension can only see itself. -2147483648 -2147483648 Global Dimension This Dimension can only see itself. 1 2147483647 Private Dimension This Dimension can only see itself and the Global Dimension (1 can't see 0, 2 can't see 1, 0 can't see 1, 1 can't see -1)","lang":""},"articles/discord_oauth.html":{"type":"article","href":"articles/discord_oauth.html","title":"Discord OAuth","keyword":"Discord OAuth The Discord OAuth (Open Authorization) is used to identify a user by the usage of a Discord account. By using the built-in OAuth token request you'll receive a token which can be used to identify the user against the Discord api. Tip The returned data of the token validation can be found at the Discord api documentation . Step-by-Step tutorial Preparation Before you can use the OAuth token you need to create a Discord application. To create a new application you need to: Open the Discord Developer Portal and login with your discord account Click the \"New Application\" button on the top right Fill in your applications name and click on create Go to \"OAuth2\" and then \"General\" Click on \"Add Redirect\", enter http://127.0.0.1 and click \"Save Changes\" in the bottom bar Copy the \"CLIENT ID\" on the top - it will be needed for the next step Client-side code // Enter the client id here const DISCORD_APP_ID = '1234567890'; async function getOAuthToken() { try { const token = await alt.Discord.requestOAuth2Token(DISCORD_APP_ID); alt.emitServer('token', token); } catch (e) { // Error can be due invalid app id, discord server issues or the user denying access. alt.logError(e); } } getOAuthToken(); Server-side code alt.onClient('token', async (player, token) => { // Validate the token with a GET request to the Discord api const request = await axios .get('https://discordapp.com/api/users/@me', { 'headers': { 'Content-Type': 'application/x-www-form-urlencoded', 'Authorization': `Bearer ${token}` } }) .catch((err) => { return null; }); // Check if the request was successful and if the neccessary properties are included if (!request || !request.data || !request.data.id || !request.data.username) { player.kick('Authorization failed'); return; } // Example of returned properties alt.log(`Id: ${request.data.id}`); alt.log(`Name: ${request.data.username}#${request.data.discriminator}`); });","lang":""},"articles/earlyauth.html":{"type":"article","href":"articles/earlyauth.html","title":"Setup EarlyAuth","keyword":"Setup EarlyAuth Early Auth is a function to protect the alt:V server against possible DDOS Attacks, this function only works with announce set to true. It's working as followed: A client connects to the server over the server list, the early auth functions opens a external login page where the player can authenticate. If the authentication was successfull the login page is sending a post request with a token to the client. Then the website whitelists the IP of the client in the firewall of the server. Now the client can connect and can be identified by the gameserver over the given auth token. The auth token needs to be generated by the login page. Tip To test Early Auth in rc or dev branch, make sure your clients altv.toml file contains the following setting: earlyAuthTestURL = 'http://url_or_ip_to_your_early_auth:3000/earlyauth.html' Step-by-Step Tutorial Example values In this tutorial following example values are used: Key Value Description token 0123456789 The token for the masterlist (Needs to be requested from Masterbot via Discord) earlyAuthUrl https://login.example.com/index.html The url to the external login page. authToken authToken0123456789 The token generated by the site. Step-by-Step Example Add announce = true to server.toml . Add your token to token = 0123456789 in server.toml . Add useEarlyAuth = true to server.toml . Add earlyAuthUrl = 'https://login.example.com/index.html' to server.toml . Add Function 1 to your login page, trigger this function and a firewall whitelist function after successfull login. Add a check for the authToken to the playerConnect event eg Function 2 Now the earlyAuth login is ready. Function 1 Function 2 alt.on(\"playerConnect\", (player) => { if(player.authToken != \"authToken0123456789\") { player.kick(); } }); Request alt:V Name To request the alt:V from a player, you can use the snipped below in your early auth. Store and retrieve data Since the CEF cache is flushed between restarts, there is an alternative to store data persistently using alt:V LocalStorage. The following snippet explains how to use it: This data is now persistently stored until the alt:V client's cache folder is deleted. Extra informations If you want to close your early auth window, you have to use alt.emit('closeMe')","lang":""},"articles/external_voice_server.html":{"type":"article","href":"articles/external_voice_server.html","title":"External voice server","keyword":"External voice server Depending on the number of players, it may be necessary to run the voice server on an external server, for example, to route network traffic to another network card or to use dedicated resources for the voice server. This article deals with the setup of the external voice server and the connection to the alt:V server. Setup external voice server First of all, the voice server must be downloaded, this can be done automatically with altv-pkg or manually, the links for this can be found in the CDN article under the topics Windows Server and Linux Server. After the download, the voice server can be placed on any server (it can also be the same device as the alt:V server). To configure it create a file named voice.toml, add the following content and adjust it accordingly: # IP address of the external voice server used to receive the alt:V servers voice connection # Can be a private ip or 0.0.0.0 to accept all host = '0.0.0.0' # Port used in combination with the ip above port = 7798 # IP address which is used to receive the clients connections # Should be a public ip or 0.0.0.0 to accept all playerHost = '0.0.0.0' # Port used for the clients connections playerPort = 7799 # Secret shared between the alt:V server and the external voice server secret = 1234567890 Now you only have to start the voice server and continue with the integration of the alt:V server. Integrate external voice server To integrate the alt:V server only small adjustments to the server.toml are necessary: # Define the map bound size mapBoundsMinX = -10000 mapBoundsMinY = -10000 mapBoundsMaxX = 65536 mapBoundsMaxY = 65536 mapCellAreaSize = 100 #smaller areas uses more ram and less cpu [voice] streamingTickRate = 10 # The bitrate of the voice server bitrate = 64000 # The secret for the external server (only needed when using externalHost) # The secret must consist of numeric values only externalSecret = 1234567890 # The external host address (leave 127.0.0.1, if voice-server is on same machine) externalHost = \"127.0.0.1\" # The external host port externalPort = 7798 # The external host public address (should be the ip address of your server, not localhost!) externalPublicHost = \"xx.xx.xx.xx\" # The external host public port externalPublicPort = 7799","lang":""},"articles/faq.html":{"type":"article","href":"articles/faq.html","title":"FAQ","keyword":"FAQ Here you can see Frequently Asked Question and its answers. Will the limits of GTA:V be increased? Some limits have already been increased. If you need to increase a limit, you can do it with a rpf resource. A tutorial can be found here . Does alt:V work on Linux? There are native builds of the alt:V server for Linux, however the client itself has no official Linux support. Some people have gotten it to work with Wine or Proton though. You can attempt to run it yourself by installing both GTA V and alt:V in the same Wine prefix, but there is no guarantee it'll run as stable as a native Windows install. Is or will alt:V be open-source? Partly. Many of the core parts aren't open-source. Other components are open-source however. These can be found over on GitHub.com/altMP . Plans to make more components of alt:V open-source in the future have already been made. Do I have to pay for more server slots? No! More server slots are currently, and will always be free. The only limit is the hardware which the server is running on. How can I contribute to alt:V? There are multiple ways, you can directly contribute to open source projects on GitHub.com/altMP or ask on our Discord . Another way would be to support us financially on Patreon . How can I get a token for Masterlist? You need to sign in Server Manager , create your server inside and copy token from \"Private token\" block. Is a token needed for development? No, a token isn't needed to develop on alt:V, the token is only needed to announce your server on Masterlist or to test cloud auth. I have problems with pirate game copy & alt:V? We don't support pirate copy of the game. You can buy a license copy in game stores like Steam, Epic Games or Rockstar Games Launcher.","lang":""},"articles/index.html":{"type":"article","href":"articles/index.html","title":"General","keyword":"General The documentation for the alt:V related unassigned things. Overview F.A.Q. Read most asked questions by the community. Troubleshooting Read about possible fixes for your problem. Changelogs Read about upcoming changes.","lang":""},"articles/logging.html":{"type":"article","href":"articles/logging.html","title":"Logging in alt:V","keyword":"Logging in alt:V This article will explain the usage of logging in alt:V. It will explain the concept of logging, the different types of logging and how to use logging in alt:V. What is logging used for As a programmer, logging is very important for debugging and showing information. By logging to the console, you can check the values of variables etc. at runtime to find your bug or optimize your code. Important things to know about logging Don't use logging in production too much, because it can lag the console and will also hide the important logs you have placed. It is best to completely disable logging on the client in the production, and setting logging to the bare minimum (e.g. only errors) on the server. Also don't put any sensitive information into your logs, the logs get saved to a file in plain text, so logging e.g. a password to the console is a big security risk. When and how to use logging There are different types of logging, which should be used for different kinds of logs. You can see a table of the different types of logs here: Type Usage Infos To display general information about something Warnings To display something maybe being wrong, but not being very important Errors To display something going very wrong, which needs immediate action Using colors in logs If you want to make your log messages look better, you can use different color codes to highlight important parts of the message. Or to group/categorize your logs better. The color codes can be used by appending a color code, like this for example: ~r~ , before your part of the text that should have that color. You can see a list of all color codes in the table below: Color code Screenshot ~k~ ~r~ ~g~ ~b~ ~y~ ~m~ ~c~ ~w~ ~lk~ ~lr~ ~lg~ ~lb~ ~ly~ ~lm~ ~lc~ ~lw~ Using logs in your code Here you can find small examples in the different programming languages alt:V offers on how to use logging: Javascript C# alt.log(\"~r~Hello ~g~World!\"); alt.logWarning(\"This is a warning\"); alt.logError(\"This is an error\"); ColoredMessage coloredMessage = new ColoredMessage(); coloredMessage += TextColor.Red; coloredMessage += \"Hello \"; coloredMessage += TextColor.Green; coloredMessage += \"World!\"; Alt.LogColored(coloredMessage); Alt.LogWarning(\"This is a warning\"); Alt.LogError(\"This is an error\"); Alt.LogInfo(\"This is an info\"); Alt.LogDebug(\"This is a debug message\");","lang":""},"articles/marker.html":{"type":"article","href":"articles/marker.html","title":"Marker API","keyword":"Marker API Since alt:V Update 15 there are classes for creating client side markers. These client side markers are easier to create and use, as they are automatically streamed on client side. Markers are symbols in 3D space that can be used to visually mark specific positions. Warning Nearest created markers are automatically streamed to the player as soon as they get near the defined streaming distance. For performance reason markers are currently limited to 2000 streamed in at the same time. Usage Marker class in JS API reference Marker class in C# API reference The look of an marker is defined by its type, see MarkerTypes for all available types. Example // Create green rotating dollar sign marker const marker = new alt.Marker(29, new alt.Vector3(0, 0, 71), new alt.RGBA(0, 128, 0, 255)); marker.rotate = true; Example of a streamed marker which is only visible if you get in 100.0 of coordinate range. const marker = new alt.Marker(29, new alt.Vector3(0, 0, 71), new alt.RGBA(0, 128, 0, 255), true, 100.0);","lang":""},"articles/master_list_api.html":{"type":"article","href":"articles/master_list_api.html","title":"Master list API","keyword":"Master list API The master list api allow you to fetch data from the alt:V master list service. Information GET only Return JSON Object If abused you can be banned from using the API API Links URL Description https://api.alt-mp.com/servers/info Statistics - Player Count across all servers & The amount of servers online https://api.alt-mp.com/servers Servers - All information known about all servers (Name, Description, IP, Language, Website, Etc.) https://api.alt-mp.com/servers/SERVERID Specific Server - Filters server list for a specific one. Uses \"id\" which is unique to the server token https://api.alt-mp.com/servers/SERVERID/avg/TIME Averages - Returns averages data about the specified server (TIME = 1d, 7d, 31d) https://api.alt-mp.com/servers/SERVERID/max/TIME Maximum - Returns maximum data about the specified server (TIME = 1d, 7d, 31d) Response example Statistics { \"ServersCount\": 64, \"playersCount\": 1582 } Server list It's a fragment of API's response. [ { \"id\":\"ceaac3d1cc22761223beac38386f5ab2\", \"maxPlayers\":128, \"players\":0, \"name\":\"Simple Freeroam Server | by PlebMasters.de\", \"locked\":false, \"host\":\"116.203.227.203\", \"port\":7791, \"gameMode\":\"Freeroam\", \"website\":\"discord.gg/86uqkqc\", \"language\":\"en\", \"description\":\"A simple game mode to test the performance of alt:V, but also to move freely around the map without any rules.\", \"verified\":false, \"promoted\":false, \"useEarlyAuth\":false, \"earlyAuthUrl\":\"\", \"useCdn\":false, \"cdnUrl\":\"\", \"useVoiceChat\":false, \"tags\": [ \"No Rules\", \"All Weapons\", \"All Vehicles\" ], \"bannerUrl\":null, \"branch\":\"release\", \"build\":1181, \"lastUpdate\":1596840894273 } ] Specific server { \"active\":true, \"info\":{ \"id\":\"ceaac3d1cc22761223beac38386f5ab2\", \"maxPlayers\":128, \"players\":0, \"name\":\"Simple Freeroam Server | by PlebMasters.de\", \"locked\":false, \"host\":\"144.91.81.134\", \"port\":7791, \"gameMode\":\"Freeroam\", \"website\":\"discord.gg/86uqkqc\", \"language\":\"en\", \"description\":\"A simple game mode to test the performance of alt:V, but also to move freely around the map without any rules.\", \"verified\":false, \"promoted\":false, \"useEarlyAuth\":false, \"earlyAuthUrl\":\"\", \"useCdn\":false, \"cdnUrl\":\"\", \"useVoiceChat\":false, \"tags\":[ \"No Rules\", \"All Weapons\", \"All Vehicles\", \"Enabled Cayo Perico\" ], \"bannerUrl\":null, \"branch\":\"release\", \"build\":-1, \"version\":\"2.8\", \"lastUpdate\":1612571971068 } } Average / Maximum [ { \"t\":1612562230,\"c\":4 }, { \"t\":1612562280,\"c\":4 }, { \"t\":1612562341,\"c\":4 } ] Description: t = Timestamp in UTC, c = Player Count. altstats.net - alt:V Stats API (Unofficial) altstats.net - alt:V Stats is a alternative server list, developed and supported by members of the altMP Team. It has additional statistics about servers like player count for the last 24 hours, 7 days or month and you have a server specific API. Features like showing the player count for the last month are premium features, you need to pay for them to enable them. Information GET only Return JSON Object If abused you can be banned from using the API API can change anytime without notice API Links URL Description https://api.altstats.net/api/v1/master Count - Shows the server and player count for the last 24 hours https://api.altstats.net/api/v1/server Servers - Basic information about all known servers https://api.altstats.net/api/v1/server/serverID Specific Server - Lists you all information about a server Response example Count [ { \"ServerCount\": 72, \"PlayerCount\": 958, \"TimeStamp\": \"2021-01-01T12:15:00.464Z\" }, { \"ServerCount\": 73, \"PlayerCount\": 945, \"TimeStamp\": \"2021-01-01T12:10:00.465Z\" }, { \"others\": \"...\" } ] Servers [ { \"others\": \"...\" }, { \"id\": 330, \"name\": \"Simple Freeroam Server | by PlebMasters.de\", \"locked\": 0, \"playerCount\": 1, \"slots\": 128, \"gameMode\": \"Freeroam\", \"language\": { \"full\": \"English\", \"short\": \"gb\" }, \"official\": 0, \"verified\": 0, \"promoted\": 0, \"tags\": [ \"No Rules\", \"All Weapons\", \"All Vehicles\", \"Enabled Cayo Perico\" ] }, { \"others\": \"...\" } ] Specific server { \"Id\": 330, \"FoundAt\": \"2020-01-01T12:41:21.433Z\", \"LastActivity\": \"2021-01-01T12:00:19.364Z\", \"Visible\": true, \"ServerId\": \"ceaac3d1cc22761223beac38386f5ab2\", \"Players\": 1, \"Name\": \"Simple Freeroam Server | by PlebMasters.de\", \"Locked\": false, \"Ip\": \"144.91.81.134\", \"Port\": 7791, \"MaxPlayers\": 128, \"Ping\": 0, \"Website\": \"discord.gg/86uqkqc\", \"Language\": \"English\", \"Description\": \"A simple game mode to test the performance of alt:V, but also to move freely around the map without any rules.\", \"LastUpdate\": 1609502415186, \"IsOfficial\": false, \"PlayerRecord\": 34, \"PlayerRecordDate\": \"2020-07-01T14:15:07.388Z\", \"LastFetchOnline\": true, \"LanguageShort\": \"gb\", \"GameMode\": \"Freeroam\", \"Branch\": \"release\", \"Build\": -1, \"CdnUrl\": \"\", \"EarlyAuthUrl\": \"\", \"Verified\": false, \"UseCdn\": false, \"UseEarlyAuth\": false, \"BannerUrl\": null, \"Promoted\": false, \"Tags\": [ \"No Rules\", \"All Weapons\", \"All Vehicles\", \"Enabled Cayo Perico\" ], \"UseVoiceChat\": false, \"Level\": 3, \"Version\": \"2.2\" }","lang":""},"articles/meta_data.html":{"type":"article","href":"articles/meta_data.html","title":"Meta data","keyword":"Meta data Meta data can be used to pass specific values between server & client (also called synced meta or local meta) or between resources (global meta) and bind them to an entity or the respective side (server or client). For example, the username of a player can be bound to it or the status of a siren to a vehicle (synced metas). Likewise, data such as the current weather can also be bound to a resource as a meta so that other resources can query this value (global meta). These topics will be discussed in more detail in the respective subsections. Types Overview Type Used on Availability (Set) Availability (Get) Description Meta Entities, Alt Client & Server Client & Server The data is only available on the client or server side, depending on where it has been set. Local Meta Player Server Client & Server The data is settable has to be set on a player. Only the client it has been set to can fetch the data. (Global) Synced Meta Entities, Alt Server Client & Server The data is settable on every entity (player & vehicle). Every client can fetch the data. Stream Synced Meta Entities Server Client & Server This is similar to the synced meta, but the data gets only transferred when the entity is in streaming range of the client fetching the data. Usage A meta is set by using the method setMeta on the class alt or an entity (player or vehicle). The meta is only available on the same side that it has been set and can be fetched by all resources. JS TS C# Applying a global meta // Set a global meta (single-sided, cross-resource) with a given key and value alt.setMeta(\"metaKey\", \"metaValue\"); // Check if the meta is set and log the result if (alt.hasMeta(\"metaKey\")) { alt.log(\"Meta is set\"); } else { alt.log(\"Meta isn't set\"); } // Fetch and save the value of the meta const metaValue = alt.getMeta(\"metaKey\"); // Delete the meta alt.deleteMeta(\"metaKey\"); Applying a global meta bound to a entity alt.on(\"playerConnect\", (player) => { // Set a player meta (single-sided, cross-resource) with a given key and value player.setMeta(\"username\", player.name); // Check if the meta is set and log the result if (player.hasMeta(\"username\")) { alt.log(\"Meta is set\"); } else { alt.log(\"Meta isn't set\"); } // Fetch and save the value of the meta const metaValue = player.getMeta(\"username\"); // Delete the meta player.deleteMeta(\"metaKey\"); }); Listening for global meta changes alt.on(\"globalMetaChange\", (key, newValue, oldValue) => { // This event gets called when a meta changes which is applied to alt // You can also check it yourself by using the alt.hasMeta & alt.getMeta methods if (alt.hasMeta(\"metaKey\")) { const metaValue = alt.getMeta(\"metaKey\"); // } }); Meta declaration in the interface (can be added to .ts or .d.ts file) declare module \"alt-shared\" { // extending interface by interface merging export interface ICustomGlobalMeta { metaKey: string } } The usage is the same as in JS: Server & Client const metaValue /* string | undefined */ = alt.getMeta(\"metaKey\"); Applying a global meta // Set a global meta (single-sided, cross-resource) with a given key and value Alt.SetMetaData(\"metaKey\", \"metaValue\"); // Check if the meta is set and log the result if (Alt.HasMetaData(\"metaKey\")) { Alt.Log(\"Meta is set\"); } else { Alt.Log(\"Meta isn't set\"); } // Fetch and save the value of the meta // When using C# it is required to pass the type of the meta value var valueIsFetched = Alt.GetMetaData(\"metaKey\", out var metaData); // Delete the meta Alt.DeleteMetaData(\"metaKey\"); Applying a global meta bound to a entity Alt.OnPlayerConnect += (player, reason) => { // Set a player meta (single-sided, cross-resource) with a given key and value player.SetMetaData(\"username\", player.Name); // Check if the meta is set and log the result if (player.HasMetaData(\"username\")) { Alt.Log(\"Meta is set\"); } else { Alt.Log(\"Meta isn't set\"); } // Fetch and save the value of the meta // When using C# it is required to pass the type of the meta value var valueIsFetched = player.GetMetaData(\"username\", out var metaData); // Delete the meta player.DeleteMetaData(\"metaKey\"); }; Listening for entity meta changes Alt.OnMetaDataChange += (entity, key, value) => { // This event gets called when a meta changes which is applied to a entity // You can also check it yourself by using the entity.HasMetaData & entity.GetMetaData methods if (entity.HasMetaData(\"metaKey\")) { var valueIsFetched = entity.GetMetaData(\"metaKey\", out var metaValue); // } }; Local Meta A local meta is always set to a player instance and can only be modified on server-side. This data is accessible from all resources, but on the client side only from the respective player on which the meta was set. JS TS C# Server Applying a local meta bound to a entity alt.on(\"playerConnect\", (player) => { // Set a player local meta (set by server, synced to server & client, cross-resource) with a given key and value player.setLocalMeta(\"username\", player.name); // Check if the local meta is set and log the result if (player.hasLocalMeta(\"username\")) { alt.log(\"Meta is set\"); } else { alt.log(\"Meta isn't set\"); } // Fetch and save the value of the local meta const metaValue = player.getLocalMeta(\"username\"); // Delete the meta (only available on server) player.deleteLocalMeta(\"username\"); }); Listening for local meta changes alt.on(\"localMetaChange\", (player, key, newValue, oldValue) => { // This event gets called when a local meta changes // You can also check it yourself by using the player.hasLocalMeta & player.getLocalMeta methods if (player.hasLocalMeta(\"metaKey\")) { const metaValue = player.getLocalMeta(\"metaKey\"); // } }); Client Checking if a local meta is set alt.on(\"spawned\", () => { // Check if the local meta is set if (alt.hasLocalMeta(\"username\")) { alt.log(\"Meta is set\"); } else { alt.log(\"Meta isn't set\"); return; } // Fetch and save the value of the local meta const metaValue = alt.getLocalMeta(\"username\"); }); Listening for local meta changes alt.on(\"localMetaChange\", (key, newValue, oldValue) => { // This event gets called when a local meta changes // You can also check it yourself by using the alt.hasLocalMeta & alt.getLocalMeta methods if (alt.hasLocalMeta(\"metaKey\")) { const metaValue = alt.getLocalMeta(\"metaKey\"); // } }); Meta declaration in the interface (can be added to .ts or .d.ts file) declare module \"alt-shared\" { // extending interface by interface merging export interface ICustomPlayerLocalMeta { username: string } } The usage is the same as in JS: Server const metaValue /* string | undefined */ = player.getLocalMeta(\"username\"); Client const metaValue /* string | undefined */ = alt.getLocalMeta(\"username\"); Server Applying a local meta bound to a entity Alt.OnPlayerConnect += (player, reason) => { // Set a player local meta (set by server, synced to server & client, cross-resource) with a given key and value player.SetLocalMetaData(\"username\", player.Name); // Check if the local meta is set and log the result if (player.HasLocalMetaData(\"username\")) { Alt.Log(\"Meta is set\"); } else { Alt.Log(\"Meta isn't set\"); } // Fetch and save the value of the local meta // When using C# it is required to pass the type of the meta value var valueIsFetched = player.GetLocalMetaData(\"username\", out var metaData); // Delete the meta player.DeleteLocalMetaData(\"username\"); }; Synced Meta A synced meta is distributed to all resources & clients and can be used in the following ways: Global (applied to alt) Bound to an entity (applied to a player or vehicle) JS TS C# Server Applying a global synced meta // Set a global synced meta (server & client, cross-resource) with a given key and value alt.setSyncedMeta(\"metaKey\", \"metaValue\"); // Check if the meta is set and log the result if (alt.hasSyncedMeta(\"metaKey\")) { alt.log(\"Meta is set\"); } else { alt.log(\"Meta isn't set\"); } // Fetch and save the value of the meta const metaValue = alt.getSyncedMeta(\"metaKey\"); // Delete the meta alt.deleteSyncedMeta(\"metaKey\"); Applying a global synced meta bound to a entity alt.on(\"playerConnect\", (player) => { // Set a synced meta (server & client, cross-resource) with a given key and value player.setSyncedMeta(\"metaKey\", \"metaValue\"); // Check if the meta is set and log the result if (player.hasSyncedMeta(\"metaKey\")) { alt.log(\"Meta is set\"); } else { alt.log(\"Meta isn't set\"); } // Fetch and save the value of the meta const metaValue = player.getSyncedMeta(\"metaKey\"); }); Listening for synced meta changes alt.on(\"syncedMetaChange\", (entity, key, newValue, oldValue) => { // This event gets called when a synced meta changes which is applied to an entity // You can also check it yourself by using the entity.hasSyncedMeta(key) method if (entity.hasSyncedMeta(\"metaKey\")) { const metaValue = entity.getSyncedMeta(\"metaKey\"); // } }); Client Checking if global synced meta is set alt.on(\"spawned\", () => { // Check if the global synced meta is set if (alt.hasSyncedMeta(\"metaKey\")) { alt.log(\"Meta is set\"); } else { alt.log(\"Meta isn't set\"); } // Fetch and save the value of the meta const metaValue = alt.getSyncedMeta(\"metaKey\"); }); Listening for global synced meta changes alt.on(\"globalSyncedMetaChange\", (key, newValue, oldValue) => { // This event gets called when a synced meta changes which is applied to alt // You can also check it yourself by using the alt.hasSyncedMeta(key) method if (alt.hasSyncedMeta(\"metaKey\")) { const metaValue = alt.getSyncedMeta(\"metaKey\"); // } }); Listening for synced meta changes alt.on(\"syncedMetaChange\", (entity, key, newValue, oldValue) => { // This event gets called when a synced meta changes which is applied to an entity // You can also check it yourself by using the entity.hasSyncedMeta(key) method if (entity.hasSyncedMeta(\"metaKey\")) { const metaValue = entity.getSyncedMeta(\"metaKey\"); // } }); Meta declaration in the interface (can be added to .ts or .d.ts file) declare module \"alt-shared\" { // extending interface by interface merging export interface ICustomGlobalSyncedMeta { globalMetaKey: string } export interface ICustomPlayerSyncedMeta { playerMetaKey: string } } The usage is the same as in JS: Server & Client const globalMetaValue /* string | undefined */ = alt.getSyncedMeta(\"globalMetaKey\"); const playerMetaValue /* string | undefined */ = player.getSyncedMeta(\"playerMetaKey\"); Server Applying a global meta Alt.OnPlayerConnect += (player, reason) => { // Set a player local meta (set by server, synced to server & client, cross-resource) with a given key and value player.SetLocalMetaData(\"username\", player.Name); // Check if the local meta is set and log the result if (player.HasLocalMetaData(\"username\")) { Alt.Log(\"Meta is set\"); } else { Alt.Log(\"Meta isn't set\"); } // Fetch and save the value of the local meta // When using C# it is required to pass the type of the meta value var valueIsFetched = player.GetLocalMetaData(\"username\", out var metaData); // Delete the meta player.DeleteMetaData(\"username\"); }; Stream Synced Meta A synced meta is distributed to all resources & clients and can be used bound to an entity. It is basically the same as a synced meta, but only gets send to clients in the streaming range of the entity. JS TS C# Server Applying a stream synced meta bound to a entity alt.on(\"playerConnect\", (player) => { // Set a stream synced meta (server & client, cross-resource) with a given key and value player.setStreamSyncedMeta(\"metaKey\", \"metaValue\"); // Check if the meta is set and log the result if (player.hasStreamSyncedMeta(\"metaKey\")) { alt.log(\"Meta is set\"); } else { alt.log(\"Meta isn't set\"); } // Fetch and save the value of the meta const metaValue = player.getStreamSyncedMeta(\"metaKey\"); // Delete the meta player.deleteStreamSyncedMeta(\"metaKey\"); }); Listening for stream synced meta changes alt.on(\"streamSyncedMetaChange\", (entity, key, newValue, oldValue) => { // This event gets called when a stream synced meta changes which is applied to an entity // You can also check it yourself by using the entity.hasStreamSyncedMeta(key) method if (entity.hasStreamSyncedMeta(\"metaKey\")) { const metaValue = entity.getStreamSyncedMeta(\"metaKey\"); // } }); Client Listening for stream synced meta changes (basically the same as on the server side) alt.on(\"streamSyncedMetaChange\", (entity, key, newValue, oldValue) => { // This event gets called when a stream synced meta changes which is applied to an entity // You can also check it yourself by using the entity.hasStreamSyncedMeta(key) method if (entity.hasStreamSyncedMeta(\"metaKey\")) { const metaValue = entity.getStreamSyncedMeta(\"metaKey\"); // } }); Meta declaration in the interface (can be added to .ts or .d.ts file) declare module \"alt-shared\" { // extending interface by interface merging // alt.Player and alt.Vehicle export interface ICustomEntityStreamSyncedMeta { entityMetaKey: string } // only alt.Player export interface ICustomPlayerStreamSyncedMeta { playerMetaKey: number } // only alt.Vehicle export interface ICustomVehicleStreamSyncedMeta { vehicleMetaKey: boolean } } The usage is the same as in JS: Server & Client const entityMetaValue /* string | undefined */ = entity.getSyncedMeta(\"entityMetaKey\"); const playerMetaValue /* number | undefined */ = player.getSyncedMeta(\"playerMetaKey\"); const vehicleMetaValue /* boolean | undefined */ = vehicle.getSyncedMeta(\"vehicleMetaKey\"); Server Applying a stream synced meta bound to a entity Alt.OnPlayerConnect += (player, reason) => { // Set a stream synced meta (set by server, synced to server & client, cross-resource) with a given key and value player.SetStreamSyncedMetaData(\"username\", player.Name); // Check if the stream synced meta is set and log the result if (player.HasStreamSyncedMetaData(\"username\")) { Alt.Log(\"Meta is set\"); } else { Alt.Log(\"Meta isn't set\"); } // Fetch and save the value of the stream synced meta // When using C# it is required to pass the type of the meta value var valueIsFetched = player.GetStreamSyncedMetaData(\"username\", out var metaData); // Delete the meta player.DeleteStreamSyncedMetaData(\"username\"); }; Remarks Warning The meta change events are only called if the (new) data is not yet known to the client. If this data is already known, it must be queried & processed independently, for example via the gameEntityCreate event. Let's take the example case of a streamSyncedMeta with the key trackWidth , which sets the track width of a vehicle. The event streamSyncedMetaChange is only called here if the client does not yet know this value. If you now leave the streaming range and then return to it, the vehicle is created, but no 'streamSyncedMetaChange' event is triggered. To ensure that the values are always applied, the gameEntityCreate event must also be used. Here is an example: Server Client const vehicle = new alt.Vehicle(\"t20\", 0, 0, 72, 0, 0, 0); vehicle.setStreamSyncedMeta(\"trackWidth\", 0.85); // This is called when the meta is communicated to the client for the first time alt.on(\"streamSyncedMetaChange\", (entity, key, newValue, oldValue) => { if (key === \"trackWidth\") setTrackWidth(entity, newValue); }); // This is called as soon as the vehicle is created on the client // Here we check if the vehicle has the meta and if so process it alt.on(\"gameEntityCreate\", (entity) => { if (entity.hasStreamSyncedMeta(\"trackWidth\")) { const trackWidth = entity.getStreamSyncedMeta(\"trackWidth\"); setTrackWidth(entity, trackWidth); } }); // If applicable, the `gameEntityDestroy` event can be used to undo changes that should only exist as long as the entity exists. alt.on(\"gameEntityDestroy\", (entity) => { // Remove meta changes for example }); // To avoid duplicating the code in both events we move it to its own function function setTrackWidth(entity, trackWidth) { for (let i = 0; i < entity.wheelsCount; i++) { entity.setWheelTrackWidth(i, trackWidth); } }","lang":""},"articles/object.html":{"type":"article","href":"articles/object.html","title":"Object API","keyword":"Object API Since alt:V Update 15 you are able to create server side streamed & synchronized objects. These server side created objects are dynamic and will be synced with full physics to all players near. Warning Only use them when physics are necessary, as they can significantly impact your server performance and overall traffic. Use client side created LocalObject for static objects that don't need any physics to be synced across near players. LocalObject class in JS API reference LocalObject class in C# API reference With default server configuration, up to 120 of the closest objects are streamed at the same time. The max streaming values can be edited in the server configuration. See server configuration [maxStreaming] section. Tip See Pleb Masters: Forge for a full list of all objects. Usage Object class in JS API reference Object class in C# API reference Example // Create physics synchronized soccer ball let object = new alt.Object(\"p_ld_soc_ball_01\", new alt.Vector3(0,0,71), new alt.Vector3(0,0,0));","lang":""},"articles/parachute_sync.html":{"type":"article","href":"articles/parachute_sync.html","title":"Parachute sync","keyword":"Parachute sync Since v15 alt:V has parachute sync. How to use Object sync is disabled by default, in order to enable it add two event listeners to your code, in JS there are clientDeleteObject and clientRequestObject . JS example alt.on(\"clientRequestObject\", (player, model, position) => { alt.log(\"Client:\", player.name, \"requesting object:\", model, position); // you can cancel it if needed // return false; }); alt.on(\"clientDeleteObject\", (player) => { alt.log(\"Client:\", player.name, \"deleting object\"); // this one is also cancellable // return false; });","lang":""},"articles/ped.html":{"type":"article","href":"articles/ped.html","title":"Ped API","keyword":"Ped API Since alt:V Update 15 you are able to create server side streamed & synchronized peds, often also referred as NPCs. These server side created peds can be controlled by assigning tasks to them on client side, which will then automatically be in sync with all players near. Warning These peds won't move and drive on their own, they need tasks assigned on client side to actually do something. For GTA Online similar behaviour, you will have to implement the logic on your own. With default server configuration, up to 128 of the closest peds are streamed at the same time. The max streaming values can be edited in the server configuration. Warning Streamer entity pool of peds is the same used for streaming players. Regardless whether a ped is a NPC or player, the closest one will be streamed first. See server configuration [maxStreaming] section. Tip See Pleb Masters: Forge for a full list of all peds. Usage Ped class in JS API reference Ped class in C# API reference Example //working example //////////////////// //SERVERSIDE: //////////////////// alt.on(\"playerConnect\", (player) => { //spawn your own player player.spawn(7.904539108276367, 28.82634925842285, 70.866943359375, 0); //create serverside NPC (posX, posY, posZ, rotX, rotY, rotZ, steamingDistance) let ped = new alt.Ped(\"u_m_m_streetart_01\", new alt.Vector3(9.717802047729492, 26.340801239013672, 70.81243896484375), new alt.Vector3(0, 0, 0), 200); //its important to wait until Ped is ready alt.setTimeout(() => { //then u set the netOwner ped.setNetOwner(alt.Player.all[0]); //then u emit the netOwner the walkaround task (server -> client) ped.netOwner.emit(\"ped_task\", ped); }, 2500); }); //////////////////// //CLIENTSIDE: //////////////////// alt.onServer(\"ped_task\", (ped) => { //just a debug message for the info if event is called alt.log(`ped_task taskWanderInArea was called for pedID: ${ped.scriptID}`); // Make the specified ped roam within a 10-meter radius of the given coordinates. It will always move to a random location inside the radius, while waiting a minimum of 2 and maximum of 10 seconds before moving. //taskWanderInArea: ped: Ped | x: float | y: float | z: float | radius: float | minimalLength: float | timeBetweenWalks: float native.taskWanderInArea(ped, 9.717802047729492, 26.340801239013672, 70.81243896484375, 10, 2, 10); }); Local Ped API Its also possible to create local (clientside only) peds that other players won't see. Usage LocalPed class in JS API reference LocalPed class in C# API reference Example Clothes shop preview. // We don't need streaming enabled // because we need to use ped immediately const useStreaming = false; const player = alt.Player.local; const ped = new alt.LocalPed(player.model, player.dimension, player.pos, player.rot, useStreaming); // More on that below alt.Utils.assert(ped.scriptID !== 0); // Copying appearance, clothes etc. of player to the ped native.clonePedToTarget(player, ped); // Now we can change clothes of ped alt.setPedDlcClothes(ped.scriptID, 0, 11, 1, 0); Warning It is important to note that the ped may not be spawned immediately due to model loading or streaming, in the above example the ped is spawned immediately (supposedly, that's why we have an alt.Utils.assert ) because the player model is already loaded and streaming is disabled. Waiting for ped to spawn due to model loading and streaming. const model = \"player_zero\"; const dimension = alt.defaultDimension; // 0 dimension const pos = new alt.Vector3(0, 0, 71); const rot = alt.Vector3.zero; const useStreaming = true; const ped = new alt.LocalPed(model, dimension, pos, rot, useStreaming); // Waiting until ped spawns for 5 seconds or rejecting current promise // (timeout value is not required, 2 seconds by default in v15) await ped.waitForSpawn(5000); // ped.scripID is now valid and we can use it alt.setPedDlcClothes(ped.scriptID, 0, 11, 1, 0);","lang":""},"articles/permissions.html":{"type":"article","href":"articles/permissions.html","title":"Permissions System","keyword":"Permissions System Permissions are set on a resource-by-resource basis and have to be accepted by the user joining the server Permission Types Permission Description Screen Capture This allows a screenshot to be taken of the alt:V process (just GTA) and any webview WebRTC This allows peer-to-peer RTC inside JS Clipboard Access This allows to copy content to users clipboard Extended Voice API This allows to manually control voice, like activating of microphone, muting, etc. by the server Required vs Option Permissions Permissions can be either be optional or required. When they are optional, this will still allow the player to join the server if they don't agree to it however you will no longer have access to the features for which the permission covers. Required permissions behave differently in the fact that if the user does not accept them then they will be unable to access the server. required-permissions = [ \"Screen Capture\", \"WebRTC\", \"Clipboard Access\" ] optional-permissions = [ \"Screen Capture\", \"WebRTC\", \"Clipboard Access\" ] Tip To check if a user has approved the respective permission the method alt.getPermissionState can be used.","lang":""},"articles/resources.html":{"type":"article","href":"articles/resources.html","title":"Resources","keyword":"Resources Resources are one of the main parts of the alt:V server. They handle the data and gamescripts for server- and clientside used by the alt:V server. Resources are represented as a subfolder of the resources/ folder in the alt:V server root. resource.toml A resource (folder) is required to contain at minimum a resource.toml configuration file (except rpf resources, see rpf section below for more info). Depending on which resource type you are using, the properties you specify in the config file may differ between each other. A resource has a folder structure like this: resources/ [RESOURCE_NAME]/ resource.toml Keep in mind that this is only the minimum requirement for a resource to work. Each type has custom specifications. Types The following types are currently available: js This resource type is providing the ability to write gamescript in JavaScript on server- and clientside. For more information see: Getting Started csharp This resource type is providing the ability to write gamescript in C# on serverside and JavaScript on clientside. For more information see: Getting Started dlc This resource type is for providing modded content (eg Vehicles, MLOs, Clothes) to the client. You need a stream.toml to get this type to work. Since v15 this resource type also allows to replace GTA base files. See overrides below. stream.toml Key Description files Path to the files that are send to the client. meta Path to the meta files and the corresponding Data files (Format: [PATH = DATA_FILE_TAG]). gxt Path to the gxt files. overrides Game file mount path and path to the replacement (Format: [MOUNT_PATH = REPLACEMENT_PATH]) Replacements To override a file you need to first it's full mount path. Mount path is specified in format group:/path/to/file . See list of mounts . Example replacement: File structure: resources/ [RESOURCE_NAME]/ replaces/ water_empty.xml resource.toml stream.toml [overrides] 'commoncrc:/data/levels/gta5/water.xml' = 'replaces/water_empty.xml' asset-pack This resource type is to provide content to other resources (eg Pictures, Videos, WebPages, JSON files). This content can be provided througt multiple ways: Webview: http://assets/[packName]/filePath Javascript: import '@[packName]/filePath'; FileAPI: With @[packName] before the path. type = asset-pack client-files = [ ... ] rpf This resource type allows you to load .rpf DLC directly. All .rpf archives are loaded before game start, and therefore can load anything what normal singleplayer DLC can. resource.toml Key Description type rpf main Path to the .rpf file To simplify loading process, you can load rpf DLCs without creating resource.toml . Just create a resource folder and put a dlc.rpf file in it. Example: Download https://www.gta5-mods.com/maps/community-mission-row-pd/download/75282 Create server/resources/nice_police_mlo folder Copy /RageMP and SP/mrpd/dlc.rpf to nice_police_mlo folder Add nice_police_mlo to resources list in server.toml","lang":""},"articles/rmlui/debugging.html":{"type":"article","href":"articles/rmlui/debugging.html","title":"Debugging RmlUi","keyword":"Debugging RmlUi This article describes basic steps of how to debug RmlUi. Tip For debugging purposes the font rmlui-debugger-font can be used. This font doesn't has to be loaded but only contains a limited character set. Integrated debug tool To inspect an RmlUi document alt:V has an integrated debugging tool, which can be activated via the F8 Console with the command rmldebug . After entering the command, a bar with the following options will appear on the screen: Event Log Element Info Outlines Event Log In the event log the different log levels can be activated and deactivated. If errors occur on the part of RmlUi, they are displayed in this window. Element Info After activating the Element Info, an RmlUi element can be selected on the screen. On the right edge of the screen the respective properties of the element (Attributes, properties, events, ancestors and more) are displayed. Additionally there are buttons at the top of the screen, which can force different states (e.g. hover or focus) of the respective element. Outlines If the outlines are activated, all RmlUi elements are outlined with a red box.","lang":""},"articles/rmlui/index.html":{"type":"article","href":"articles/rmlui/index.html","title":"Getting Started","keyword":"Getting Started This is the documentation for getting started with RmlUi. Read Introduction to get a overview about RmlUi. Read Nametags for information on how to display nametags with RmlUi. Read Debugging for an introduction how to debug RmlUi.","lang":""},"articles/rmlui/introduction.html":{"type":"article","href":"articles/rmlui/introduction.html","title":"Introduction to RmlUi","keyword":"Introduction to RmlUi This article describes what RmlUi is and the benefits of using it. What is RmlUi RmlUi is a open-source , light-weight C++ library that supports XHTML1 and CSS2. Due to the direct implementation in the alt:V client as well as the lower function set, RmlUi has a much higher performance, which allows updates that take place every frame. Because of the fact that only CSS2 is supported, not all css functions are available. This may mean that existing CSS code for a CEF WebView might not work with RmlUi and may require customization. More information about this can be found in the RmlUi documentation . Comparison to CEF WebView Advantages lower resource consumption direct control by the alt:V client, resulting in: better performance higher update rate Disadvantages less functionality due to XHTML1 and CSS2 standards no support for UI frameworks (for example VueJS, React, Angular, ...) When to use RmlUi Due to the lower functionality and the lack of support for UI frameworks, the use of RmlUi is recommended only for simple sites or sites that benefit from a higher update rate. For example, the display of name tags which are positioned relative to the respective entity requires a high update rate which is not possible using a CEF WebView. Documentation The programming language specific documentation can be found under the respective module documentation: JavaScript RmlDocument RmlElement C# RmlDocument RmlElement","lang":""},"articles/rmlui/nametags.html":{"type":"article","href":"articles/rmlui/nametags.html","title":"Nametag example","keyword":"Nametag example This article deals with name tags as RmlUi example. All used files for this example can be found in the following repository . Requirements Some code editor (for example Visual Studio Code) Basic knowledge of HTML & CSS A font file (.ttf) Empty resource with Client subfolder and Client/main.js as entry point Creating the rml document Tip In this example arialbd.ttf is used as font, which can be found in the repository mentioned at the beginning. Creating an Rml document is relatively simple and, except for the leading tag and the XHTML1 standard, is no different from creating an .html file. We create the file index.rml in the Client subfolder and add the following content there: Demo
Creating the client script Tip Although JavaScript is used in this example, it can also be used with C# and other modules. Further information can be found in the respective modules documentation. After we have created our index.rml we create our script file named main.js in the same folder. In this file we put the following content, which will be described in more detail by the comments: import * as alt from \"alt-client\"; import * as native from \"natives\"; // ---------------- Config ---------------- // showVehicleIds: `true` vehicles will also have nametags containing their id // showPlayerIds: `true` player nametags will contain the id // showPlayerNames: `true` player nametags will contain their name // checkLoS: `true` line of sight is required to draw the nametags // dynamicSize: `true` size increases or decreases depending on the distance to the entity // controlKey: `79` toggle key for activating or deactivating the rml controls. 79 is the O key // // NOTE: For players either id, name or both settings have to be enabled, else there will no nametags be drawn const showVehicleIds = true; const showPlayerIds = true; const showPlayerNames = true; const checkLoS = true; const dynamicSize = true; const controlKey = 79; // --------------- Prototype -------------- // We use a custom prototype on the RmlElement to quickly check if its currently drawn or not alt.RmlElement.prototype.shown = false; // ---------------- Script ---------------- // All the code. More detailed instructions will be included to the lines // For rml you have to load the required font so it can be used alt.loadRmlFont(\"/Client/arialbd.ttf\", \"arial\", false, true); // Creating a new rml document. This is similar to creating a new WebView const document = new alt.RmlDocument(\"/Client/index.rml\"); // We're storing the nametag-container for further usage, e.g. adding and removing nametags const container = document.getElementByID(\"nametag-container\"); // We use a map to simplify the mapping of entity and RmlElement const nameTags = new Map(); // This variable will store the id of our everyTick, so we can disable it as soon as there are no nametags to draw let tickHandle = undefined; // We will use the gameEntityCreate event to add new nametags to our container alt.on(\"gameEntityCreate\", (entity) => { // Create a