Hooks called by Area Display

Summary

Hooks

Called on the client right before an area notice is shown, once its text has been translated.
Called when a player enters a text area.
Called when a player leaves a text area.

Hooks

AdjustAreaDisplay(display, area)

client plugins/areadisplay/plugin/cl_plugin.lua:119

Called on the client right before an area notice is shown, once its text has been translated. Lets plugins change the notice in place, for example to put the time into its text. Do not return anything from a handler, or the plugins after it are not told.

function MyPlugin:AdjustAreaDisplay(display, area)
  display.text = display.text:replace('%t', os.date('%H:%M'))
end

Parameters

  • display Map the notice about to be shown, with the fields: text (String, clear it to show nothing), style (String ID of the display style, may be nil for the default one), color (Color of the text, nil for the color of the theme), duration (Number of seconds the notice stays, nil for the default of the theme) and area_id (String ID of the area, nil for a notice that does not belong to one)
  • area Map the area that is being announced, nil for a notice that does not belong to one

Called from

Call sites

PlayerEnteredTextArea(actor, area, cur_time)

shared plugins/areadisplay/plugin/sh_plugin.lua:252

Called when a player enters a text area. Runs on the server and on the client of that player. The client-side handler of Area Display shows the notice of the area. Do not return anything from a handler, or the plugins after it are not told.

Parameters

  • actor Player The player who has entered the area
  • area Map The area table, with the text, style and once fields
  • cur_time Number CurTime() of the check

Call sites

PlayerLeftTextArea(actor, area, cur_time)

shared plugins/areadisplay/plugin/sh_plugin.lua:259

Called when a player leaves a text area. Runs on the server and on the client of that player. Do not return anything from a handler, or the plugins after it are not told.

Parameters

  • actor Player The player who has left the area
  • area Map The area table, with the text, style and once fields
  • cur_time Number CurTime() of the check

Call sites

Defined in