Blocking building on entire map?
Discussion in 'Rust Development' started by CZYSTARASOWOEUROPA, Sep 20, 2016.
-
Wulf Community Admin
Use the CanBuild hook, just return false.
-
U mean somthing like this:
Code:public object example(Planner plan, Construction prefab) { return false; } void CanBuild(Planner plan, Construction prefab) { example( plan, prefab); Puts("Blocked"); } -
Wulf Community Admin
If you want to outright block it no matter what, this is all you need:
The above code is shorthand of:Code:bool CanBuild() => false;
Since you aren't using any arguments, you don't need to include them.Code:bool CanBuild() { return false; }
If you want to send a message to the player trying to build:
Code:bool CanBuild(Planner plan) { var player = plan.GetOwnerPlayer(); PrintToChat(player, "Building blocked!"); return false; }
