background image
Game Servers 380 7 Days to Die 4 Abiotic Factor 2 Aloft 2 alt:V 2 Americas Army Proving Grounds 2 Among Us 2 Archean 2 ARK Survival Ascended 6 ARK Survival Evolved 3 Arma 3 3 Arma Reforger 2 Aska 2 AssaultCube 2 Assetto Corsa 3 Astro Colony 2 Astroneer 2 Automobilista 2 2 Avorion 2 Banana Shooter 2 Barotrauma 3 BATTALION Legacy 2 BeamNG.drive (BeamMP) 2 Black Mesa 2 Brickadia 2 Call of Duty 2 Citadel: Forged with Fire 2 ClassiCube 2 Clone Hero 2 Colony Survival 2 Conan Exiles 4 Contagion 2 Core Keeper 2 Counter-Strike 2 3 Craftopia 2 CryoFall 2 CS2D 2 Cube 2: Sauerbraten 2 Cubic Odyssey 2 DayZ 4 DDNet 2 DDRaceNetwork 2 Dead Matter 2 Dont Starve Together 4 Eco 2 Empyrion Galactic Survival 2 Enshrouded 3 Escape from Tarkov 2 Euro Truck Simulator 2 2 Factorio 2 Farming Simulator 25 2 Fistful of Frags 2 FiveM 3 FortressCraft Evolved 2 Foundry 2 Foundry VTT 2 Frozen Flame 2 FTL Tachyon 2 Garrys Mod 3 Ground Branch 2 Half-Life 2 Deathmatch 2 Hogwarp 2 Holdfast: Nations at War 2 HumanitZ 2 Hurtworld 2 Hytale 1 Icarus 2 Insurgency Sandstorm 2 IOSoccer 2 Just Cause 3 Multiplayer 2 Kerbal Space Program 2 Killing Floor 2 3 LeagueSandbox 2 Left 4 Dead 2 Left 4 Dead 2 3 Longvinter 2 Los Angeles Crimes 2 Medal of Honor 2 Midnight Ghost Hunt 2 Mindustry 2 Minecraft 4 Minetest 2 Modiverse 2 Mordhau 3 Mount & Blade II: Bannerlord 2 Myth of Empires 2 Nazi Zombies Portable 2 Necesse 2 NeosVR 2 Neverwinter Nights EE 2 Night of the Dead 2 Nightingale 2 No Love Lost 2 No More Room in Hell 2 No One Survived 2 Nova-Life Amboise 2 Nuclear Option 2 Onset 2 Open Fortress 2 OpenArena 2 OpenRA 2 OpenRCT2 2 OpenTTD 2 Operation Harsh Doorstop 2 Palworld 3 Path of Titans 2 Pavlov VR 3 PixARK 2 Plains of Pain 2 Portal Knights 2 Post Scriptum 2 Project Zomboid 8 Puck 2 Quake Live 2 R5Reloaded 2 RedM 2 Renown 2 Resonite 2 Return to Moria 2 Rimworld Together 2 Rising World 2 Risk of Rain 2 1 Rust 4 Satisfactory 1 SCP Secret Laboratory 3 SCUM 2 Smalland 2 Solace Crafting 2 Soldat 2 Soldat 2 2 Sonic Robo Blast 2 2 Sons of the Forest 2 Soulmask 2 SourceCoop 2 Space Engineers 3 Space Station 14 2 Squad 3 Starbound 3 StarMade 2 Stationeers 2 Stormworks 2 Subnautica Nitrox 2 Sunkenland 2 SuperTuxKart 2 Sven Co-op 2 Swords 'n Magic and Stuff 2 Team Fortress 2 3 Teeworlds 2 Terraria 3 TerraTech Worlds 2 TF2 Classified 2 The Forest 3 The Front 2 The Isle 2 Tower Unite 2 Trackmania 2 Unturned 4 Urban Terror 2 V Rising 3 Valheim 3 VEIN 2 Veloren 2 Vintage Story 3 Voyagers of Nera 2 Wolfenstein: Enemy Territory 2 Wreckfest 2 Wurm Unlimited 2 Xonotic 2 Zandronum 2 Getting Started 2 Network & Connectivity 1 Server Management 2
التصنيفات

alt:V Admin and Resource Setup

altv gta-v admin resources scripts 0 وجدوا هذا المقال مفيداً

This guide covers resource development, database setup, admin tools, player management, vehicle and weapon management, and troubleshooting for your alt:V server on Legion Hosting. For initial server setup, server.toml configuration, and connection instructions, see alt:V Server Setup Guide.

Server Panel: All server management is done through GPanel at gpanel.legionhosting.net. File management can be done through the Files tab or via SFTP. See How to Upload Files via SFTP for SFTP instructions.

Admin Setup

alt:V does not have a built-in admin system. Admin functionality is implemented through resources (scripts) that you create or install. Most gamemodes implement their own admin system with permission levels, roles, and admin commands.

Common Admin Approaches

  • Database-backed roles: Most roleplay and gamemode frameworks store admin roles in a database. Admins are assigned roles (e.g., moderator, admin, superadmin) that grant different permission levels.
  • Config-based admins: Simpler setups may use a configuration file listing admin Steam IDs or alt:V IDs with their permission levels.
  • Console commands: The GPanel server console always has full access. You can write server-side scripts that accept console input for admin operations.

Setting Up an Admin Resource

  1. Choose or develop an admin resource that fits your gamemode.
  2. Upload the resource to the resources/ directory via the Files tab or SFTP.
  3. Add the resource name to the resources array in server.toml.
  4. Configure the admin resource (set your admin Steam/alt:V IDs, permission levels, etc.).
  5. Restart the server.
Community frameworks: Many alt:V gamemode frameworks (such as athena, rebar, and others) come with built-in admin panels and permission systems. Using an established framework saves significant development time.

Resource System

Resources are the core building blocks of alt:V servers. Each resource is a self-contained module that can contain server-side code, client-side code, or both. Resources are written in JavaScript, TypeScript, or C#.

Resource Structure

