Skip to content

Configuration

The configuration for the resource is all contained within sh_config.lua in the root directory of the resource and allows for configurating max characters, where characters are positioned, character effects, character spawns and which frameworks to use.

Framework

Which framework is being used by the server

---@type Framework
CONFIG.FRAMEWORK = FRAMEWORK.OX;

Supported frameworks

---@enum Framework
FRAMEWORK = {
OX = 'ox', -- ox-core
QBOX = 'qbox', -- qbx_core
ND = 'nd', -- ND_Core
QB = 'qb', -- qb-core
}

See frameworks for framework specfic installation steps

Appearance

Which appearance resource used by the server

---@type Appearance
CONFIG.APPEARANCE = APPEARANCE.ILLENIUM;

Supported appearance resources

---@enum Appearance
APPEARANCE = {
ILLENIUM = 'illenium', -- illenium-appearance
ND = 'nd', -- fivem-appearance with ND_Core framework
BYTELABS = 'bytelabs' -- bl_appearance
}

Max characters

How many characters the resource will allow you to create. If a player already has more characters than the maximum they still will be able to see them all.

CONFIG.MAX_CHARACTERS = 8;

Spawns

Contains the positions for each spawn choice when a new character is created.

---@type vector4[]
CONFIG.SPAWNS = {
vector4(0.0, 0.0, 0.0, 0.0),
vector4(0.0, 0.0, 0.0, 0.0),
vector4(0.0, 0.0, 0.0, 0.0),
vector4(0.0, 0.0, 0.0, 0.0),
vector4(0.0, 0.0, 0.0, 0.0),
vector4(0.0, 0.0, 0.0, 0.0),
};
  • Only 6 spawns are supported.
  • Thumbnail images for each spawn can be changed, see here
  • Spawns can be handled by another resource, see here

Character peds

A list of character peds, contains the model, location, camera angles and animation used by every ped.

---@type CharacterPedOptions[]
CONFIG.CHARACTER_PEDS = {
{
model = 'mp_m_freemode_01',
position = vector4(-93.96, -582.58, 59.43, 341.71),
freeze = true,
anim = {
dictionary = 'missfam1_yachtbattleonyacht02_',
animation = 'onboom_twohand_hang_idle',
duration = -1,
flags = ANIM_FLAG.LOOP,
},
camera = {
positionOffset = vector3(0.0, -1.55, 2.0),
targetOffset = vector3(0.0, 0.0, -0.5)
},
effect = 'falling'
},
}

Character ped options

  • model: string | number
  • position: vector4
  • freeze?: boolean
  • anim?: PedAnimationOptions
  • scenario?: PedScenarioOptions
  • camera?: PedCameraOptions
  • lookAt?: vector3
  • effect?: string

Go here for a breakdown of types

Model

The model to use for the ped, this is only used on empty character slots.

model = 'mp_m_freemode_01',

A list of ped models can be found here

Position

The position where the ped will be spawned

  • x: number
  • y: number
  • z: number
  • w: number (heading)
position = vector4(-93.96, -582.58, 59.43, 341.71),

Freeze

Whether to freeze the ped directly after being spawned, this is useful if the ped floats in the air.

freeze = false

Animation / Scenario

Using an animation or scenario is optional but only one can be used for each ped

Animation

Plays an animation on the character ped after being placed at a position

  • dictionary: string
  • animation: string
  • duration: integer
  • flags: AnimFlags | integer
  • positionOffset?: vector3
  • rotationOffset?: vector3
  • blendInDelta?: AnimBlend | number
  • blendOutDelta?: AnimBlend | number
  • timeToPlay?: number
  • startPhase?: number
  • phaseControlled?: boolean
  • ikFlags?: integer
  • freeze?: boolean
anim = {
dictionary = 'missfam1_yachtbattleonyacht02_',
animation = 'onboom_twohand_hang_idle',
duration = -1,
flags = ANIM_FLAG.LOOP,
},
  • See available animation flags here
  • See available animation blend deltas here

Scenario

Plays a scenario on the character ped after being placed at a position

  • scenario: string
  • duration: number
  • positionOffset?: vector3
  • playIntro?: boolean
  • warp?: boolean
scenario = {
scenario = 'PROP_HUMAN_SEAT_BENCH',
positionOffset = vector3(0, 0, -0.95),
duration = -1,
playIntro = false,
warp = true
}

Camera

The camera settings controls where the camera is located and where the camera is pointing at, by default the camera is always located in front of the character ped and is pointed at the character.

  • positionOffset?: vector3
  • targetOffset?: vector3
  • boneId?: integer
camera = {
positionOffset = vector3(1.55, 0.8, 0.7),
targetOffset = vector3(-1.0, 1.8, 0.5)
},
  • The position of the character ped camera is offset relative to the ped’s position
  • The target where the camera is pointing at is offset relative to the ped’s position

Look At

The lookAt option controls where the character peds is actually looking, for example this can be used to make the character look towards the camera when it may not be facing towards it.

lookAt = vector3(1.55, 0.8, 0.7),
  • The lookAt option position an offset relative to the character peds position.

Effect

Allows an effect to be played on the character ped when clicking outside of the interface when selecting a character. The effect system is how the falling effect is achieved.

effect = 'name'
  • effect simply takes the name of an effect and is optional
  • Additional effects can be created see here for a guide.