Functions/DarkRP/Shared/registerDarkRPVar

From Official DarkRP Wiki
Jump to: navigation, search
Function
Function name DarkRP.registerDarkRPVar(string name, function writeFn, function readFn)
Description:
Register a DarkRPVar by name. You should definitely register DarkRPVars. Registering DarkRPVars will make networking much more efficient.
Returns: nil
Part of Library: DarkRP
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.darkrp.com/index.php?title=Functions/DarkRP/Shared/registerDarkRPVar]DarkRP.registerDarkRPVar[/url][/b]

Function parameters

  1. name (string)
  2. The name of the DarkRPVar.

  3. writeFn (function)
  4. The function that writes a value for this DarkRPVar. Examples: net.WriteString, function(val) net.WriteUInt(val, 8) end.

  5. readFn (function)
  6. The function that reads and returns a value for this DarkRPVar. Examples: net.ReadString, function() return net.ReadUInt(8) end.


Function return values

This function does not return any value.