ref | Multi Theft Auto: Wiki Skip to content

ref

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function will create a reference to the given argument.

Note

This function was originally created to prevent garbage-collection of specific Lua objects/elements which should persist even though no script would reference them. The storage of those references can be obtained by a call to the debug.getregistry function. Since at the moment MTA does not make use of advanced garbage-collector semantics, this function serves little purpose other than leak memory!

Syntax

int ref ( mixed objectToReference )
Required Arguments
  • objectToReference: MISSING_PARAM_DESC

Returns

  • int: value

Returns an int if the reference were successfully created. Returns false if the parameter were invalid.

Code Examples

Script Example Missing

Function ref needs a script example. Help out by writing one.

Contribution guidelines