Jump to content

antiban


Makaveli15

Recommended Posts

  • Administrators

I wasn't aware cancelEvent() couldn't stop the ban, however there's no need to loop through all the bans (highly inefficient), just use the banPointer parameter provided onPlayerBan

edit: just checked your errors to the script I provided, it looks to me like you either tried banning a player via console or you're using a custom ban script and not utilizing the responsibleElement argument within banPlayer()/addBan()

function verifyBan(banPointer, responsiblePlayer)
    if not isElement(responsiblePlayer) then print("responsibleElement is Console or none stated for current ban"); return false end
    if getElementType(responsiblePlayer) ~= "player" then return false end
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then
    	removeBan(banPointer)--Remove the ban on admin, using banPointer
    	addBan(getPlayerIP(responsiblePlayer), nil, getPlayerSerial(responsiblePlayer), root, "Banning other admins") --Ban the offending moderator
        outputChatBox (getPlayerName(responsiblePlayer).." has been banned for banning admins!", getRootElement(), 255, 0, 0) -- Output the ban.
    end
end
addEventHandler ( "onPlayerBan", getRootElement(), verifyBan )

 

Edited by LopSided_
Link to comment
8 minutes ago, LopSided_ said:

I wasn't aware cancelEvent() couldn't stop the ban, however there's no need to loop through all the bans (highly inefficient), just use the banPointer provided onPlayerBan

edit: just checked your errors to the script I provided, it looks to me like you either tried banning a player via console or you're using a custom ban script and not utilizing the responsibleElement argument within banPlayer()/addBan()

Ohh, wasn't aware of banPointer. =d

well, It's obviously the admin panel that is causing the ban, so you can't really stop/cancel it because admin panel is using "Console" to ban.

Link to comment

Go script lua on a cardboard box. Sometimes writing it down right in front of your eyes with nice ole sharpie will give you some neat inspiration. Myself, I like to store all of my awesome scripting work from within a cardboard hard drive box. So that when I log into my cardboard computer, the thing fires right up. And when it doesn't I throw it all in the woodstove and start over again with a sharpie and a pair of scissors. If only you could understand the importance and efficiency of a nice vaneer of platinum grade spray painted cardboard then you could maybe, just maybe get on my level. I receive my professionalism from my spiritual cardboard gods. My inspiration originates from the first cardboard of its time. I will show you the ways of the cardboard. My good friend please focus your attention to my platinum grade brown spray painted rare piece of artwork cardboard computer where all of my scripting skill started. Good day.
69a077870b986b05127ab2976cedc214--cardbo

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...