So I made this plugin called Safe Homes for my creative server. It makes it so you need building access in order to damage buildings. If you have building access or there is no cupboard present you can damage buildings.
The problem I am running into is when someone uses a rocket and shoots in from outside the permission zone, he still does damage. I cannot find a way to make it so even if they do this if the person doesn't have access at that location it doesn't deal the damage. Hopefully that makes sense.
Here is a link to my plugin: http://oxidemod.org/plugins/safe-homes.1367/
[DOUBLEPOST=1443986802,1443907401][/DOUBLEPOST]player.CanBuild() shows if someone can build if they either have permission or if no cupboard is present. Is there a way to determine if they can build because there is no cupboard available or if there is one?
Having issues with my new plugin
Discussion in 'Rust Development' started by Vypr, Oct 4, 2015.
-
Use player flags. HasBuildingPrivilege or InBuildingPrivilege should be suitable.
Code:[Flags] public enum PlayerFlags { InBuildingPrivilege = 1, HasBuildingPrivilege = 2, IsAdmin = 4, ReceivingSnapshot = 8, Sleeping = 16, Spectating = 32, Wounded = 64, IsDeveloper = 128, Connected = 256, VoiceMuted = 512, ThirdPersonViewmode = 1024, EyesViewmode = 2048, ChatMute = 4096 }Code:public bool HasPlayerFlag(BasePlayer.PlayerFlags f) { return (this.playerFlags & f) == f; }
