Block Undo History 1.0.0 (olds.ro)
==================================
A Blockmaker add-on. Builders can undo and redo their last twenty block
actions (place, move, turn, delete) with two binds, so a mistake on a big
course needs no rebuilding by hand.
Requirements
- AMX Mod X 1.10.0.5490 or newer, fakemeta
- the olds.ro Block Maker core with the block API in
scripting/include/olds_blockmaker.inc (library "olds_blockmaker"): the
natives olds_bm_create_block / _move_block / _delete_block / _is_block /
_get_block and the forwards olds_bm_block_created / _moved / _deleted.
The LIB-0046 Block Maker 1.0.0 does not have this API yet; the plugin
does not load without it.
Install
1. Put include/olds_blockmaker.inc next to the compiler's includes, compile
scripting/olds_bmundo.sma and copy olds_bmundo.amxx to
addons/amxmodx/plugins/ (after the core in plugins.ini).
2. Copy data/lang/olds_bmundo.txt to addons/amxmodx/data/lang/.
Builders
bind "[" olds_bm_undo undo your last block action
bind "]" olds_bm_redo redo the last action you undid
olds_bm_history your two stacks, in the console
Admins
olds_bm_history from the server console lists every builder's stacks.
How it works
- Each create, move (or turn) and delete the core reports for a player is
pushed onto that player's undo stack, 20 deep: the 21st action drops the
oldest. A new action empties the redo stack.
- Undo of a place deletes the block; undo of a delete creates it again
through the core with the same type, origin, angles and size; undo of a
move or turn puts back the old origin and angles. Redo does the action
again. Every step goes through the core's natives, so its limits and
turned-off types still apply (a refused step is dropped with a message).
- Blocks carry an id of the add-on's own, so a block that was deleted and
brought back is still the same block for every stack.
- A builder's stacks hold only their own actions: nobody can undo another
builder's work. If someone else removed the block a step needs, the step
is dropped with a message.
- Actions with no player (console, layout loads) are not recorded.
- Stacks are cleared when the builder leaves and on map change.
No downloads.