Shared definition of the cw_radio entity (print name Radio), with its off state data table variable and the ENT:GetFrequency and ENT:IsOff getters.

Summary

Methods

Draw()client
Draws the radio with a green status light, or a red one while it is off.
Explode()server
Plays a glass impact effect and impact sound at the radio.
Returns the frequency the radio is tuned to.
Returns the item the radio was placed from.
Draws the radio name and its frequency (or a no frequency note) as the target ID.
Sets up the citizen radio model, physics and 25 health.
IsOff()shared
Returns whether the radio is off.
Subtracts the damage from the radio's health and destroys it when it reaches 0.
Sets the frequency the radio is tuned to, networked to every client.
Sets the item the radio was placed from.
Turns the radio off or on.
Declares the off state data table variable.
Toggle()server
Turns the radio on when it is off and off when it is on.
Always transmits the radio to every client.

Methods

Draws the radio with a green status light, or a red one while it is off.

Plays a glass impact effect and impact sound at the radio.

Returns the frequency the radio is tuned to.

Returns

  • String The frequency, or an empty string when none is set

Returns the item the radio was placed from.

Returns

Draws the radio name and its frequency (or a no frequency note) as the target ID.

Parameters

  • x
  • y
  • alpha

Sets up the citizen radio model, physics and 25 health.

Returns whether the radio is off.

Returns

  • Boolean Whether the radio is off

Subtracts the damage from the radio's health and destroys it when it reaches 0.

Parameters

  • damageInfo

Sets the frequency the radio is tuned to, networked to every client.

Parameters

  • frequency String The frequency, such as 101.1

Sets the item the radio was placed from.

Parameters

  • itemTable Item The stationary radio item

Turns the radio off or on.

Parameters

  • off Boolean Whether the radio is off

Declares the off state data table variable.

Turns the radio on when it is off and off when it is on.

Always transmits the radio to every client.

Defined in