#
Server Methods
This is a list of server methods that can be used.
ToVoiceClient
// Converts a Player to a VoiceClient
VoiceClient? client = player.ToVoiceClient();
MoveToVoiceChannel
// Moves a player into the configured ingame voice channel
player.MoveToVoiceChannel();
GetCurrentCall
// Gets the current phone call of a player
PhoneCall? call = player.GetCurrentCall();
GetCurrentCallId
// Gets the current call ID of a player
string? callId = player.GetCurrentCallId();
IsInCall
// Checks if a player is currently in a call
if (player.IsInCall()) { ... }
GetRadioFrequency
// Gets the radio frequency of a player
string frequency = player.GetRadioFrequency();
HasRadioFrequency
// Checks if a player has a radio frequency set
if (player.HasRadioFrequency()) { ... }
GetRadioChannel
// Gets the radio channel object of a player
RadioChannel? channel = player.GetRadioChannel();
SetForceMuted
// Forces a player to be muted or unmuted
player.SetForceMuted(true);
SetPhoneSpeakerEnabled (v1.0.1+)
// Enables / disables the phone speaker
player.SetPhoneSpeakerEnabled(true);
StartCall
// Starts a phone call between two players (call when target accepts)
Main.PhoneService.StartCall(caller, target);
EndCall
// Ends the current phone call for a player
Main.PhoneService.EndCall(player);
AddToCallGroup
// Adds a player to an existing call group (returns false if failed)
bool success = Main.PhoneService.AddToCallGroup(caller, target);
EnterRadioChannel
// Makes a player enter a radio channel with the specified frequency
Main.RadioService.EnterRadioChannel(player, "123.45");
LeaveRadioChannel
// Makes a player leave their current radio channel
Main.RadioService.LeaveRadioChannel(player);
GetRadioChannel
// Gets a radio channel by frequency
RadioChannel? channel = Main.RadioService.GetRadioChannel("123.45");
#
Server Methods
This is a list of server methods that can be used.
toVoiceClient
// Converts a Player to a VoiceClient
player.toVoiceClient(): VoiceClient | null;
moveToVoiceChannel
// Moves a player into the configured ingame voice channel
player.moveToVoiceChannel(): void;
getCurrentCall
// Gets the current phone call of a player
player.getCurrentCall(): PhoneCall | null;
getCurrentCallId
// Gets the current call ID of a player
player.getCurrentCallId(): string | null;
isInCall
// Checks if a player is currently in a call
player.isInCall(): boolean;
getRadioFrequency
// Gets the radio frequency of a player
player.getRadioFrequency(): string;
hasRadioFrequency
// Checks if a player has a radio frequency set
player.hasRadioFrequency(): boolean;
getRadioChannel
// Gets the radio channel object of a player
player.getRadioChannel(): RadioChannel | null;
setForceMuted
// Forces a player to be muted or unmuted
player.setForceMuted(forceMuted: boolean): void;
setPhoneSpeakerEnabled (v1.0.1+)
// Enables / disables the phone speaker
player.setPhoneSpeakerEnabled(phoneSpeakerEnabled: boolean): void;
startCall
// Starts a phone call between two players (call when target accepts)
phoneService.startCall(player: PlayerMp, target: PlayerMp): void
endCall
// Ends the current phone call for a player
phoneService.endCall(player: PlayerMp): void
addToCallGroup
// Adds a player to an existing call group (returns false if failed)
phoneService.addToCallGroup(caller: PlayerMp, target: PlayerMp): boolean
enterRadioChannel
// Makes a player enter a radio channel with the specified frequency
radioService.enterRadioChannel(player: PlayerMp, frequency: string): void
leaveRadioChannel
// Makes a player leave their current radio channel
radioService.leaveRadioChannel(player: PlayerMp): void
getRadioChannel
// Gets a radio channel by frequency
radioService.getRadioChannel(frequency: string): RadioChannel | undefined