Git Product home page Git Product logo

saltychat-redm's Introduction

Salty Chat for RedM

An example implementation of Salty Chat for RedM OneSync and OneSync Infinity.

You can report bugs or make sugguestions via issues, or contribute via pull requests - we appreciate any contribution.

Join our Discord and start with Salty Chat!

Setup Steps

Before starting with the setup, make sure you have OneSync enabled and your server artifacts are up to date.

  1. Download the latest release and extract it into your resources
  2. Add start saltychat into your server.cfg
  3. Open config.json and adjust the variables
  "VoiceEnabled": true,
  "ServerUniqueIdentifier": "NMjxHW5psWaLNmFh0+kjnQik7Qc=",
  "MinimumPluginVersion": "",
  "SoundPack": "default",
  "IngameChannelId" : 25,
  "IngameChannelPassword": "5V88FWWME615",
  "SwissChannelIds": [ 61, 62 ],

Attantion: CFX team implemented a NUI blacklist and blocked local (127.0.0.1 and localhost) WebSocket connections. If the clientside can't connect to the WebSocket, make sure that you can resolve lh.v10.network:

  1. Open Windows Command Prompt by searching cmd
  2. Execute nslookup lh.v10.network

If it resolved to 127.0.0.1 then your issue is probably somewhere else, if not then you can use e.g. Google DNS servers.

Config

Variable Type Description
VoiceRanges float[] Array of possible voice ranges
EnableVoiceRangeNotification bool Enables/disables a notification when chaning the voice range
VoiceRangeNotification string Text of the notification when changing the voice range, {voicerange} will be replaced by the voice range
RadioType int Radio type which will be used for radio communication - see possible values
EnableRadioHardcoreMode bool Limits some radio functions like using the radio while swimming/diving and allows only one sender at a time
UltraShortRangeDistance float Maximum range of USR radio mode
ShortRangeDistance float Maximum range of SR radio mode
LongRangeDistace float Maximum range of LR radio mode
MegaphoneRange float Range of the megaphone (only available while driving a police car)
NamePattern string Naming schema of TeamSpeak clients, {serverid} will be replaced by the RedM server ID of the client, {playername} by the name of the client and {guid} by a generated GUID
RequestTalkStates bool Enables/disables TalkState's
RequestRadioTrafficStates bool Enables/disables RadioTrafficState's

Keybinds

Description Control Default QWERTY
Toggle voice range OpenJournal J
Talk on primary radio PushToTalk N
Talk on secondary radio OpenSatchelMenu B

Events

Client

SaltyChat_PluginStateChanged

Parameter Type Description
pluginState int Current state of the plugin (e.g. client is in a swiss channel), see GameInstanceState for possible values

SaltyChat_TalkStateChanged

Parameter Type Description
isTalking bool true when player starts talking, false when the player stops talking

SaltyChat_VoiceRangeChanged

Parameter Type Description
voiceRange float current voice range
index int index of the current voice range (starts at 0)
availableVoiceRanges int count of available voice ranges

SaltyChat_MicStateChanged

Parameter Type Description
isMicrophoneMuted bool true when player mutes mic, false when the player unmutes mic

SaltyChat_MicEnabledChanged

Parameter Type Description
isMicrophoneEnabled bool false when player disabled mic, true when the player enabled mic

SaltyChat_SoundStateChanged

Parameter Type Description
isSoundMuted bool true when player mutes sound, false when the player unmutes sound

SaltyChat_SoundEnabledChanged

Parameter Type Description
isSoundEnabled bool false when player disabled sound, true when the player enabled sound

SaltyChat_RadioTrafficStateChanged

Parameter Type Description
name string TeamSpeak name of the player
isSending bool true when radio traffic is received, false when radio traffic breaks or ends
isPrimaryChannel bool true radio traffic is received on primary channel, false when radio traffic is received on secondary channel
activeRelay string TeamSpeak name of the active relay (only if someone near you has the speaker enabled)

Exports

Client

GetVoiceRange

Returns the current voice range as float.

GetRadioChannel

Get the current radio channel.

Parameter Type Description
primary bool Whether to get the primary or secondary channel

GetRadioVolume

Returns the current radio volume as float (0.0f - 1.6f).

GetRadioSpeaker

Returns the current state of the radio speaker as bool (true speaker on, false speaker off).

SetRadioChannel

Set the current radio channel.

Parameter Type Description
radioChannelName string Name of the radio channel
primary bool Whether to set the primary or secondary channel

SetRadioVolume

Adjust the radio's volume

Parameter Type Description
volumeLevel float Overrides the volume in percent (0f - 1.6f / 0 - 160%)

SetRadioSpeaker

Turn the radio speaker on (true) or off (false).

Parameter Type Description
isRadioSpeakEnabled bool true to enable speaker, false to disable speaker

Server

SetPlayerAlive

Sets player IsAlive flag.

Parameter Type Description
netId int Server ID of the player
isAlive bool true if player is alive, otherwise false

AddPlayerToCall

Adds a player to a call, creates call if it doesn't exist.

Parameter Type Description
callIdentifier string Identifier of the call
playerHandle int Server ID of the player

AddPlayersToCall

Adds an array of players to a call, creates call if it doesn't exist.

