Globals::invoke
Jump to navigation
Jump to search
Invokes specified native function
Contents
Parameters
- hash: String
- args: Any
Syntax
mp.game.invoke(hash, [, ...args])
Example
Client-Side
// Normal invoke void
mp.game.invoke('0x428CA6DBD1094446', mp.players.local.handle, true); // FREEZE_ENTITY_POSITION
// You should use arrays with one element of required type to pass variable as a reference
let posixTime = { year: [0], month: [0], day: [0], hour: [0], minute: [0], second: [0] };
mp.game.invoke('0xDA488F299A5B164E', posixTime.year, posixTime.month, posixTime.hour, posixHour.minute, posixHour.second);
mp.gui.chat.push(`Year: ${posixTime.year[0]}`);
// that works for all types
let matrix = { r: [[0, 0, 0]], f: [[0, 0, 0]], u: [[0, 0, 0]], p: [[0, 0, 0]] };
mp.game.invoke('0xECB2FC7235A7D137', handle, matrix.r, matrix.f, matrix.u, matrix.p);
// ArrayBuffers could be used too
let outDataBuffer = [new ArrayBuffer(256)];
mp.game.invoke('0x79923CD21BECE14E', 0, outDataBuffer);