Hello guys, how can i make my script able to ban someone who tried to ban me on server?for example somebody tries to ban me, but gets ban instead of me and for me nothing happens
here's the undone one, which blocks to ban all admins
function onBan ( _, Player )
for _, ban in ipairs( getBans() )do
if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(source)),aclGetGroup("Admin")) then
if getPlayerName ( source ) == getBanNick( ban ) then
if ( removeBan ( ban ) ) then
outputChatBox("This is a bad idea. :)",Player , 255, 255, 255, true)
end
end
end
end
end
addEventHandler ( "onPlayerBan", root, onBan )