Syntax: enablefeatures(featurebits)


The enablefeatures function is used to control the display of various elements in the built-in heads-up display. Each feature is assigned a bit value, and a combination of these bits uniquely describes a combination of features.

The features include:
1M key (map)
2P key (pause)
4Q key (weapon select)
8R key (show ratings)
0x10S+A key combination for dropping items
0x20S+D key combination for switching weapons
0x40TAB key (if disabled then you cannot switch to the chat field with TAB)
0x80Display of chat text
0x100Display of the hearts over player heads
0x200Display of nicknames
0x400Toall/PM-icons on the minimap
0x800Right-click on players opens their profile
0x1000Emoticons (disable it if you want to do other stuff with control+keys)
0x2000Alt+5 for making snapshots (deprecated)
0x4000Alt+8/9 for zooming (deprecated)
0x8000Allows F2 output (savelog()/echo())
allfeaturesAll of the previously stated feature flags enabled

Since each feature is represented by a single, unique bit, we can use either bit operations (~, xor, |, and &), or the usual arithmetic operations (+, -) to create a collection of features.


function onCreated() {
  enablefeatures(allfeatures xor (0x80 & 0x100 & 0x2000 & 0x4000));
... will allow all features except chat, overhead hearts, Alt+5, and Alt+8/9.



There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki