Shavronne

Member
in my server i want to make speech delay like: when players says something he cant say anything for two seconds. how can i make that. pls help
 
In Playermobile.cs You can add a timer to OnSpeech to restrict them for x seconds, OnSaid shows how squelched is implemented!

C#:
        public override void OnSpeech(SpeechEventArgs e)
        {
            if (SpeechLog.Enabled && NetState != null)
            {
                if (m_SpeechLog == null)
                {
                    m_SpeechLog = new SpeechLog();
                }

                m_SpeechLog.Add(e.Mobile, e.Speech);
            }
        }

        public override void OnSaid(SpeechEventArgs e)
        {
            if (m_TempSquelched)
            {
                if (Core.ML)
                {
                    SendLocalizedMessage(500168); // You can not say anything, you have been muted.
                }
                else
                {
                    SendMessage("You can not say anything, you have been squelched."); //Cliloc ITSELF changed during ML.
                }

                e.Blocked = true;
            }
            else
            {
                base.OnSaid(e);
            }
        }
 
getting error for "m_TempSquelched"
players spaming some emotes with many colors. and its makes lag so hard. what can i do ?
 
Or [kick to kick them off the server, then they have to log back in :) but if they continue you should consider to ban them for like a week at least. :)
 

Active Shards

Donations

Total amount
$50.00
Goal
$1,000.00
Back