resources/
  my-resource/
    resource.toml         <-- Resource configuration (required)
    server/
      index.js            <-- Server-side entry point
      utils.js            <-- Additional server-side files
    client/
      index.js            <-- Client-side entry point (runs in player's GTA V)
    shared/
      config.js           <-- Shared code accessible by both server and client

resource.toml Configuration

type = "js"
main = "server/index.js"
client-main = "client/index.js"
client-files = ["client/*"]
deps = ["chat"]

Fields: type (js or csharp), main (server-side entry point), client-main (client-side entry point, runs in player's GTA V), client-files (files to send to client, supports globs), deps (other resources to load first).


Installing Resources

To install a pre-built resource on your server:

  1. Download the resource files (typically a folder containing resource.toml and script files).
  2. Stop your server in GPanel.
  3. Upload the resource folder to resources/ via the Files tab or SFTP.
  4. Add the resource folder name to the resources array in server.toml:
resources = ["existing-resource", "new-resource"]
  1. If the resource has dependencies, ensure those are also installed and listed.
  2. Configure the resource according to its documentation (config files, database setup, etc.).
  3. Start the server. Check the console for resource loading messages and any errors.

Removing a Resource

  1. Stop your server.
  2. Remove the resource name from the resources array in server.toml.
  3. Optionally delete the resource folder from resources/.
  4. Start the server.
Check dependencies: Removing a resource that other resources depend on will cause those dependent resources to fail. Check the deps field in other resources before removing.

Database Setup

Most alt:V gamemodes require a database to store player data, vehicles, inventories, and other persistent information. The two most common database systems for alt:V are MongoDB and MySQL/MariaDB.

MongoDB

MongoDB is a NoSQL document database commonly used with JavaScript/TypeScript resources. Use a managed service like MongoDB Atlas (free tier available) or a self-hosted instance. Get your connection string (e.g., mongodb+srv://user:[email protected]/mydb) and configure it in your resource's config file. Node.js resources use the mongodb npm package.

MySQL / MariaDB

MySQL is commonly used with C# resources and some JavaScript frameworks. Obtain a database from a managed service or self-hosted instance, configure your resources with the connection details (host, port, username, password, database name), and run any required SQL migration scripts.

Database hosting: The alt:V game server does not include a database server. You need a separate database service. Contact our support team if you need help. Always use asynchronous database operations — synchronous calls block the main thread and cause lag.

Player Management

Player management in alt:V is handled through your resources. Common operations include:

Identifying Players

alt:V provides several identifiers for each connected player:

Identifier Description
player.id A temporary numeric ID assigned for the current session. Changes on reconnect.
player.socialID The player's Rockstar Social Club ID. Persistent across sessions.
player.hwidHash A hardware identifier hash. Useful for ban enforcement.
player.ip The player's IP address.

Kicking and Banning

Implement kick and ban functionality in your resources:

import alt from "alt-server";

// Kick a player
player.kick("Reason for kick");

// Ban check on connect (store bans in database)
alt.on("playerConnect", (player) => {
    if (isPlayerBanned(player.socialID)) {
        player.kick("You are banned from this server.");
    }
});
Persistent bans: alt:V has no built-in ban system. Store bans in a database and check on connect. Use socialID and hwidHash for reliable enforcement.

Vehicle and Weapon Management

Vehicles and weapons are managed through server-side scripts. alt:V gives you full control over spawning, modifying, and removing vehicles and weapons.

Spawning Vehicles

import alt from "alt-server";

// Spawn a vehicle at a position
const vehicle = new alt.Vehicle(
    "sultan",            // Vehicle model name
    0, 0, 72,           // Position (x, y, z)
    0, 0, 0             // Rotation (rx, ry, rz)
);
vehicle.numberPlateText = "LEGION";

Giving Weapons

// Give a weapon to a player
player.giveWeapon(alt.hash("weapon_pistol"), 100, true);

// Remove all weapons
player.removeAllWeapons();

Vehicle Persistence

By default, vehicles exist only in server memory and are lost on restart. To persist vehicles across restarts, store their data (model, position, modifications, owner) in a database and recreate them on server start.


Troubleshooting

Resources Not Loading

  • Check that the resource name in server.toml exactly matches the folder name in resources/.
  • Verify the resource has a valid resource.toml file with correct type and main fields.
  • Check the console for error messages during resource loading. Syntax errors in scripts will prevent the resource from starting.
  • Ensure all dependencies listed in deps are installed and loaded.
  • Verify the correct module is loaded in server.toml (js-module for JavaScript, csharp-module for C#).

Players Cannot Connect

  • Verify the server is running and showing as online in GPanel.
  • Check that players are using the alt:V launcher, not the regular GTA V launcher.
  • Ensure the alt:V server branch matches what players have (release, rc, or dev). Mismatched branches prevent connections.
  • If password-protected, verify players are entering the correct password.
  • Have players try direct connect with the IP and port. See How to Find Your Server IP and Port.

Server Crashes

  • Check the console for error messages before the crash.
  • Faulty resources are the most common cause of crashes. Disable recently added resources to isolate the problem.
  • Ensure your server files are up to date. Trigger a reinstall from the Startup tab if needed.
  • Memory leaks in resources can cause the server to run out of RAM over time. Monitor GPanel resource graphs for steadily increasing memory usage.

Database and Voice Issues

  • Verify database credentials and connection strings. For MongoDB Atlas, whitelist your server's IP in network access settings.
  • Check the console for database connection error messages.
  • Voice chat requires the [voice] section in server.toml plus resources that implement voice channel logic. The config alone only sets up infrastructure.

Performance Issues

  • Profile your resources for expensive operations (heavy loops, synchronous database calls, excessive entity creation).
  • Use alt.setInterval and alt.setTimeout sparingly. Heavy per-tick operations are the most common performance killer.
  • Monitor GPanel resource graphs for CPU and RAM usage.
  • Consider upgrading your server plan for high player counts. Open a support ticket to discuss options.

Related Articles


Need More Help?

If you are experiencing issues not covered in this guide, our support team is available to assist. Open a ticket at legionhosting.net/submitticket.php with your server details, a description of the problem, and any relevant error messages from the GPanel console.


هل كان هذا المقال مفيداً؟

Ready to Get Started?

The servers are booted, select your plan and become our latest satisfied client.