Garry's Mod Wiki

Garry's Mod Wiki

  saverestore.AddSaveHook( string identifier, function callback )

Description

Adds a save hook for the Half-Life 2 save system. You can this to carry data through level transitions in Half-Life 2.

Arguments

1 string identifier
The unique identifier for this hook.
2 function callback
The function to be called when an engine save is being saved.
Function argument(s):
1 ISave save - The save object to be used to write data to the save file that is being saved.

You can also use those functions to save data:

Example

Example usage.

saverestore.AddSaveHook( "HookNameHere", function( save ) saverestore.WriteTable( { "test" }, save ) end )

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...