ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. ref

Function

ref

ServerMiscellaneousIdentical to MTA:SA

Returns a number under which a value (e.g. an element) is stored, so you can pass it on as a number. deref turns it back. The same value always gets the same number.

Syntax

int ref(mixed value)

Arguments

valuemixed
The value.

Returns

The number or false for nil.

Example

local id = ref(player)
outputServerLog(deref(id) == player) -- true

See also