Entity/GetNetworkedVarProxy

From Garry's Mod
Jump to: navigation, search
 Entity:GetNetworkedVarProxy( )

Contents

Description

This feature is deprecated.
You should avoid using it as it may be removed in a future version.

You should be using Entity:GetNWVarProxy instead.

Returns callback function for given NWVar of this entity.

NOTE

Currently this function only works for the NW2Var system (accessed by adding a 2 in between Networked and Var for most NetworkedVar functions), which will replace the original one at some point in the future

Arguments

string name

The name of the NWVar to get callback of.

Returns

function

The callback of given NWVar, if any.

Examples

Example

Prints callback function of a NWVar called "Key" of Player 1.

print( Entity(1):GetNetworkedVarProxy( "Key" ) )
Entity(1):SetNetworkedVarProxy( "Key", print )
print( Entity(1):GetNetworkedVarProxy( "Key" ) )

Output:

nil
function: builtin#25
Personal tools
Navigation