We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 42a5a16 commit a4fa3b7Copy full SHA for a4fa3b7
garrysmod/lua/includes/util.lua
@@ -30,6 +30,24 @@ function Material( name, words )
30
31
end
32
33
+--[[---------------------------------------------------------
34
+ type
35
+-----------------------------------------------------------]]
36
+function type( v )
37
+
38
+ local v_type = lua_type( v )
39
+ if ( v_type != "userdata" ) then return v_type end
40
41
+ local metatable = getmetatable( v )
42
+ if ( !metatable ) then return "UserData" end
43
44
+ local metaName = metatable.MetaName
45
+ if ( lua_type( metaName ) != "string" ) then return "UserData" end
46
47
+ return metaName
48
49
+end
50
51
--[[---------------------------------------------------------
52
IsTableOfEntitiesValid
53
-----------------------------------------------------------]]
0 commit comments