Skip to main content

Exports & Events

Client Exports


GetDeviceList

Returns device list.

Returns

  • list: {id: number; label: string; type: string; coords: vector3; location: string; date: string}
GetDeviceId

Returns device id from entity.

Parameters

  • entity: number

Returns

  • deviceId?: number
HasDevice

Returns has access to given device id.

Parameters

  • deviceId: number

Returns

  • hasAccess: boolean
AddInteraction

Adds interaction to the devices.

Parameters

  • ctx: {id: string; devices: string[]; label: string; icon: string; accessRequired?: boolean; onInteract: function(entity, deviceId); isEnabled: function(entity, deviceId);}

Server Exports


GetDeviceList

Returns device list.

Parameters

  • source: number

Returns

  • list: {id: number; label: string; type: string; owned: boolean; coords: vector3; netId: number; date: string}
GetDeviceListByUserId

Returns device list.

Parameters

  • userId: number

Returns

  • list: {id: number; label: string; type: string; owned: boolean; coords: vector3; netId: number; date: string}
AccessGive

Grants device access to the given source.

Parameters

  • deviceId: number
  • source: number

Returns

  • success: boolean
AccessGiveByUserId

Grants device access to the given userId.

Parameters

  • deviceId: number
  • userId: number

Returns

  • success: boolean
AccessRemove

Removes device access from the given source.

Parameters

  • deviceId: number
  • source: number

Returns

  • success: boolean
AccessRemoveByUserId

Removes device access from the given userId.

Parameters

  • deviceId: number
  • userId: number

Returns

  • success: boolean
AccessReset

Resets device accesses.

Parameters

  • deviceId: number

Returns

  • success: boolean
AccessShare

Shares access with given target if player has access.

Parameters

  • deviceId: number
  • source: number
  • targetSource: number

Returns

  • success: boolean
Destroy

Removes device entirely.

Parameters

  • deviceId: number

Returns

  • success: boolean

Client Net Events


no-spy:close

Turns off all devices.

no-spy:devicemanager:menu

Opens the devices menu.

Parameters

  • type?: cam | motionsensor
no-spy:glasses:use

Toggles spy glasses.

no-spy:glasses:putOn

Puts on glasses.

no-spy:glasses:remove

Removes glasses.

no-spy:glasses:activate

Activates glasses if equipped.

no-spy:glasses:deactivate

Deactivates glasses.

no-spy:cam:use

Starts cam placement.

no-spy:cam:connect

Connects to cam.

Parameters

  • deviceId: number
no-spy:cam:disconnect

Disconnects from cam.

no-spy:motionsensor:use

Starts motion sensor placement.

no-spy:motionsensor:notify

Sends sensor notification.

Parameters

  • deviceLabel: string
no-spy:photo:use

Toggles photo.

Parameters

  • ctx: {image: string, date?: number}
no-spy:photo:show

Shows photo.

Parameters

  • ctx: {image: string, date?: number}
no-spy:photo:close

Closes photo.

no-spy:photo:ready

This event will be triggered by us when the photo is ready. You can change normal behavior by listening this event.

Parameters

  • ctx: {image: string; date: number}

Server Net Events


no-spy:photo:ready

This event will be triggered by us when the photo is ready. You can change normal behavior by listening this event.

Parameters

  • ctx: {image: string; date: number}
no-spy:cam:place

Places cam.

Parameters

  • deviceCtx: {label: string}
  • placementCtx: {coords: vector3; rotation: vector3}
no-spy:motionsensor:notify

Sends sensor notification to device owners.

Parameters

  • deviceId: number
no-spy:motionsensor:place

Places motion sensor.

Parameters

  • deviceCtx: {label: string}
  • placementCtx: {coords: vector3; rotation: vector3}