Saltychat Remove and PMA install

This commit is contained in:
Miho931 2025-06-30 19:26:56 +02:00
parent 0bff8ae174
commit 2fd3c1fe70
94 changed files with 8799 additions and 5199 deletions

View file

@ -0,0 +1 @@
theme: jekyll-theme-midnight

View file

@ -0,0 +1,27 @@
## setTalkingMode | settingsCallback | radioACtive
## Description
These event is designed to allow third part applications (like a hud) use the current voice mode of the player, radio state, etc.
```lua
-- default voice mode is 2
local voiceMode = 2
local voiceModes = {}
local usingRadio = false
-- sets the current radio state boolean
AddEventHandler("pma-voice:radioActive", function(radioTalking) usingRadio = radioTalking end)
-- changes the current voice range index
AddEventHandler('pma-voice:setTalkingMode', function(newTalkingRange) voiceMode = newTalkingRange end)
-- returns registered voice modes from shared.lua's `Cfg.voiceModes`
TriggerEvent("pma-voice:settingsCallback", function(voiceSettings)
local voiceTable = voiceSettings.voiceModes
-- loop through all voice modes and add them to the table
-- the percentage is used for the voice mode slider if this was an actual UI
for i = 1, #voiceTable do
local distance = math.ceil(((i/#voiceTable) * 100))
voiceModes[i] = ("%s"):format(distance)
end
end)
```

View file

@ -0,0 +1,12 @@
## removePlayerFromCall
## Description
Removes the player from the call
## NOTE: This is just syntactic sugar for `setCallChannel(0)`
```lua
-- Removes the player from the call channel
exports['pma-voice']:removePlayerFromCall()
```

View file

@ -0,0 +1,12 @@
## removePlayerFromRadio
## Description
Removes the player from the radio
## NOTE: This is just syntactic sugar for `setRadioChannel(0)`
```lua
-- Removes the player from the radio channel
exports['pma-voice']:removePlayerFromRadio()
```

View file

@ -0,0 +1,25 @@
## setCallChannel | addPlayerToCall | SetCallChannel
## Description
Sets the local players call channel.
## Parameters
* **callChannel**: the call channel to join
```lua
-- Joins call channel 1
exports['pma-voice']:setCallChannel(1)
-- This will remove them from the call channel
exports['pma-voice']:setCallChannel(0)
```
addPlayerToCall is provided as a 'easier to read' version of setCallChannel.
```lua
-- Joins call channel 1
exports['pma-voice']:addPlayerToCall(1)
```

View file

@ -0,0 +1,14 @@
## setCallVolume
## Description
Sets the local players call channel volume
## Parameters
* **callVolume**: the call volume to set to between 0 - 100 percent
```lua
-- set the call volume to 50 percent
exports['pma-voice']:setCallVolume(50)
```

View file

@ -0,0 +1,26 @@
## setRadioChannel | addPlayerToRadio | SetCallChannel
## Description
Sets the local players radio channel.
## Parameters
* **radioChannel**: the radio channel to join
## NOTE: If the player fails the server side radio channel check they will be reset to no channel.
```lua
-- Joins radio channel 1
exports['pma-voice']:setRadioChannel(1)
-- This will remove the player from all radio channels
expots ['pma-voice']:setRadioChannel(0)
```
addPlayerToRadio is provided as a 'easier to read' alternative to setRadioChannel.
```lua
-- Joins radio channel 1
exports['pma-voice']:addPlayerToRadio(1)
```

View file

@ -0,0 +1,14 @@
## setRadioVolume
## Description
Sets the local players radio channel volume
## Parameters
* **radioVolume**: the radio volume to set to between 0 - 100 percent
```lua
-- sets the radio volume to 50 percent
exports['pma-voice']:setRadioVolume(50)
```

View file

@ -0,0 +1,17 @@
## setVoiceProperty | SetMumbleProperty | SetTokoProperty
## Description
Sets the voice property, currently the only use is to enable/disable radios and radio clicks.
## Parameters
* **property**: The property to set
* **value**: The value to set the property to
```lua
-- Enable the radio
exports['pma-voice']:setVoiceProperty('radioEnabled', true)
-- Disable radio clicks
exports['pma-voice']:setVoiceProperty('micClicks', false)
```

View file

@ -0,0 +1,3 @@
## Routing Buckets
pma-voice natively supports routing buckets.

View file

@ -0,0 +1,21 @@
## getPlayersInRadioChannel
## Description
Gets a list of all of the players in the specified radio channel.
## Parameters
* **radioChannel**: The channel to get all the members of
## Returns
Returns a table of all of the players in the specified radio channel
```lua
-- this will return all of the current players in radio channel 1
local players = exports['pma-voice']:getPlayersInRadioChannel(1)
for source, isTalking in pairs(players) do
print(('%s is in radio channel 1, isTalking: %s'):format(GetPlayerName(source), isTalking))
end
```

View file

@ -0,0 +1,22 @@
## addChannelCheck
## Description
Adds a channel check to radio channels.
## Parameters
* **channel**: The channel to add the check to.
* **function**: the function to call when the check is triggered, which should return a boolean of if the player is allowed to join the channel..
```lua
-- Example for addChannelCheck
-- this always has to return true/false
exports['pma-voice']:addChannelCheck(1, function(source)
if IsPlayerAceAllowed(source, 'radio.police') then
return true
end
return false
end)
```

View file

@ -0,0 +1,14 @@
## setPlayerCall
## Description
Sets the players call channel.
## Parameters
* **source**: The player to set the radio channel of
* **callChannel**: the radio channel to set the player to
```lua
exports['pma-voice']:setPlayerCall(source, 1)
```

View file

@ -0,0 +1,14 @@
## setPlayerRadio
## Description
Sets the players radio channel.
## Parameters
* **source**: The player to set the radio channel of
* **radioChannel**: the radio channel to set the player to
```lua
exports['pma-voice']:setPlayerRadio(source, 1)
```

View file

@ -0,0 +1,17 @@
## State Bag Getters/Setters
## Description
State bag getters are a little bit simpler, they just return the current value that is set in the state bag.
#### Note: If you're on the client and only using it on the current player, you can replace Player(source) with LocalPlayer
## Example for Proximity
```lua
local plyState = Player(source).state
local proximity = plyState.proximity
print(proximity.index) -- prints the index of the proximity as seen in Cfg.voiceModes
print(proximity.distance) -- prints the distance of the proximity
print(proximity.mode) -- prints the mode name of the proximity
```