Sign in to follow this  
illestiraqi

DayZ Backdoor Give Admin

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.

Share this post


Link to post

The "/add" command already uses ACL checking, the others remain using account data, simply use the same way "/add" does it.

Share this post


Link to post

I am myself an administrator using the /add admin George command and before I had no admin at all I gave myself it and now I can't give no one nor can I promote/demote anyone it just says you are not admin or somewhat but I am, why?

Share this post


Link to post

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> 

Share this post


Link to post

Do you have a decompiled version of your DayZ scripts @-ffs-Sniper? It'd be much appreciated man, my friends are looking forward to new things and I can do nothing with the current one given that's compiled please.

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.