Skip to content

Commit

Permalink
Update playerlist.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
ScrachStack authored Oct 27, 2023
1 parent 4817425 commit b4e66a5
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions client/playerlist.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
-- Define a variable to hold the selected player's server ID
local selectedPlayerServerId = nil

local players = {}
Expand Down Expand Up @@ -48,9 +47,18 @@ local kickReason = input[1]
if kickReason == '' then
kickReason = 'No Kick Reason.'
end
TriggerServerEvent('zaps:kick', selectedPlayerServerId, kickReason)
else

TriggerServerEvent('zaps:kick', selectedPlayerServerId, kickReason)
elseif args.action == 'ban' then
if selectedPlayerServerId then
local input = lib.inputDialog('Ban Panel', {'Reason for ban.', 'Expiry time (optional)'})
if not input then return end
local banReason = input[1]
local banExpiry = input[2] or 'Never'
if banReason == '' then
banReason = 'No Ban Reason.'
end
TriggerServerEvent('zaps:ban', selectedPlayerServerId, banReason, banExpiry)
end
end
end
end)
Expand Down

0 comments on commit b4e66a5

Please sign in to comment.