Garry's Mod Wiki

search.AddProvider

search.AddProvider( function provider, string id = "nil" )

Description

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

Arguments

1 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?
2 string id = "nil"
If provided, ensures that only one provider exists with the given ID at a time.

Page Links


Special Pages


Wikis

?

Render Time: 95ms

DB GetPage 54
Generate Html 11
SaveChanges (1) 15
Render Body 0
Render Sidebar 12