Curious about tool cupboard count
Discussion in 'Rust Development' started by Rick Assley, Mar 7, 2016.
-
The cupboard count a player is authorized on.
untested code:
playerID = player.userID; //player you're looking for
Code:int cnt = 0; foreach (BuildingPrivlidge bldpriv in UnityEngine.Resources.FindObjectsOfTypeAll<BuildingPrivlidge>()) { if (bldpriv is BuildingPrivlidge) { BuildingPrivlidge priv = (BuildingPrivlidge)bldpriv; // Loop through cupboards foreach (ProtoBuf.PlayerNameID plnid in priv.authorizedPlayers.ToList()) { // If the player is found if (plnid.userid == playerID) { cnt++; } } } } -
I keep running into the Protobuf.PlayernameID, but I always seem to encounter and error with it.
"The namespace PlayerNameID does not exist in the namespace Protobuf (are you missing an assembly reference?)"
Could you point me towards the correct reference material? I'm currently referencing the protobuf-net.dll
Something tells me that's not right as I would need to call values from Oxide with it.
