mirror of
https://github.com/BeamMP/BeamBase.git
synced 2025-07-01 15:25:25 +00:00
move bans to onPlayerAuth
This commit is contained in:
parent
a271438aca
commit
1fc2389ba1
28
main.lua
28
main.lua
@ -258,35 +258,21 @@ function onChatMessage(id, name, message)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function onPlayerAuth(name, role, isGuest)
|
function onPlayerAuth(name, _, isGuest, identifiers)
|
||||||
if isGuest and not allowGuests then
|
if isGuest and not allowGuests then
|
||||||
return "You must be signed in to join this server!"
|
return "You must be signed in to join this server!"
|
||||||
end
|
end
|
||||||
|
local id = identifiers.beammp
|
||||||
--local ids = MP.GetPlayerIdentifiers(playerID)
|
for _, player in pairs(bans) do
|
||||||
|
if id == player then
|
||||||
if not isGuest and role == "STAFF" then
|
print('Connecting Player "'..name..'" is banned from the server.')
|
||||||
|
return "You are banned from this server."
|
||||||
--table.insert(admins,
|
end
|
||||||
end
|
|
||||||
if not isGuest and role == "MDEV" then
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function onPlayerConnecting(id)
|
function onPlayerConnecting(id)
|
||||||
print('Player '..MP.GetPlayerName(id)..' ('..id..') connecting.')
|
print('Player '..MP.GetPlayerName(id)..' ('..id..') connecting.')
|
||||||
local identifiers = MP.GetPlayerIdentifiers(id)
|
|
||||||
for TYPE, ID in pairs(identifiers) do
|
|
||||||
--print(TYPE, ID)
|
|
||||||
for _, player in pairs(bans) do
|
|
||||||
if ID == player then
|
|
||||||
print('Connecting Player "'..MP.GetPlayerName(id)..'" is banned from the server.')
|
|
||||||
MP.DropPlayer(id, 'You are banned from the server.')
|
|
||||||
return 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
MP.RegisterEvent("onPlayerAuth","onPlayerAuth")
|
MP.RegisterEvent("onPlayerAuth","onPlayerAuth")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user