コード例 #1
0
        private void QuitHandler(Player source, Slipe.Server.Peds.Events.OnQuitEventArgs eventArgs)
        {
            // Kick/Ban currently not working, returns "index is nil"
            string outputString = $"* Quit: {source.Name}#FF6464 ";

            outputString += eventArgs.QuitType switch
            {
                QuitType.Bad_Connection => $"has left the server (Bad Connection)",
                QuitType.Timed_Out => $"has left the server (Timed Out)",
                _ => $"has left the server.",
            };
            ChatBox.WriteLine(outputString, new Color(0xFF6464), true);
            Console.WriteLine(StripColors(outputString));
        }
コード例 #2
0
ファイル: RaceGamemode.cs プロジェクト: mta-slipe/Slipe-Race
 private void HandlePlayerQuit(Player source, Slipe.Server.Peds.Events.OnQuitEventArgs eventArgs)
 {
     players.Remove((RacePlayer)source);
 }