Jump to content

DayZ Backdoor Give Admin


illestiraqi

Recommended Posts

So I got the decompiled version of DayZ and I figured that anyone is allowed to make/remove anyone to/from admin/supporter and I want that changed, I want it to only allow anyone in the ACL group "Admin" to be allowed to use the command /add

Heres what I found:

function setGroup(playersource, command, teamName, targetString) 
  if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(playersource)), aclGetGroup("Admin")) then 
    do 
      local foundTargetPlayer = getPlayerWildcard(targetString) 
      if foundTargetPlayer then 
        if teamName ~= "admin" and teamName ~= "supporter" then 
          if teamName == "remove" then 
          else 
            outputChatBox("#FFFFFFCorrect names are admin, supporter and remove!", playersource, 27, 89, 224, true) 
            return 
          end 
        end 
        if teamName == "remove" then 
          value = false 
          account = getPlayerAccount(foundTargetPlayer) 
          setAccountData(account, "admin", value) 
          setAccountData(account, "supporter", value) 
          setElementData(foundTargetPlayer, "admin", value) 
          setElementData(foundTargetPlayer, "supporter", value) 
        else 
          value = true 
        end 
        account = getPlayerAccount(foundTargetPlayer) 
        accountname = getAccountName(account) 
        setAccountData(account, teamName, value) 
        setElementData(foundTargetPlayer, teamName, value) 
        if value == true then 
          outputChatBox("#FFFFFF" .. getPlayerName(foundTargetPlayer) .. " #FF0000 has been promoted to " .. teamName .. "!", getRootElement(), 27, 89, 224, true) 
        else 
          outputChatBox("#FFFFFF" .. getPlayerName(foundTargetPlayer) .. " #FF0000 lost his status...", getRootElement(), 27, 89, 224, true) 
        end 
      else 
        outputChatBox("#FFFFFFCan't find player! Did you input the correct name?", playersource, 27, 89, 224, true) 
      end 
    end 
  else 
    outputChatBox("#FFFFFFYou are not an admin!", playersource, 27, 89, 224, true) 
  end 
end 
addCommandHandler("add", setGroup) 
function banPLayer(playersource, command, targetString, banTime, reason) 
  if getAccountData(getPlayerAccount(playersource), "admin") == true then 
    do 
      local foundTargetPlayer = getPlayerWildcard(targetString) 
      local banTime = banTime or 0 
      local reason = reason or "Unknown" 
      if foundTargetPlayer then 
        do 
          local account = getPlayerAccount() 
          local ip = getPlayerIP(foundTargetPlayer) 
          local serial = getPlayerSerial(foundTargetPlayer) 
          local name = getPlayerName(foundTargetPlayer) 
          kickPlayer(foundTargetPlayer, playersource, reason) 
          addBan(ip, name, serial, playersource, reason, banTime * 86400) 
          outputChatBox("#FFFFFF" .. name .. " #FF0000 has been banned for " .. banTime .. " Day(Z)'s.", getRootElement(), 27, 89, 224, true) 
        end 
      else 
        outputChatBox("#FFFFFFCan't find player! Did you input the correct name?", playersource, 27, 89, 224, true) 
      end 
    end 
  else 
    outputChatBox("#FFFFFFYou are not an admin! ", playersource, 27, 89, 224, true) 
  end 
end 
addCommandHandler("playerban", banPLayer) 
function pmsgAdmin(playersource, command, ...) 
  local msg = table.concat({ 
    ... 
  }, " ") 
  if getAccountData(getPlayerAccount(playersource), "admin") == true then 
    outputChatBox("[GLOBAL]" .. getPlayerName(playersource) .. ": " .. msg, getRootElement(), 60, 200, 40, true) 
  else 
    outputChatBox("#FFFFFFYou are not an admin! ", playersource, 27, 89, 224, true) 
  end 
end 
addCommandHandler("pmsg", pmsgAdmin) 

Not sure if that's the complete script of the /add script but if it isn't tell me if itis, please and thank you help me fix this to let anyone in Admin ACL group to only use /add command, thank you.

Link to comment

Give your ACL, you need to be in admin group in ACL like this :

<group name="Admin"> 
        <acl name="Moderator"></acl> 
        <acl name="SuperModerator"></acl> 
        <acl name="Admin"></acl> 
        <acl name="RPC"></acl> 
        <object name="resource.admin"></object> 
        <object name="resource.webadmin"></object> 
        <object name="resource.DayZ"></object> 
        <object name="resource.DayZ_log-in"></object> 
        <object name="user.YOURNAME"></object> 
 </group> 

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...