abhi2011 Posted February 26, 2012 Author Share Posted February 26, 2012 Hey Guys this is my first tutorial. I know that there is a Mute player already but that one is the the form of a Command Button. So here is how to make a right click option.~~~SERVER SIDE ONLY~~~Go to server.vbp and in the server form (frmserver) press 'ctrl+E'. This should bring up the menu editor.Now choose a spot to add the Mute option. It should have that '….' thing before the caption. You should not add it you have to press enter on either of the give captions. Then type the name as 'mnuMute' and caption as whatever you want.Now the coding.Open the code of frmserver and find```Sub mnuDisconnectPlayer_Click()```After the end sub before```Sub mnuBanPlayer_click()```Add this```Sub mnuMute_Click() Dim Name As String Name = frmServer.lvwInfo.SelectedItem.SubItems(3) If Not Name = "Not Playing" Then Call ToggleMute(FindPlayer(Name)) End IfEnd Sub```In modDatabase after```Public Sub LoadOptions()```Add End Sub```Public Sub ToggleMute(ByVal index As Long) ' exit out for rte9 If index <= 0 Or index > MAX_PLAYERS Then Exit Sub ' toggle the player's mute If Player(index).isMuted = 1 Then Player(index).isMuted = 0 ' Let them know PlayerMsg index, "You have been unmuted and can now talk in global.", BrightGreen TextAdd GetPlayerName(index) & " has been unmuted." Else Player(index).isMuted = 1 ' Let them know PlayerMsg index, "You have been muted and can no longer talk in global.", BrightRed TextAdd GetPlayerName(index) & " has been muted." End If ' save the player SavePlayer indexEnd Sub```In modHandleData find```Private Sub HandleBroadcastMsg(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)```In the sub there will be```msg = Buffer.ReadString```Under that add```If Player(index).isMuted Then PlayerMsg index, "You have been muted and cannot talk in global.", BrightRed Exit Sub End If```In modTypes in 'Public Sub PlayerRec' just before End Type below```Dir As Byte```Add```isMuted As Byte```Well that is it! Also the mute will work only in Global! Ill find a way to mute in Map too!Credits: Riiicardo for showing me the tut ;)Robin:For making it–abhi2011 Link to comment Share on other sites More sharing options...
PVJsquad Posted February 26, 2012 Share Posted February 26, 2012 re-Post detected I look this code same withhttp://www.touchofdeathforums.com/smf/index.php/topic,75749.0.htmldid you really make it? Link to comment Share on other sites More sharing options...
abhi2011 Posted February 26, 2012 Author Share Posted February 26, 2012 i already added that there is already another one xcpt that there is a command button insted of a menu Link to comment Share on other sites More sharing options...
PVJsquad Posted February 26, 2012 Share Posted February 26, 2012 what's different? Link to comment Share on other sites More sharing options...
abhi2011 Posted February 26, 2012 Author Share Posted February 26, 2012 @GoldSide:> what's different?In the Roldiicks tut there is a command button! So i thought of y using a cmd button and y not use a right click option. That is why i made it and i also give full credit to him and Robin and I take none myself Link to comment Share on other sites More sharing options...
Justn Posted February 26, 2012 Share Posted February 26, 2012 I think this one is better than the other one =)why not post in source tutorials? Link to comment Share on other sites More sharing options...
abhi2011 Posted February 26, 2012 Author Share Posted February 26, 2012 @Justn:> I think this one is better than the other one =)> > why not post in source tutorials?Soz this is my first tut so i dont knoe where to add and stuff! Hope someone moves (or can I?) Link to comment Share on other sites More sharing options...
Growlith1223 Posted March 23, 2012 Share Posted March 23, 2012 @abhi2011:> Ill find a way to mute in Map too!For the map can't you just go:```If isMuted = 0 Then Call AddLog("Map #" & GetPlayerMap(index) & ": " & GetPlayerName(index) & " says, '" & Msg & "'", PLAYER_LOG) Call SayMsg_Map(GetPlayerMap(index), index, Msg, QBColor(White)) End If```Wouldn't that work? :/ Link to comment Share on other sites More sharing options...
Scott Posted March 23, 2012 Share Posted March 23, 2012 ```If Player(index).isMuted Then PlayerMsg index, "You have been muted and cannot talk in global.", BrightRed Exit Sub End If```You just need to add that same block of code to all the handlemsg subs server side easy. Link to comment Share on other sites More sharing options...
Growlith1223 Posted March 23, 2012 Share Posted March 23, 2012 Ah i totally forgot about the others xD Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now