Skip to content

VimpServer

@vimp-mp/types 2.0.1

Interface · Server API

Root API installed as the global vimp object in server scripts.

ts
interface VimpServer

Members

blips

ts
readonly blips: BlipManager

Server blip manager.

checkpoints

ts
readonly checkpoints: CheckpointManager

Server checkpoint manager.

colshapes

ts
readonly colshapes: ColshapeManager

Server colshape manager.

markers

ts
readonly markers: MarkerManager

Server marker manager.

objects

ts
readonly objects: ObjectManager

Server object manager.

peds

ts
readonly peds: PedManager

Server ped manager.

players

ts
readonly players: PlayerManager

Connected-player manager.

vehicles

ts
readonly vehicles: VehicleManager

Server vehicle manager.

voice

ts
readonly voice: VoiceManager

Voice channel manager.

world

ts
readonly world: WorldManager

World time and weather controls.

add

ts
add(a: number, b: number): number

Test op — adds two numbers server-side.

emit

ts
emit<K extends keyof VimpServerBuiltinEvents>(event: K, ...args: Parameters<VimpServerBuiltinEvents[K]>): void
ts
emit(event: string, ...args: Array<unknown>): void

Synchronously dispatch an event to all locally registered handlers. In-process only — does not send anything to clients. Use player.emit / emitAllClients for client-bound traffic.

emitAllClients

ts
emitAllClients<K extends never>(event: K, data: VimpClientInboundEvents[K]): void
ts
emitAllClients(event: string, data: unknown): void

Broadcast a custom event to all connected clients. data is JSON-serialized unless it is already a string.

hash

ts
hash(name: string): number

Compute a Jenkins One-At-A-Time (JOAAT) hash of name. Matches GTA V's GET_HASH_KEY semantics — input is lowercased before hashing — so e.g. vimp.hash('WEAPON_PISTOL') returns 0x1B06D571.

markReady

ts
markReady(): boolean

Mark the server-side script as fully initialized. The network listener starts only after the first successful call. Returns false on duplicate calls.

off

ts
off<K extends keyof VimpServerBuiltinEvents>(event: K, callback: VimpServerBuiltinEvents[K]): void
ts
off<K extends never>(event: K, callback: (player: Player, data: VimpServerEvents[K]) => void): void
ts
off(event: string, callback: (...args: Array<any>) => void): void

Unsubscribe a previously registered handler. No-op if the handler was not registered for event. Match is by reference equality with the callback originally passed to on.

on

ts
on<K extends keyof VimpServerBuiltinEvents>(event: K, callback: VimpServerBuiltinEvents[K]): void
ts
on<K extends never>(event: K, callback: (player: Player, data: VimpServerEvents[K]) => void): void
ts
on(event: string, callback: (...args: Array<any>) => void): void

Registers a handler for a built-in server event.

VIMP developer documentation