Advertisement
Bukz

Simple editing binds creation script...

Mar 17th, 2011
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.62 KB | None | 0 0
  1. alias editbind [
  2.   bind $arg1 (format "if $editing [%1] [%2]" $arg2 $arg3)
  3. ]
  4. docsection [Edit Binds];
  5. docident [editbind] [Binds a key to both edit mode and regular actions depending on the current game state.];
  6. docargument [K] [The key to bind.];
  7. docargument [E] [Body of code to execute if in editmode.];
  8. docargument [G] [Body of code to execute if not in editmode.];
  9.  
  10. // Examples
  11. // E - Toggles out of editmode if already in it, otherwise checks to ensure that you are not coop-editing, and are either playing a bot round or connected to a server before quick switching to knife, otherwise, it toggles into editmode.
  12. // editbind E [edittoggle] [if (&& (!= $gamemode 1) (|| $connected (curmodeattr bot))) [melee] [edittoggle]]
  13. // F - Converts the entire current selection into solid geometry if in editmode, otherwise it acts as a "toggle" bind, switching back and fourth between primary/secondary weapons when pressed.
  14. // editbind F [solid 1] [if (= (currentprimary) (curweapon)) [secondary] [primary]]
  15. // G - Converts the entire current selection into non-solid geometry if in editmode, otherwise it acts as a quick switch to grenades bind when pressed.
  16. // editbind G [solid 0] [grenades]
  17. // H - Merges the editing functions of the default H and I keybinds, checks to ensure that you are in editmode, and if you are looking upwards towards the ceiling cubes, will covert the current selection into a "ceiling heightfield", otherwise if you are looking downwards towards the floor cubes, will convert the current selection into a "floor heightfield".
  18. // editbind H [if (= $flrceil 0) [heightfield 0] [if (= $flrceil 2) [heightfield 2]]] []
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement