From c786f79f57bd87c4292d7a9acf62bf9264d882c8 Mon Sep 17 00:00:00 2001 From: Beu Date: Wed, 12 Jul 2023 16:02:22 +0200 Subject: [PATCH] Add a notification in the chat when someone is kicked for being AFK --- LastManStanding.Script.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/LastManStanding.Script.txt b/LastManStanding.Script.txt index 651ceac..036a749 100644 --- a/LastManStanding.Script.txt +++ b/LastManStanding.Script.txt @@ -152,6 +152,14 @@ foreach (Event in PendingEvents) { } } +foreach (Event in UIManager.PendingEvents) { + if (Event.CustomEventType == "LMS_NotifyAFK") { + if (Event.CustomEventData.count > 0) { + UIManager.UIAll.SendChat("$ff9" ^ Event.CustomEventData[0] ^ " has been kicked for being AFK"); + } + } +} + StateMgr::Yield(); *** @@ -953,6 +961,8 @@ Void SetML() { // Check if player is AFK or not if (Last_AFKIdleTime > 0 && Input.TimeSinceLatestActivity > Last_AFKIdleTime) { log("Player is AFK"); + SendCustomEvent("LMS_NotifyAFK", [InputPlayer.User.Name]); + sleep(200); // Ensure that the Event is send to the server before leaving Playground.QuitServer(False); } else if (Last_AFKIdleTime > 0 && Input.TimeSinceLatestActivity > Last_AFKDisplayTime) { Frame_Global.Visible = True;