Entity/DTVar

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m
Line 2: Line 2:
 
|Name=DTVar
 
|Name=DTVar
 
|Parent=Entity
 
|Parent=Entity
|Description={{Deprecated|Use {{ClassFunction|Entity|NetworkVar}} instead. It offers the same functionality with more features.}}
+
|Description={{Internal}}
  
 
Sets up a self.dt.NAME alias for a Data Table variable.
 
Sets up a self.dt.NAME alias for a Data Table variable.
 +
 +
'''Warning!''' Use {{ClassFunction|Entity|NetworkVar}} instead.
 
|Realm=Shared
 
|Realm=Shared
 
|IsClass=Yes
 
|IsClass=Yes
Line 27: Line 29:
 
|Code=function ENT:SetupDataTables()
 
|Code=function ENT:SetupDataTables()
  
self:DTVar( "Float", 0, "TargetZ" );
+
self:DTVar( "Float", 0, "TargetZ" )
self:DTVar( "Float", 1, "Speed" );
+
self:DTVar( "Float", 1, "Speed" )
  
 
end
 
end
 
}}
 
}}

Revision as of 21:10, 21 March 2015

 Entity:DTVar( )

Contents

Description

This is an internal function or feature.
This means you will be able to use it, but you really shouldn't.

Sets up a self.dt.NAME alias for a Data Table variable.

Warning! Use Entity:NetworkVar instead.

Arguments

string Type

The type of the DTVar being set up. It can be one of the following: 'Int', 'Float', 'Vector', 'Angle', 'Bool', 'Entity' or 'String'

Arguments

number ID

The ID of the DTVar. Can be between 0 and 3

Arguments

string Name

Name by which you will refer to DTVar. It must be a valid variable name. (No spaces!)

Examples

Example

Sets up two float networked variables, TargetZ and Speed

function ENT:SetupDataTables()

	self:DTVar( "Float", 0, "TargetZ" )
	self:DTVar( "Float", 1, "Speed" )

end


Personal tools
Navigation