SixL server API / sixl / Mp
Interface: Mp
The server 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, mp.Blip ... (create entities with the pools: mp.vehicles.new(...)), and mp.game, which is client only.
Example
mp.events.add('playerJoin', (player) => player.outputChatBox('Hello'));
const car = mp.vehicles.new('sultan', new mp.Vector3(0, 0, 70));
Properties
blips
blips: BlipMpPool
The blips (map icons).
Example
const blip = mp.blips.new(1, new mp.Vector3(0, 0, 70));
checkpoints
checkpoints: CheckpointMpPool
The checkpoints.
Example
const cp = mp.checkpoints.new(1, new mp.Vector3(0, 0, 70), 3);
colshapes
colshapes: ColshapeMpPool
The colshapes (trigger volumes).
Example
const zone = mp.colshapes.newSphere(0, 0, 70, 5);
config
config: ConfigMp
The server's settings (read-only), filled before the packages load.
Example
console.log(mp.config.name);
dummies
dummies: DummyMpPool
The dummy entities.
Example
const quest = mp.dummies.new(7, { stage: 1 });
Event
Event: EventMpConstructor
The constructor of event handles: new mp.Event(name, handler).
Example
const ev = new mp.Event('playerJoin', (player) => { });
events
events: EventMpPool
The event registry.
Example
mp.events.add('playerChat', (player, text) => { });
labels
labels: TextLabelMpPool
The text labels.
Example
const label = mp.labels.new('Hello', new mp.Vector3(0, 0, 71));
markers
markers: MarkerMpPool
The markers.
Example
const marker = mp.markers.new(1, new mp.Vector3(0, 0, 70), 2);
network
network: NetworkMp
Packet batching (does nothing in SixL).
Example
mp.network.startBatch();
objects
objects: ObjectMpPool
The objects (props).
Example
const prop = mp.objects.new('0x<hash>', new mp.Vector3(0, 0, 70));
peds
peds: PedMpPool
The peds (NPCs).
Example
const ped = mp.peds.new('mp_m_freemode_01', new mp.Vector3(0, 0, 70));
players
players: PlayerMpPool
The players.
Example
mp.players.forEach((p) => p.notify('hi'));
Vector3
Vector3: Vector3Constructor
The constructor of 3D vectors: new mp.Vector3(x, y, z).
Example
const pos = new mp.Vector3(0, 0, 70);
vehicles
vehicles: VehicleMpPool
The vehicles.
Example
const car = mp.vehicles.new('sultan', new mp.Vector3(0, 0, 70));
world
world: WorldMp
The world: weather, time, traffic lights, IPLs.
Example
mp.world.time.set(12, 0, 0);
Methods
joaat()
Call Signature
joaat(str):number
The Jenkins one-at-a-time hash of a string (case-insensitive), as the game uses for names.
Parameters
str
string
The string, e.g. a model or weapon name.
Returns
number
The unsigned 32-bit hash.
Remarks
SixL remembers every hash it computes, so mp.vehicles.new(mp.joaat('sultan'), ...) works: the hash is turned back into the name for the clients. VI uses 64-bit model keys and its own names: a 32-bit hash of a GTA V name does not select a VI model.
Example
const hash = mp.joaat('sultan');
Call Signature
joaat(strs):number[]
The hashes of several strings, in the same order.
Parameters
strs
string[]
The strings.
Returns
number[]
One unsigned 32-bit hash for each string.
Example
const [a, b] = mp.joaat(['sultan', 'adder']);