Garry's Mod Wiki

FireProblem

  FireProblem( Problem structure problem )

Description

Creates a problem from the given definition.

Existing problems with the same Id will be replaced / overridden.

Arguments

1 Problem structure problem
The problem's definition.




Example: Unfixable Problem

Creating a problem that the user cannot fix.

local problem = { text = 'There is a problem!' , type = 'addons' , id = 'my-problem-1234' } FireProblem(problem)
Output:


Example: Fixable Problem

Creating a problem that can be fixed by the user.

local function fixProblem () ClearProblem('my-problem-1234') end local problem = { text = 'There is a problem!' , type = 'addons' , fix = fixProblem , id = 'my-problem-1234' } FireProblem(problem)
Output: