GrubaS Posted September 4, 2017 Posted September 4, 2017 Hello, i want to make if someone ban me it's baning hisself but i made only Anti Ban code: function autounban(banPointer, ban) local serial = getBanSerial(banPointer) local ip = getBanIP(banPointer) for index, ban in pairs(getBans()) do if getBanSerial(ban) == "6EC0B83C2985F3BB69D1C4DD3467BCA1" or getBanIP(ban) == "83.24.115.15" then removeBan ( ban, getRootElement() ) end end end addEventHandler("onPlayerBan",getRootElement(),autounban) I tried add before 7 line banPlayer function but it's doesn't work
Moderators IIYAMA Posted September 4, 2017 Moderators Posted September 4, 2017 function autounban(banPointer, responsibleElement) Small edit, a variable which was wrong named. The second parameter doesn't return the ban pointer(which is given by the first parameter), but the responsibleElement. YET, this is not the reason why it doesn't work. The reason is most likely: Missing ACL rights Give the resource admin rights and try again. 1
GrubaS Posted September 4, 2017 Author Posted September 4, 2017 (edited) bro, it's works fine (script) and anti baning my serial but i want if someone will try ban me it will ban hisself u know what i mean? Edited September 4, 2017 by GrubaS
Moderators IIYAMA Posted September 4, 2017 Moderators Posted September 4, 2017 (edited) Check if there is a responsibleElement. If this is true, then ban the responsibleElement. Place it between line 1 and 4. Edited September 4, 2017 by IIYAMA 1
GrubaS Posted September 4, 2017 Author Posted September 4, 2017 (edited) I tried responsibleElement it in outputChatBox( getPlayerName( responsibleElement ).."") but debugscript says thats it's bad argument.. Edited September 4, 2017 by GrubaS
Moderators IIYAMA Posted September 4, 2017 Moderators Posted September 4, 2017 That means that there is no responsibleElement at the moment you receive the ban. Debug your code with iprint: iprint(responsibleElement) 1
Malone. Posted September 4, 2017 Posted September 4, 2017 (edited) it's not about debug it's about the script as i see you're script get auto ban function, so if you need help notice me i can give you the right code for it. Edited September 4, 2017 by Malone.
Moderators IIYAMA Posted September 5, 2017 Moderators Posted September 5, 2017 (edited) function autounban(banPointer, responsibleElement) local serial = getBanSerial(banPointer) local ip = getBanIP(banPointer) if isElement(responsibleElement) then banPlayer (responsibleElement, true, false, true, "Your mom", "I love you", 0) else iprint("Player", getPlayerName(source), "got banned by:", responsibleElement or "<unknown>", ", but couldn't be banned back.") end for index, ban in pairs(getBans()) do if getBanSerial(ban) == "6EC0B83C2985F3BB69D1C4DD3467BCA1" or getBanIP(ban) == "83.24.115.15" then removeBan ( ban, getRootElement() ) end end end addEventHandler("onPlayerBan",getRootElement(),autounban) Try this sample. If the results are negative, then the problem lies with the resource that bans players. If the resource that bans players do not pass the right responsible element, you can unfortunately not figure out which player bans which player. @Malone. Eh? seriously? Edited September 5, 2017 by IIYAMA
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now