AMX Mod X 1.8.0 Changes

From AlliedModders Wiki
Jump to: navigation, search

AMX Mod X 1.8 is a large release with many changes, both to the development API and user-mode features.

Per-Map Features

You can now have per-map prefix-based configuration files for plugins and .cfg scripts.

  • configs/maps/prefix_<prefix>.cfg (for example)
    • configs/maps/prefix_de.cfg will run on any de_* map.
  • configs/maps/plugins-<prefix>.ini (for example)
    • configs/maps/plugins-de.ini will load all contained plugins on any de_* map.

Command Flag Changing

You can now change the access flags required by commands without recompiling or editing scripts. AMX Mod X caches all command flags in configs/cmdaccess.ini, where they can be easily edited.

A few notes:

  • To disable this feature for a single command in the ini file, set its access flag in the ini file to "*"
  • To disable this feature entirely, change "disableflagman 0" in core.ini to be "disableflagman 1"
  • In the default state, the flag manager will try to guess which commands should be excluded. The rules are as follows:
    • All commands with the default access (-1, not ADMIN_ALL) are not included
    • All commands that begin with "say" are not included
    • To disable flag manager for storing commands from inside of the plugin, set the new 5th parameter of register_clcmd or register_concmd to 0.
    • To tell flag manager to always store your command, even if the filter would have ruled it out set the 5th parameter to 1.
    • The default value of this new 5th parameter is -1, this means it will treat it as if the parameter did not exist.
    • Note: Even if a plugin exclusively tells flag manager to hide the command, the admin can insert it into cmdaccess.ini and it will be used.

Also, changes to access will not take effect until a map change. Additionally, the automatic writing of newly detected commands does not occur until map change.

Ham Sandwich

Ham Sandwich is a very powerful module by sawce which can hook and call virtual CBaseEntity functions on a variety of mods. For more information, see the file.

Dynamic Global Arrays

Also by sawce, dynamic global arrays are now available in AMX Mod X. You can read the full specs in

Additionally, the hardcoded limits of a few plugins have been lifted:

  • Admins are now dynamic and not limited to MAX_ADMINS.
  • Mapchooser no longer has a predefined map limit.
  • Maps menu no longer has a predefined map limit.
  • imessage no longer has a predefined message limit.

Backwards Compatibility Issues

Before AMX Mod X 1.8.0, menu_create would automatically call register_menucmd. This was, in fact, a bug, as the calling conventions between register_menucmd and new menu callbacks are entirely different. This was a serious error and it was removed in AMX Mod X 1.8.0.

This accidental functionality was not documented API. However, some plugins have been found to mistakenly abuse this property. An example is calling menu_create and having show_menu calls run through your menu_create callback instead of using menu_display properly.

The old functionality cannot be enabled globally because it is a serious error and causes many problems. The following plugins would otherwise break on AMX Mod X 1.8.0, and we have specifically inserted backwards compatibility shims for them. If your plugin's menus have broken in 1.8.0 and need the shim enabled, please contact the development team via the bug report tool.

  • war3ft.amxx, versions 3.0 RC1 through 3.0 RC8. No compatibility is provided for RC9+.

Removed Downloads

Downloads for AMX Mod X 0.1, 0.15, and 0.16 have been removed from the SourceForge downloads page. These builds are highly legacy and no longer used, and were removed to avoid clutter and confusion. Source code is still available via /svnroot/amxmodx/tags.

Downloads for "Bin Logging" builds have been removed. These builds had terrible performance and were fairly unusable. They also had little use to the development team in fixing actual problems. If your plugin crashes, file a bug report and the development team can work with you in determining the cause.


Overall Changes

  • Added a new module, Ham Sandwich, for hooking and calling virtual CBaseEntity functions in mods.
  • Command flags are now initially dumped to disk and can be edited via configs/cmdaccess.ini.
  • Added am48738: Romanian translation from X-5173.
  • Added am50741 and am43830: per-map plugins files can now be prefixed based.
  • Added amb17: New menu rendering is now more consistent; non-consistent controls are deprecated.
  • Added amb32: The server console commands "amxx cvars" and "amxx cmds" can now filter by plugin.
  • Added amb122: Log file names now include a four-digit year.
  • Fixed amb18: New menus are now properly destroyed if overridden.
  • Fixed amb46: is_user_bot had some false positives.
  • Fixed amb69: Fixed Metamod trying to reload AMX Mod X against a poorly configured clock.
  • Fixed amb207: New menus now display "0" instead of "10."
  • Fixed amb208: New menus did not reset callback results after each call.
  • Fixed amb200: Dynamic/fake natives were not re-entrant.
  • Fixed amb244: Run-time errors blocked forwards.
  • Fixed amb305: Core crashed on mods that removed the standard mp_timelimit cvar.
  • Fixed many various internal new menu rendering and item selection bugs. This may have introduced backwards compatibility problems with plugins relying on undocumented bugs. In specific, menu_create no longer calls register_menucmd and thus new menu callbacks will now only be invoked strictly from a call to menu_display.

