Obligatory "I ruined everything!" thread
#10
Rev 622: Added HOOK_UPDATING_SIGN and HOOK_UPDATED_SIGN hooks. They both receive the same arguments:
cWorld - the world where the sign is
x, y, z - the block coords of the sign
line1, line2, line3, line4 - the four lines of text in the sign

HOOK_UPDATING_SIGN is called before the sign text is updated. If the hook returns true, the sign text won't get updated. The hook can also return up to four texts, after the "false", those values will override the lines of text that the sign will receive. For example, the following Lua code flips the lines - the last line will become the first etc.:
Code:
function OnUpdatingSign(World, BlockX, BlockY, BlockZ, Line1, Line2, Line3, Line4)
    return false, Line4, Line3, Line2, Line1
end

HOOK_UPDATED_SIGN is called after the sign text is updated, it is just a notification. Plugins cannot change the text anymore. When the callback returns true, no more plugins will be called with the notification (not recommended).
Reply
Thanks given by:


Messages In This Thread
RE: Obligatory "I ruined everything!" thread - by xoft - 06-17-2012, 01:11 AM



Users browsing this thread: 4 Guest(s)