saverestore.ReadTable

From GMod Wiki

Jump to: navigation, search
Function
Syntax saverestore.ReadTable( Table restore )
Where is this used?
Description:
Assuming a table is waiting to be read, reads and subsequently returns the table
Returns: Table
Part of Library: saverestore
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Saverestore.ReadTable]Saverestore.ReadTable [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionHooks a save and restore function to save my_table.
Used onNewerShared.png
Code
local function MySaveFunction( save )
   saverestore.WriteTable( my_table, save )
end
 
local function MyRestoreFunction( restore )
   my_table = saverestore.ReadTable( restore )
end
 
saverestore.AddSaveHook( "HookNameHere", MySaveFunction )
saverestore.AddRestoreHook( "HookNameHere", MyRestoreFunction )
 
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox