SixL client API / sixl / Mp

Interface: Mp

The client API object. It is the global mp, and the same object as SixL.

Remarks

Not implemented, so not declared: the constructors mp.Player, mp.Vehicle ... (the pools create entities the game shows), and the entities' data pools that the server does not send to the client.

Example

mp.events.add('playerReady', () => mp.console.logInfo('ready'));

Properties

blips

blips: BlipMpPool

The blips the server sends to this client.

Example

mp.blips.forEach((blip) => blip.sprite);

browsers

browsers: BrowserMpPool

The browsers: pages drawn over the game, created with mp.browsers.new(url).

Example

const hud = mp.browsers.new('package://ui/index.html');

cameras

cameras: CameraMpPool

The script cameras the client's script made, and the gameplay camera.

Example

const cam = mp.cameras.new('default', { x: 0, y: 0, z: 80 });

checkpoints

checkpoints: CheckpointMpPool

The checkpoints the server sends to this client.

Example

mp.checkpoints.forEach((cp) => cp.radius);

colshapes

colshapes: ColshapeMpPool

The colshapes this client made: trigger zones checked against the local player each frame.

Example

const zone = mp.colshapes.newSphere(10, 20, 30, 5);

console

console: ConsoleMp

The console: log lines to the client's log.

Example

mp.console.logInfo('hello');

dummies

dummies: DummyEntityMpPool

The server's dummy entities: a type and shared variables each, given to every client.

Example

mp.dummies.forEachByType(42, (dummy) => mp.console.logInfo(String(dummy.id)));

Event

Event: EventMpConstructor

The constructor of event handles: new mp.Event(name, handler).

Example

const ev = new mp.Event('render', () => {});

events

events: EventMpPool

The event registry: handlers for the server's events and the client's own events.

Example

mp.events.add('render', () => {});

game

game: GameMp

The game functions, grouped in sections (mp.game.vehicle, mp.game.ped ...). Declared in game/index.d.ts.

Example

mp.game.clock.setTime(12, 0, 0);

gui

gui: GuiMp

The game's user interface: the mouse cursor over the pages (mp.gui.cursor) and the built-in chat (mp.gui.chat).

Example

mp.gui.cursor.show(true, true);

keys

keys: KeysMp

The keyboard: bind and unbind keys, and read their state.

Example

mp.keys.bind(0x45, true, () => {});

labels

labels: TextLabelMpPool

The text labels the server sends to this client.

Example

mp.labels.forEach((label) => label.text);

markers

markers: MarkerMpPool

The markers the server sends to this client.

Example

mp.markers.forEach((marker) => marker.scale);

nametags

nametags: NametagsMp

RAGE MP's built-in name tags: accepted without effect, SixL draws none.

Example

mp.nametags.enabled = false;

objects

objects: ObjectMpPool

The streamed objects.

Example

mp.objects.forEach((obj) => obj.rotation);

peds

peds: PedMpPool

The streamed peds.

Example

mp.peds.forEach((ped) => ped.getArmour());

players

players: PlayerMpPool

The local player and the other players the server streams in to this client.

Example

mp.players.local.position;

raycasting

raycasting: RaycastingMp

Ray tests in the game's world.

Example

const hit = await mp.raycasting.testPointToPoint(from, to);

storage

storage: StorageMp

The client's storage: a data object kept on this computer between sessions, and a session-only one.

Example

mp.storage.data.lastServer = 'main';

system

system: SystemMp

The client's machine: whether the game has the focus and runs fullscreen.

Example

if (!mp.system.isFocused) { }

user

user: UserMp

The player's client settings (mp.user.preferences).

Example

const lang = mp.user.preferences.language;

Vector3

Vector3: Vector3Constructor

The constructor and helpers of 3D vectors.

Example

const v = new mp.Vector3(1, 2, 3);

vehicles

vehicles: VehicleMpPool

The streamed vehicles.

Example

mp.vehicles.forEach((car) => car.getEngineHealth());