-
Notifications
You must be signed in to change notification settings - Fork 6
ZenRadioPlugin
NOTE: This mod is included in my modpack and can be enabled/disabled via ZenRadioPlugin in ZenModPackConfig.json
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.
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.
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
All my mods are open-source and published under the Mozilla Public License Version 2.0. Any mods based on my code must be open-source - no obfuscation!
You can modify/reupload/repack my mods if you like, but please credit any original authors/3D model/3rd-party asset creators, and keep in mind any future updates I make will not be automatically applied to repacked mods so make sure to check back from time to time for bugfixes and improvements.
If you find my mods useful, please consider buying me a coffee - it's not expected but very much appreciated: https://buymeacoffee.com/zenarchist
- General Setup Guide
- Core Mod Setup Guide
- ZenModPack Master Config
- Various Info
- Known Bugs & Issues
- Report Bug
My utility style mods for debugging etc.
Mods which affect game mechanics:
- ZenAlcohol
- ZenAllowMapBagSlot
- ZenAntiCombatLogout
- ZenAutoConvertStash
- ZenAutoStackItems
- ZenAutoWinterDetect
- ZenAutoRun
- ZenBasebuildingConfig
- ZenBatteryPASPersistence
- ZenBetterChatFont
- ZenBrokenGlasses
- ZenBuildingDescription
- ZenCarAttachments
- ZenCarBatteryIcon
- ZenCarCompass
- ZenCarGlovebox
- ZenCarsCutDownTrees
- ZenCanteenTablets
- ZenCatchRain
- ZenCauseOfDeath
- ZenChickenCoops
- ZenCraftingSounds
- ZenCraftRagHands
- ZenComboLocks
- ZenCombineJSON
- ZenDropRuinedClothing
- ZenDynamicZoneLoot
- ZenEarPlugs
- ZenFireFuel
- ZenFireWood
- ZenFireplaceStick
- ZenFishingConfig
- ZenFixCarAttachmentGUI
- ZenGraves
- ZenGroundCleaning
- ZenHideGearInCars
- ZenHints
- ZenHologram
- ZenHologramControls
- ZenImmersiveChatHUD
- ZenImmersiveLogin
- ZenInformWeaponStateBug
- ZenInventoryAnimation
- ZenKnifeGardens
- ZenLeftovers
- ZenLogPiles
- ZenMagObfuscation
- ZenMap
- ZenMicCheck
- ZenNotifications
- ZenOpenCansRock
- ZenPainting
- ZenPimpMyRide
- ZenRadioPlugin
- ZenRebuildableWells
- ZenRepairJSON
- ZenRepairPumps
- ZenRepairWells
- ZenServerGUI
- ZenShove
- ZenSplitUI
- ZenSleep
- ZenStaminaSlope
- ZenTerritories
- ZenWeaponEngrave
- ZenWoodHealth
- ZenZombieDoors
Mods which add gear to the game:
- ZenArtillery
- ZenBackwardsCaps
- ZenBookshelf
- ZenBunnyMasks
- ZenCamoCamp
- ZenCarWorkbench
- ZenChess
- ZenChristmasTreeCraft
- ZenConcussionGrenade
- ZenDoubleArmbands
- ZenFlask
- ZenFlint
- ZenGhillie
- ZenJameson
- ZenLadders
- ZenMusic
- ZenNotes
- ZenRaidAlarm
- ZenRaybans
- ZenRunes
- ZenStaticObjects
- ZenSwissKnife
- ZenTimeBomb
- ZenTireRack
- ZenTreasure
- ZenTreehouse
- ZenVikingAxe
- ZenZippoLighter
Mods which run purely server-side:
- ZenBloodDrips
- ZenCampSites
- ZenDynamicZoneLoot
- ZenLootCyclingDetection
- ZenNightConfig
- ZenPersistentTrees
- ZenShelterCargo
- ZenTreesplosions
- ZenZombieController
- ZenZombieConfig
- ZenJameson
My standalone mods