search.AddProvider

From Garry's Mod
Jump to: navigation, search
 search.AddProvider( )

Description

Adds a search result provider. For examples, see gamemodes/sandbox/gamemode/cl_search_models.lua

Arguments

function provider

Provider function. It has one argument: string searchQuery You must return a list of tables structured like this:

  • string text - Text to "Copy to clipboard"
  • function func - Function to use/spawn the item
  • Panel icon - A panel to add to spawnmenu
  • table words - A table of words?

Arguments

string id=nil

If provided, ensures that only one provider exists with the given ID at a time.
Personal tools
Navigation