What would be the easiest way to open the door if i have the entity id only?. in uint format.
Code:if (OpenDoor == true && DoorId > 0) { DoorId.SetFlag(BaseEntity.Flags.Open, true); DoorId.SendNetworkUpdateImmediate(); }
Help with open door with doorID
Discussion in 'Rust Discussion' started by Ts3hosting, Feb 6, 2017.
-
Wulf Community Admin
You'd have to look up the door based on the ID. This may involve scanning all entities for a match.
-
would there be an easier way to save the info i need to the datafile for the call to make it not half to search so much?
[DOUBLEPOST=1486352492][/DOUBLEPOST]what would be the call to search threw i been scanning for examples but cant seem to find any? -
i think i got it with the xyz
Code:if (OpenDoor == true && DoorId > 0) { var newLocation = new Vector3(-1152, 6, 514); List<BaseEntity> doornear = new List<BaseEntity>(); Vis.Entities(newLocation, 1.0f, doornear); foreach (var door in doornear) { if (door.ToString().Contains("hinged")) { door.SetFlag(BaseEntity.Flags.Open, true); door.SendNetworkUpdateImmediate(); } } }
-
i got it figured out thanks again for putting up with me.