Parameter Type Description
callIdentifier string Identifier of the call
playerHandles int[] Server IDs of the players

RemovePlayerFromCall

Removes a player from a call.

Parameter Type Description
callIdentifier string Identifier of the call
playerHandle int Server ID of the player

RemovePlayersFromCall

Removes an array of players from a call.

Parameter Type Description
callIdentifier string Identifier of the call
playerHandles int[] Server IDs of the players

SetPhoneSpeaker

Turns phone speaker of an player on/off.

Parameter Type Description
playerHandle int Server ID of the player
toggle bool true to turn on speaker, false to turn it off

SetPlayerRadioSpeaker

Turns radio speaker of an player on/off.

Parameter Type Description
netId int Server ID of the player
toggle bool true to turn on speaker, false to turn it off

SetPlayerRadioChannel

Sets a player's radio channel.

Parameter Type Description
netId int Server ID of the player
radioChannelName string Name of the radio channel
isPrimary bool true to set the channel as primary, false to set it as secondary

RemovePlayerRadioChannel

Removes a player from the radio channel.

Parameter Type Description
netId int Server ID of the player
radioChannelName string Name of the radio channel

SetRadioTowers

Sets the radio towers.

Parameter Type Description
towers float[][] Array with radio tower positions and ranges (X, Y, Z, range)

saltychat-redm's People

Contributors

blackflash5 avatar kono5alive avatar ktos93 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

saltychat-redm's Issues

Feature Request

Possible to let the Server decide for to use "whisper" or "mute/unmute"

It woould be nice to have the newest version with the possiblility to change what mode is desired.

If not would be sad but still okay, then i need to use a 2.X.X version.

How to change keybinding ?

I've found this in VoiceManager.cs

`private async Task OnControlTick()
{
Game.DisableControlThisFrame(0, Control.OpenJournal);
Game.DisableControlThisFrame(0, Control.PushToTalk);
Game.DisableControlThisFrame(0, Control.OpenSatchelMenu);

        if (Game.Player.IsAlive)
        {
            if (Game.IsControlJustPressed(0, Control.OpenJournal))
            {
                this.ToggleVoiceRange();
            }

            if (this.PrimaryRadioChannel != null)
            {
                if (Game.IsControlJustPressed(0, Control.PushToTalk))
                    BaseScript.TriggerServerEvent(Event.SaltyChat_IsSending, this.PrimaryRadioChannel, true);
                else if (Game.IsControlJustReleased(0, Control.PushToTalk))
                    BaseScript.TriggerServerEvent(Event.SaltyChat_IsSending, this.PrimaryRadioChannel, false);
            }

            if (this.SecondaryRadioChannel != null)
            {
                if (Game.IsControlJustPressed(0, Control.OpenSatchelMenu))
                    BaseScript.TriggerServerEvent(Event.SaltyChat_IsSending, this.SecondaryRadioChannel, true);
                else if (Game.IsControlJustReleased(0, Control.OpenSatchelMenu))
                    BaseScript.TriggerServerEvent(Event.SaltyChat_IsSending, this.SecondaryRadioChannel, false);
            }
        }

        await Task.FromResult(0);
    }`

I tried to replace Control.OpenSatchelMenu by Control.SpecialAbility, but it's not working

Switch on Teamspeak not working

Hello,
The players are not automatically switched in the channel in question. It worked perfectly well before the OneSync update.

The Server id is the right one, the Ingame channel too.

The resolve shows me 127.0.0.1

The websocket on the client side is created by default in 127.0.0.1:38088

Would you have an idea ?

Change Voice Range Key

Hello everyone.
How can I change the button for the range change. or where can i find it.
thanks

Player Won't change channel

I seem to be having some troubles /w getting other players who connect to the RedM server /w Teamspeak open to automatically change channels. It works for me, but will not work for them. No errors are produced in the console. It works for 1 player, but not another. Any Suggestions?

Salty chat port switch 8088 to 38088 client side issues

We noticed salty chat changed their port from 8088 to 38088 via the resource.

This caused issues for a lot of our clients, as their AppData\Roaming\TS3Client\plugins\SaltyChat\settings.json was keeping 8088 port as default even after an update to salty chat tsplugin 2.0

We've asked our users to delete the settings.json file and restart teamspeak so that it recreates the settings file with the correct new default port 38088.

Please fix the plugin so that it automatically changes the users port from 8088 to 38088 regardless of what their current settings.json says.

RedM Saltychat Onesync

Hey guys!

Actually we use Saltychat for FiveM and also for RedM. Both works very fine.
A few days ago RedM released an "Alpha" Stage for RedM Onesync. We updated our Server for it and Start test.
Now we found an issue with Saltychat. The Players can hear other Players over the Map. Its very weird and confusing.

Player 1 can hear Player 2, Player 3 can hear Player 4 but nothing else. Player 2 can hear Player 1, idk how to explain it correctly.
One time i walk to Player 1 and can hear Player 3. I walked out of Range and both gets muted.. it was very strange but we must stop the Test-Phase because with this issue its hard to make "Roleplay".

Is there any Update planned for the Onesync Compatibility?

Greezt Chico :)

Only connecting

Im Only Connecting in game websocket html 29 .. i have no idea can anyone help me ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.