Hooks hooksserver
Part of Radios
Hooks called by Radios
Summary
Hooks
Lets plugins change a radio transmission before it is sent: what is said and who receives it.
Asks whether a player may speak on the radio.
Called on the server after a radio message has been sent.
Hooks
Lets plugins change a radio transmission before it is sent: what is said and who
receives it. Called on the server by Communications.speak_radio.
Parameters
- speaker Player the player talking on the radio
- info Map the transmission, to be modified in place: text (String what is said), frequency (Number, changing it does not change the listeners), item (Item the radio spoken into, or nil), listeners (List<Player> who receives the message over the radio wherever they are: at first the speaker and everyone with an enabled radio on the frequency in their hotbar; add or remove players to change that), eavesdrop (Boolean whether the players near the speaker overhear the message, true at first) and radius (Number how near they have to be, in units, before other plugins adjust it for each of them; 0 or less means that nobody overhears). A player who has been removed from the listeners still overhears the message when they are near the speaker, and the speaker always receives it
Called from
Call sites
Asks whether a player may speak on the radio. Called on the server when a player sends a chat message with a radio prefix and has an enabled radio in their hotbar, before anything is sent.
Parameters
- actor Player the player about to speak
- text String the message, without the radio prefix
- item_obj Item the radio the player speaks into;
item_obj:get_frequency()is the frequency of the transmission
Returns
- Boolean return false to keep the player from speaking on the radio
- String optional phrase or text to notify the player with
Called from
Call sites
PlayerRadioUsed(speaker, info, listeners, eavesdroppers)
server plugins/radios/plugin/sv_plugin.lua:238Called on the server after a radio message has been sent. Not called for a message that the ChatboxShouldSendMessage hook has canceled.
Parameters
- speaker Player the player who talked on the radio
- info Map the transmission as it was sent: text (String), frequency (Number) and item (Item the radio spoken into, or nil)
- listeners List<Player> the players who received the message over the radio, the speaker among them
- eavesdroppers List<Player> the players who overheard the message because they were near the speaker