Skip to content

ZenRadioPlugin

Zenarchist edited this page May 6, 2026 · 5 revisions

NOTE: This mod is included in my modpack and can be enabled/disabled via ZenRadioPlugin in ZenModPackConfig.json

What is this?

This mod adds a transceiver tracking plugin to the game. It is mainly for advanced server admins and modders to utilize.

I recommend leaving this mod disabled unless you are using it.

How does it work?

Basically, this mod tracks all operational radios on the map via a plugin called ZenRadioPlugin

It automatically tracks all Personal Radios, Base Radios and any modded radio which inherits from either of these are tracked.

If this mod is enabled, then admins can use this plugin to trigger these radios to play a soundset, or check if a player is nearby a working radio.

For example I use it on my server for things like quests, survivor missions, and airdrop notifications so that only players who have a working radio nearby can hear the audio and receive the notifications for immersion purposes.

Code example

Here is an example of how to use it to 1) play a sound on all working radios, and 2) detect if a player has a working radio near them (or in their inventory):

ZenRadioPlugin radioPlugin = ZenRadioPlugin.Cast(GetPlugin(ZenRadioPlugin));
if (!radioPlugin)
	return;

// Play the given soundset on ALL working radios with batteries which are turned on
radioPlugin.PlaySoundset("yourSoundset");

// Cycle through all players on the server and send notifications to any player standing within 10 meters of a radio
array<Man> players = new array<Man>;
g_Game.GetWorld().GetPlayerList(players);

foreach (PlayerBase pb : players)
{
	if (pb && pb.IsAlive() && !pb.IsUnconscious() && !pb.IsPlayerDisconnected())
	{
		TransmitterBase radio = TransmitterBase.Cast(radioPlugin.GetNearestWorkingRadio(pb.GetPosition()));
		if (!radio)
			continue;
		
		// Do something with the radio - eg. send a notification only to players near a switched-on radio
		ZenNotifications.Notify(pb, "NotificationTitle", "NotificationMessage");
	}
}

NOTE: The full source code to the plugin can be found in ZenModPack/scripts/4_World/ZenModPack/Plugins/PluginBase/ZenRadioPlugin.c

ZEN'S MOD WIKI

Setup Guide

General Information


Utilities

My utility style mods for debugging etc.

Game Mechanics

Mods which affect game mechanics:

Gear / Objects

Mods which add gear to the game:

Server-Side Mods

Mods which run purely server-side:

Mods Not In Modpack

My standalone mods

Clone this wiki locally