βš–οΈInstances

πŸ“ What Are Instances?

Instances in RedM are separate, isolated environments within the game world.

  • They allow groups of players to interact without seeing or affecting players in other instances.

  • This system is similar to phasing or sharding in other online games.


πŸ“¦ Types of Instances

  • Default Instance:

    • Usually has the ID 0.

    • This is the standard server instance for all players unless changed in config.lua.

  • Script Instances:

    • Created automatically by other scripts (e.g., character creation/selection in VORP).

    • Useful for keeping players separated during setup or story events.

  • Admin Instances:

    • Manually created by admins.

    • Admins (or assigned organizers) can kick/transfer players, disable NPCs in their instance, assign a new admin, or delete the instance.


🟦 Client Side

Open the Admin Instance Menu

  • Add your Steam identifier to:

    Config.AdminIdentifiers = {
      "steam:1100001xxxxxxx",
      ...
    }
  • Open the admin menu:

    TriggerServerEvent("Botiv-OpenAdminMenu")

    or use the command:

    /instances

Open Player Group Menu

  • Open the group management menu:

    TriggerServerEvent("Botiv-OpenInstanceGroupMenu")

    or use the command:

    /group

βš™οΈ Configuration (config.lua)

Config = {}
Config.DEBUG = false  -- Show players' instances regularly, auto-open menu for admins

Config.AllowInstancesForAll = false -- [WARNING] true = all players can use admin menu
Config.AdminIdentifiers = {
    "steam:11000010200f727",
    "steam:11000010144f888",
    "steam:110000145bt77e3"
}

Config.DefaultInstanceId = 0 -- Default instance after script restart
Config.CheckInterval = 5     -- Interval (seconds) for checking current player instances

Config.EnableCmd = true           -- Enable admin/player commands
Config.CommandAdmin = "instances" -- /instances for admin instance management
Config.CommandGroup = "group"     -- /group for player group management

πŸ“Œ Notes

  • Security: Only Steam IDs in Config.AdminIdentifiers can use the admin menu (unless Config.AllowInstancesForAll is set to trueβ€”not recommended for public servers).

  • Flexibility: You can assign or transfer instance admin rights, kick players, and fully control instance environments.

  • Compatibility: Works with automatic instances created by other scripts and manual admin management.

Last updated