Garry's Mod Wiki


  Entity:DTVar( string Type, number ID, string Name )


This is used internally - although you're able to use it you probably shouldn't.

You should use Entity:NetworkVar instead

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


1 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'
2 number ID
The ID of the DTVar. Can be between 0 and 3 for strings, 0 and 31 for everything else.
3 string Name
Name by which you will refer to DTVar. It must be a valid variable name. (No spaces!)


Sets up two float networked variables, TargetZ and Speed

function ENT:SetupDataTables() self:DTVar( "Float", 0, "TargetZ" ) self:DTVar( "Float", 1, "Speed" ) end