OnUpdatingSign and OnUpdatedSign
#1
when do these get fired? becouse i am now working on a sign plugin where you can right-click on a sign to make the weather or time change but they both only get fired when i created a sign.
Reply
Thanks given by:
#2
Yes, they both fire only when the sign is created (when its text is set).
If you want to catch a rightclick on a sign, you need to use OnPlayerRightClick() hook.
Reply
Thanks given by:
#3
but how can the plugin know what text is on the sign?
Reply
Thanks given by:
#4
Use the cWorld::GetSignLines() function.
Reply
Thanks given by:
#5
how to use that function? i can't find it on the wiki.
Reply
Thanks given by:
#6
should be as easy as calling:
Code:
local Line1, Line2, Line3, Line4 = World:GetSignLines(BlockX, BlockY, BlockZ);
Reply
Thanks given by:
#7
it wants more parameters than only BlockX, BlockY and BlockZ. it wants 4 more in total.
Reply
Thanks given by:
#8
Hmm, then the ToLua is generating wrong lua glue code. True, it cannot know that those 4 parameters are out-only.
Until we fix that, pass in 4 more empty strings:
Code:
local Line1, Line2, Line3, Line4 = World:GetSignLines(BlockX, BlockY, BlockZ, "", "", "", "");
Reply
Thanks given by:
#9
i don't get the lines Sad when i do LOG(Line1) i get nothing :S
Reply
Thanks given by:
#10
Then build a debug version of MCServer, put a breakpoint in cChunk::GetSignLines() and try to find out why it's not working Smile
Debugging the problem is often the most fun, so why not try it?
Reply
Thanks given by:




Users browsing this thread: 2 Guest(s)