From 1b3c53f9cb0acabc135c6ccee123515d8ee3dac5 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sat, 23 Jan 2021 13:33:09 -0600 Subject: [PATCH] Add prompt util --- scripts/server/misc.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/server/misc.js b/scripts/server/misc.js index 54a27c4e..b543fdba 100644 --- a/scripts/server/misc.js +++ b/scripts/server/misc.js @@ -327,4 +327,21 @@ function checkPlayerSpawning() { } } +// --------------------------------------------------------------------------- + +function showPlayerPrompt(client, promptType, promptMessage, promptTitle) { + if(promptType == AG_PROMPT_NONE) { + return false; + } + + getPlayerData(client).promptType = promptType; + + if(canPlayerUseGUI(client)) { + showPlayerPromptGUI(client, promptMessage, promptTitle); + } else { + messagePlayerNormal(client, `❓ ${promptMessage}`); + messagePlayerInfo(client, `[#FFFFFF]Use [#AAAAAA]/yes or [#AAAAAA]/no`); + } +} + // --------------------------------------------------------------------------- \ No newline at end of file