G.FindMetaTable

From GMod Wiki

Revision as of 11:31, 29 August 2011 by TheFreeman193 (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax FindMetaTable( String name )
Where is this used?
Description:
Returns the metatable stored in _R with that name.
Returns: Table
Part of Library: Global Functions
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=G.FindMetaTable]G.FindMetaTable [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionDefines a meta function that will send a notification to a player.
Used onNewerShared.png
Code
local Player = FindMetaTable("Player")
//NOTE: "local Player = _R.Player" could be used as an alternative.
 
function Player:Notify(text,type)
	self:SendLua("GAMEMODE:AddNotify('"..text.."',"..type..",10) MsgN('"..text.."')")
end
OutputN/A


Additional Notes

Name Metatable
"NPC" Npc NewerShared.png
"Player" Player NewerShared.png
"Entity" Entity NewerShared.png
"Panel" Panel NewerClient.png
"CLuaEmitter" CLuaEmitter NewerClient.png
"CLuaParticle" CLuaParticle NewerClient.png
"Weapon" Weapon NewerShared.png
"CTakeDamageInfo" CTakeDamageInfo NewerShared.png
"ISave" ISave NewerShared.png
"VMatrix" VMatrix NewerShared.png
"Angle" Angle NewerShared.png
"IRestore" IRestore NewerShared.png
"CSENT_vehicle" CSENT_vehicle NewerShared.png
"CRecipientFilter" CRecipientFilter NewerServer.png
"Vector" Vector NewerShared.png
"CMoveData" CMoveData NewerShared.png
"CUserCmd" CUserCmd NewerShared.png
"ConVar" ConVar NewerShared.png
"CSoundPatch" CSoundPatch NewerShared.png
"PhysObj" Physobj NewerShared.png
"_LOADLIB" LoadLib
"Vehicle" Vehicle NewerServer.png
"CEffectData" CEffectData NewerShared.png
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox