Solved Does player have cupboard?

Discussion in 'Rust Development' started by Rusty, Dec 17, 2015.

  1. Code:
    function PLUGIN:TotalAccess(player)local sid = rust.UserIDFromPlayer(player)
    local total = true
    localbuildingPrivileges = global.BasePlayer._type:GetField("buildingPrivlidges", rust.PrivateBindingFlag() )
    bldpriv = localbuildingPrivileges:GetValue(player)
    for i=0, bldpriv.Count-1 do
      --print("Found a Tool Cupboard, getting names of allowed users")
      locAllowed = bldpriv[i].authorizedPlayers
     
      for u=0, locAllowed.Count-1 do
       --print(player.userID .. "/" .. locAllowed[u].userid)
       if player.userID ~= locAllowed[u].userid then total = false end
      
      
      end
     
     
    end
      if total == false then print("(INFO): " .. player.displayName .. " does not have access to all cupboards nearby.") end
      return totalend
    @Wulf is this code still accurate? Seems to only work sometimes
    [DOUBLEPOST=1450398690][/DOUBLEPOST]Seems to only work if u are the only one authed to that cupboard .. . . is this normal? is this where friends plugin comes in handy?
    [DOUBLEPOST=1450398979][/DOUBLEPOST]My goal is to return true if the player has all cupboard access nearby...welp!
    [DOUBLEPOST=1450400391][/DOUBLEPOST]think i got it, can we remove this post?
     
  2. @Rusty Set it the Title to 'Solved' and maybe provide info about what you have done to fix your issue - for people who later have the same problem and see this thread.