Minimal server example
Save the compiled output as <scripts_path>/server/main.js.
ts
vimp.on('playerConnected', (player) => {
console.log(`${player.name} (#${player.id}) connected`)
player.teleport(90.79, -1951.33, 20.74, 307.23)
})
vimp.on('playerDisconnected', (player) => {
console.log(`${player.name} (#${player.id}) disconnected`)
})
vimp.markReady()The handlers are registered before readiness. On connection, the server logs the player's identity and teleports the spawned ped. The disconnect handler uses the cached name snapshot for logging.
Build the file with @vimp-mp/types/server and Node types, then start the server from the directory containing config.json.