Scratso Posted February 20, 2014 Author Share Posted February 20, 2014 In EO2 (Robin's final version thingy), I want to make the server listen to Map Chat. This is so I can moderate my game since there's like 100 maps and all I hear is Global. If anyone knows how or a good tutorial, please help me. Thanks in advance!EG, it would put in server like "[Map#1] Scratso: Message" for example.Edit:Thanks, Mod Matt! Link to comment Share on other sites More sharing options...
Matt Posted February 20, 2014 Share Posted February 20, 2014 ```Private Sub HandleSayMsg(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim Msg As String Dim i As Long Dim Buffer As clsBuffer Set Buffer = New clsBuffer Buffer.WriteBytes Data() Msg = Buffer.ReadString ' Prevent hacking For i = 1 To Len(Msg) ' limit the ASCII If AscW(Mid$(Msg, i, 1)) < 32 Or AscW(Mid$(Msg, i, 1)) > 126 Then ' limit the extended ASCII If AscW(Mid$(Msg, i, 1)) < 128 Or AscW(Mid$(Msg, i, 1)) > 168 Then ' limit the extended ASCII If AscW(Mid$(Msg, i, 1)) < 224 Or AscW(Mid$(Msg, i, 1)) > 253 Then Mid$(Msg, i, 1) = "" End If End If End If Next Call AddLog("Map #" & GetPlayerMap(index) & ": " & GetPlayerName(index) & " says, '" & Msg & "'", PLAYER_LOG) Call SayMsg_Map(GetPlayerMap(index), index, Msg, QBColor(White)) Set Buffer = NothingEnd Sub```That's the sub that handles saying messages. Not too far from there is a sub that handles global messages. You'll find all you need there. Link to comment Share on other sites More sharing options...
Scratso Posted February 20, 2014 Author Share Posted February 20, 2014 "Variable not defined" and it points at the top line Link to comment Share on other sites More sharing options...
Matt Posted February 20, 2014 Share Posted February 20, 2014 I'd need to see what you wrote to figure out what went wrong ;P Link to comment Share on other sites More sharing options...
Scratso Posted February 20, 2014 Author Share Posted February 20, 2014 ```' ::::::::::::::::::::' :: Social packets ::' ::::::::::::::::::::Private Sub HandleSayMsg(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim Msg As String Dim i As Long Dim Buffer As clsBuffer Set Buffer = New clsBuffer Buffer.WriteBytes Data() Msg = Buffer.ReadString ' Prevent hacking For i = 1 To Len(Msg) ' limit the ASCII If AscW(Mid$(Msg, i, 1)) < 32 Or AscW(Mid$(Msg, i, 1)) > 126 Then ' limit the extended ASCII If AscW(Mid$(Msg, i, 1)) < 128 Or AscW(Mid$(Msg, i, 1)) > 168 Then ' limit the extended ASCII If AscW(Mid$(Msg, i, 1)) < 224 Or AscW(Mid$(Msg, i, 1)) > 253 Then Mid$(Msg, i, 1) = "" End If End If End If Next Call AddLog("Map #" & GetPlayerMap(index) & ": " & GetPlayerName(index) & " says, '" & Msg & "'", PLAYER_LOG) Call SayMsg_Map(GetPlayerMap(index), index, Msg, QBColor(White)) Call AddText("[Map " & GetPlayerMap(index) & "]" & GetPlayerName(index) & ":" & Msg) Set Buffer = NothingEnd Sub```I added the line:``` Call AddText("[Map " & GetPlayerMap(index) & "]" & GetPlayerName(index) & ":" & Msg)``` Link to comment Share on other sites More sharing options...
Matt Posted February 20, 2014 Share Posted February 20, 2014 I believe EO 2.0 uses TextAdd instead of AddText Link to comment Share on other sites More sharing options...
Scratso Posted February 20, 2014 Author Share Posted February 20, 2014 Oh. i'll try that then.> I believe EO 2.0 uses TextAdd instead of AddTextIt worked! Thank you :D Link to comment Share on other sites More sharing options...
Matt Posted February 20, 2014 Share Posted February 20, 2014 You're welcome ^_^ 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