From 4000b2dd9f910f69f680e2ba8f6a246086542ad8 Mon Sep 17 00:00:00 2001 From: Zaps6000 <122732007+Zaps6000@users.noreply.github.com> Date: Tue, 26 Sep 2023 15:06:58 -0500 Subject: [PATCH] Not done but feel free to make a pr --- client/playerlist.lua | 52 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 client/playerlist.lua diff --git a/client/playerlist.lua b/client/playerlist.lua new file mode 100644 index 0000000..690adcc --- /dev/null +++ b/client/playerlist.lua @@ -0,0 +1,52 @@ +local players = {} +local playerList = GetActivePlayers() + +for _, playerId in ipairs(playerList) do + local playerName = GetPlayerName(playerId) + table.insert(players, { + label = playerName, + value = playerId, + icon = 'person', + args = {id = GetPlayerServerId(playerId)} + }) + +end +lib.registerMenu({ + id = 'zaps-rd-onlineplayers', + title = 'Online Players', + position = 'top-right', + options = players +}, function(selected, scrollIndex, args) + + lib.showMenu('zaps-rd-onlineplayers-options') +end) + lib.registerMenu({ + id = 'zaps-rd-onlineplayers-options', + title = 'Online Player Options', + position = 'top-right', + options = { + {label = 'Kick Player', icon = 'k', args = {id = 'kick'}}, + {label = 'Ban Player', icon = 'ban', args = {id = 'openselfoptions'}}, + {label = 'Send Private Message', icon = 'message', args = {id = 'dm'}}, + {label = 'Teleport To Player', icon = 'wand-magic', args = {id = 'tp'}}, + + } + }, function(selected, scrollIndex, args) + if args.id == 'dm' then + privatemessage() + elseif args.id == 'kick' then +-- Might add ban also ??? + + end + end) + + +function privatemessage(messagecontents) + local input = lib.inputDialog('Private Message', {'Message'}) + + if not input then return end + input[1] = messagecontents +-- Needs Finished + +end +