CanLockSign and CanUnlockSign not working
Discussion in 'Rust Development' started by miRror, Nov 3, 2016.
-
Wulf Community Admin
What exactly isn't working about them? How are you using them? Details are needed.
-
Code:
void CanUnlockSign(BasePlayer player, Signage sign) { SendReply(player, "CanUnlockSign works!"); }void OnSignLocked(Signage sign, BasePlayer player) { SendReply(player, "OnSignLocked works!"); }
but hook CanUpdateSign now worked:
Code:void CanUpdateSign(BasePlayer player, Signage sign) { SendReply(player, "CanUpdateSign works!"); } -
Wulf Community Admin
They haven't moved and are still called from what I can tell. -
@Wulf, I already checked this hooks, but they not working. What I'm doing wrong? Can you check by yourself?
-
Wulf Community Admin
Are you using an official build or did you patch on your own? -
Official build
-
Wulf Community Admin
Testing the hooks right now. -
Thanks.
[DOUBLEPOST=1478198357][/DOUBLEPOST]@Wulf, So, do they works? Thanks for reply. -
Wulf Community Admin
Not sure why, but that whole method in Rust isn't being called. You could use CanUpdateSign though, that's essentially the same thing.
-
Damn, that's bad. We really need this hooks, any way you can fix them?
-
Wulf Community Admin
If Rust doesn't use it, it won't be called. CanUpdateSign is literally the same as CanLockSign/CanUnlockSign with the exception of checking if the door is locked or not, which you can do if you need. -
CanUpdateSign not match, because it sends when contain of the table refreshes. He needs to block ability to "block action" (close for changing) tables.
-
Wulf Community Admin
You can block the action with CanUpdateSign, just return true. If Rust doesn't call the others, there isn't really anything that can be done. The CanUnlock and CanLock locations literally rely on CanUpdateSign and what it returns. -
Wulf Community Admin
Yes, what about it? You can see from your screenshot that both locking hooks call CanUpdateSign. The other locations is where the hooks are that are not working that you are complaining about, but the one for locking is never called. The best way to do it right now is with CanUpdateSign.
^ Quick and easy example of checking if they can unlock if they are admin.Code:bool CanUpdateSign(BasePlayer player, Signage sign) { if (Signage.IsLocked()) && !player.IsAdmin()) return false; }