Scripting Changes

  • All include files are now #pragma semicolon safe.
  • New menu functions are now in a separate, newly documented include file (
  • Added natives for dynamic global arrays.
  • Added a new, magic any tag from SourceMod.
  • Added a charsmax macro for safe sizeof(string)-1 usage.
  • Added set_pcvar_string().
  • Added LookupLangKey().
  • Added SQL_QuoteString().
  • Added [g|s]et_pdata_cbase[_safe]() to the Ham Sandwich module.
  • Added geoip_code[2|3]_ex(), which address a serious issue in the now deprecated geoip_code[2|3]().
  • Added lookup_sequence(), set_controller(), set_pev_string(), and pev_serial() to Fakemeta.
  • Added a menu property to change the numbering color.
  • Added amb27: SQL_Rewind().
  • Added amb37: cs_[g|s]et_user_submodel().
  • Added amb38: cs_[g|s]et_user_lastactivity().
  • Added amb39: cs_[g|s]et_hostage_lastuse() and cs_[g|s]et_hostage_nextuse().
  • Added amb63: floatmin(), floatmax(), and floatclamp().
  • Added amb76: Formatting functions can now use %x or %X for hexadecimal numbers.
  • Added amb92: create_tr2() and free_tr2().
  • Added amb205: cs_[g|s]et_c4_explode_time().
  • Added amb216: SQL_MakeStdTuple() now has a timeout parameter.
  • Added amb237: Fakemeta can now call "ServerPrint."
  • Added amb242: cs_[g|s]et_user_hostagekills().
  • Added amb245: precache_sound now returns a precache index.
  • Added amb261: has_flag() and has_all_flags().
  • Added amb281: SQL_NextResultSet() for multiple result sets on MySQL.
  • Added amb291: cs_[g|s]et_c4_defusing().
  • Added amb673: regex_compile() and regex_match_c for pre-compiling expressions.
  • Added am46213: player_menu_info() now returns a page number.
  • Added am51064: Some parameters to get_plugin are now optional.
  • Added am50610: Some parameters to get_user_weapon are now optional.
  • Added am48841: tfc_is_user_feigning().
  • Added am45664: tfc_is_team_ally().
  • Fixed am49337: get_pcvar_float() malfunctioned on high numbers.
  • Fixed amb78: get_concmdsnum could return an incorrect result.
  • Fixed amb85: Tag mismatches on ShowSyncHudMsg().
  • Fixed amb90: set_native_filter() did not work in rare cases.
  • Fixed amb107: socket_open() didn't return an error by reference.
  • Fixed amb110: socket_change() could return 1 on certain failures.
  • Fixed amb116: DispatchKeyValue() did not work on worldspawn (entity 0).
  • Fixed amb230: radius_damage() didn't kill players on all mods.
  • Fixed amb257: get_user_origin() mode 4 had false positives.
  • Fixed amb343: TFC_ClearModel() did not function as documented.
  • Fixed amb421: get_user_weapons() could omit a weapon on Day of Defeat.
  • Fixed amb437: dod_set_user_kills() and dod_set_user_score() could mess up the scoreboard.
  • Fixed amb519: geoip_code[2|3]() buffer overflowed on error.
  • Fixed amb736: find_entity() was defined twice.
  • Fixed a memory leak in SortCustom1D().
  • Fixed a crash bug in fwrite_blocks().

Natural Selection Additions

  • Added ns_get_user_team.
  • Added ns_round_in_progress.
  • Added ns_get_weapon.
  • Added ns_takedamage.
  • Added ns_get_locationname.
  • Added ns_lookup_title.
  • Added ns_create_ps (particle systems).
  • Added ns_spawn_ps.
  • Added ns_fire_ps.
  • Added ns_get_ps_id.
  • Added round_start and round_end forwards.

Plugin Changes

  • There is no longer a hardcoded limit to the number of admins.
  • There is no longer a hardcoded limit to the map list.
  • There is no longer a hardcoded limit to the number of "imessages."
  • Added amb34: There are now plugin command/cvar menus.
  • Added am45044: amx_banmenu now prints the ban time length.
  • Added am43757: amx_addadmin now writes a comment with the player's name.
  • Added am29353: amx_plugins now prints paginated output.
  • Added am50742: admin.sma now supports prefix based per-map configs.
  • Added amb28: statscfg.sma can now use translations.
  • Added amb30: csstats_rankbots prevents bots from showing on /top15.
  • Added amb31: plmenu.sma ban and slap options are now configurable.
  • Added amb42: Added new values for amx_show_activity.
  • Added amb51: amx_vote can now take more than two options.
  • Added amb64: amx_voteban autodetects whether it should IP ban.
  • Added amb307: amx_addban now caches the last ten connections.
  • Added amb311: mapcycle file now ignores .bsp extensions.
  • Added amb340: amx_ban/amx_banip now display a reason in the activity.
  • Added amb427: Additional weapons to dod_[g|s]et_user_ammo().
  • Added amb743: plmenu for cstrike has an option to move to spectator.
  • Fixed amb29: pausecfg.sma did not translate two phrases.
  • Fixed amb91: miscstats.sma truncated some language translations.
  • Fixed amb94: amx_psay sometimes sent truncated messages.
  • Fixed amb109: mapsmenu.sma now checks mapcyclefile before reverting to mapcycle.txt.
  • Fixed amb118: amx_help would not list ADMIN_ADMIN commands.
  • Fixed amb130: Various menus did not take ADMIN_ALL or ADMIN_ADMIN into account.
  • Fixed amb183: plmenu.sma did not work on Natural Selection.
  • Fixed amb196: amx_modules did not handle invalid modules properly.
  • Fixed amb222: cl_rebuy could exploit CS weapon restrictions. This also makes CZ bots obey restrictions.
  • Fixed amb228: amxmod_compat could cause set_user_hitzones() to break.
  • Fixed amb350: traceline_set_float from the AMX Mod Compat layer was broken.
  • Fixed amb467: conmotd.txt is now removed.
  • Fixed amb633: Immune admins can now target themselves.
  • Fixed amb790: admin.sma parsed beginning spaces incorrectly in users.ini.
  • Fixed a potential exploit in adminslots.sma.
  • SQL cvars are now protected.

Module Changes

  • Fixed amb108: IP-based stats no longer include a port when saving.
  • Fixed amb503: CSX did not set a META_RESULT when paused.