General > Developers Corner
MetaTables
iViscosity:
I've done some googling but I couldn't find anything helpful. I'm looking to find an existing list of MetaTables that exist. For all my addons that I've made to use players I could use FindMetaTable( "Player" ) but that's the only one I know of. Are there any more and/or a way to find them?
Bytewave:
FindMetaTable just gives you the metatable (think: structure) that all objects of a given class use. Every object type should have a metatable---really, you're looking for entity/object classes.
iViscosity:
Ohhh that makes a lot more sense now. So like Player:Ban is under the Player metatable, and something like Weapon:AllowsAutoSwitchFrom would have the Weapon metatable? Just examples of something in those, am I right in that assumption?
EDIT:
Also, is there a way to create a metatable? I'm trying to create something that accepts a string and then does stuff to it (say I wanted to do string:lower() instead of string.lower())
MrPresident:
Yes!
http://wiki.garrysmod.com/page/Main_Page
Click on Classes drop down. There you go! List of all the 'meta tables'
iViscosity:
--- Quote from: MrPresident on February 20, 2017, 01:19:50 PM ---Yes!
http://wiki.garrysmod.com/page/Main_Page
Click on Classes drop down. There you go! List of all the 'meta tables'
--- End quote ---
You probably were posting that before I put in my edit, but is there a way to create a metatable? I'm trying to create something that accepts a string and then does stuff to it (say I wanted to do string:lower() instead of string.lower())
Navigation
[0] Message Index
[#] Next page
Go to full version