Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Leaving the Mute Player


Riiicardoo
 Share

Recommended Posts

**Server~Side**
In **frmServer** in Tab **Players** crate 1 **commandbutton** called:

> Name: mnumMute
> Caption: Mute

2 clicks and add:

```
    Dim Name As String
    Name = frmServer.lvwInfo.SelectedItem.SubItems(3)

    If Not Name = "Not Playing" Then
        Call ToggleMute(FindPlayer(Name))
    End If
```
After the **modDatabase** look for:

```
Public Sub LoadOptions()

    Options.Game_Name = GetVar(App.Path & "\data\options.ini", "OPTIONS", "Game_Name")
    Options.Port = GetVar(App.Path & "\data\options.ini", "OPTIONS", "Port")
    Options.MOTD = GetVar(App.Path & "\data\options.ini", "OPTIONS", "MOTD")
    Options.Website = GetVar(App.Path & "\data\options.ini", "OPTIONS", "Website")

End Sub
```
Below add:

```
Public Sub ToggleMute(ByVal index As Long)
    ' left  out for rte9
    If index <= 0 Or index > MAX_PLAYERS Then Exit Sub

    'Toggle player mute
    If Player(index).isMuted = 1 Then
        Player(index).isMuted = 0
        ' Let them know
        PlayerMsg index, "You were Discilenciado and can already speak of change", BrightGreen
        TextAdd GetPlayerName(index) & " Você foi Discilenciado."
    Else
        Player(index).isMuted = 1
        ' Let them know
        PlayerMsg index, "You have been silenced and can not talk about change", BrightRed
        TextAdd GetPlayerName(index) & " Você foi Silenciado."
    End If

    ' Save the player
    SavePlayer index
End Sub
```
look for:

```
Private Sub HandleBroadcastMsg(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
```
beneath:

```
Msg = Buffer.ReadString
```
add:

```
If Player(index).isMuted Then
        PlayerMsg index, You have been silenced and can not talk about change", BrightRed
        Exit Sub
    End If
```
look for:

```
' Position
MAP As Long
    x As Byte
    y As Byte
    Dir As Byte
```
add below:

```
'mute
isMuted As Byte
```
Credits: Robin
Link to comment
Share on other sites

  • 3 months later...
@GoldSide:

> why The player Not muted Only
> There are only written warnings
> can stiill speak

@Riiicardoo:

> ```
> If Player(index).isMuted Then
>         PlayerMsg index, You have been silenced and can not talk about change", BrightRed
>         Exit Sub <-------HERE
>     End If
> ```

You would not be able to talk, the line marked HERE is what causes this, it stops everything after it from running.  So with this it gets the msg string, but never uses it.
Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...