diff --git a/amxmodx/msvc10/amxmodx_mm.vcxproj b/amxmodx/msvc10/amxmodx_mm.vcxproj index 5931e690..5a2ac486 100644 --- a/amxmodx/msvc10/amxmodx_mm.vcxproj +++ b/amxmodx/msvc10/amxmodx_mm.vcxproj @@ -428,15 +428,6 @@ - - - - - - - - - diff --git a/amxmodx/msvc10/amxmodx_mm.vcxproj.filters b/amxmodx/msvc10/amxmodx_mm.vcxproj.filters index 089c5375..33d5c600 100644 --- a/amxmodx/msvc10/amxmodx_mm.vcxproj.filters +++ b/amxmodx/msvc10/amxmodx_mm.vcxproj.filters @@ -25,9 +25,6 @@ {4022451d-eb5f-4f14-b8d8-2ce23fec6e59} - - {d4419052-0ddd-415e-bb16-4393b99751be} - @@ -405,33 +402,6 @@ Pawn Includes - - Pawn Includes\AMX Mod Compat - - - Pawn Includes\AMX Mod Compat - - - Pawn Includes\AMX Mod Compat - - - Pawn Includes\AMX Mod Compat - - - Pawn Includes\AMX Mod Compat - - - Pawn Includes\AMX Mod Compat - - - Pawn Includes\AMX Mod Compat - - - Pawn Includes\AMX Mod Compat - - - Pawn Includes\AMX Mod Compat - Pawn Includes diff --git a/configs/cstrike/plugins.ini b/configs/cstrike/plugins.ini index 4ef85352..610773df 100755 --- a/configs/cstrike/plugins.ini +++ b/configs/cstrike/plugins.ini @@ -40,7 +40,5 @@ statsx.amxx ; stats on death or round end (CSX Module required!) ;miscstats.amxx ; bunch of events announcement for Counter-Strike ;stats_logging.amxx ; weapons stats logging (CSX Module required!) -; Enable to use AMX Mod plugins -;amxmod_compat.amxx ; AMX Mod backwards compatibility layer ; Custom - Add 3rd party plugins here diff --git a/configs/dod/plugins.ini b/configs/dod/plugins.ini index 66d21681..3c54b330 100755 --- a/configs/dod/plugins.ini +++ b/configs/dod/plugins.ini @@ -39,7 +39,5 @@ statscfg.amxx ; allows to manage stats plugins via menu and commands ;statssounds.amxx ; precache plugin for stats plugins ;stats_logging.amxx ; weapons stats logging (DoD Module required!) -; Enable to use AMX Mod plugins -;amxmod_compat.amxx ; AMX Mod backwards compatibility layer ; Custom - Add 3rd party plugins here diff --git a/configs/esf/plugins.ini b/configs/esf/plugins.ini index 5b3653c1..d17d822c 100755 --- a/configs/esf/plugins.ini +++ b/configs/esf/plugins.ini @@ -34,8 +34,6 @@ timeleft.amxx ; displays time left on map pausecfg.amxx ; allows to pause and unpause some plugins statscfg.amxx ; allows to manage stats plugins via menu and commands -; Enable to use AMX Mod plugins -;amxmod_compat.amxx ; AMX Mod backwards compatibility layer ; Custom - Add 3rd party plugins here EvolutionX.Core.amxx ; Adds extra plugin functions for Earth's Special Forces diff --git a/configs/ns/plugins.ini b/configs/ns/plugins.ini index 56252b3d..4c2f4476 100755 --- a/configs/ns/plugins.ini +++ b/configs/ns/plugins.ini @@ -38,7 +38,5 @@ idlekicker.amxx ; kicks idle players nscommands.amxx ; extra commands for Natural-Selection ;unstuck.amxx ; Free stuck players (engine & ns modules required!) -; Enable to use AMX Mod plugins -;amxmod_compat.amxx ; AMX Mod backwards compatibility layer ; Custom - Add 3rd party plugins here diff --git a/configs/plugins.ini b/configs/plugins.ini index b615b9dc..eaa9f03a 100755 --- a/configs/plugins.ini +++ b/configs/plugins.ini @@ -34,8 +34,5 @@ timeleft.amxx ; displays time left on map pausecfg.amxx ; allows to pause and unpause some plugins statscfg.amxx ; allows to manage stats plugins via menu and commands -; Enable to use AMX Mod plugins -;amxmod_compat.amxx ; AMX Mod backwards compatibility layer - ; Custom - Add 3rd party plugins here diff --git a/configs/tfc/plugins.ini b/configs/tfc/plugins.ini index 31353cb9..46dba66c 100755 --- a/configs/tfc/plugins.ini +++ b/configs/tfc/plugins.ini @@ -39,7 +39,5 @@ statscfg.amxx ; allows to manage stats plugins via menu and commands ;statssounds.amxx ; precache plugin for stats plugins ;stats_logging.amxx ; weapons stats logging (TFC Module required!) -; Enable to use AMX Mod plugins -;amxmod_compat.amxx ; AMX Mod backwards compatibility layer ; Custom - Add 3rd party plugins here diff --git a/configs/ts/plugins.ini b/configs/ts/plugins.ini index 2f4798fa..33712778 100755 --- a/configs/ts/plugins.ini +++ b/configs/ts/plugins.ini @@ -39,7 +39,5 @@ statscfg.amxx ; allows to manage stats plugins via menu and commands ;statssounds.amxx ; precache plugin for stats plugins ;stats_logging.amxx ; weapons stats logging (TS Module required!) -; Enable to use AMX Mod plugins -;amxmod_compat.amxx ; AMX Mod backwards compatibility layer ; Custom - Add 3rd party plugins here diff --git a/installer/amxmodx-installer.nsi b/installer/amxmodx-installer.nsi index 4f0d61cd..e60ce396 100755 --- a/installer/amxmodx-installer.nsi +++ b/installer/amxmodx-installer.nsi @@ -193,7 +193,6 @@ Section "MainSection" SEC01 File "installer\files\base\addons\amxmodx\plugins\adminslots.amxx" File "installer\files\base\addons\amxmodx\plugins\adminvote.amxx" File "installer\files\base\addons\amxmodx\plugins\admin_sql.amxx" - File "installer\files\base\addons\amxmodx\plugins\amxmod_compat.amxx" File "installer\files\base\addons\amxmodx\plugins\antiflood.amxx" File "installer\files\base\addons\amxmodx\plugins\cmdmenu.amxx" File "installer\files\base\addons\amxmodx\plugins\imessage.amxx" @@ -264,7 +263,6 @@ Section "MainSection" SEC01 File "installer\files\base\addons\amxmodx\scripting\include\message_const.inc" File "installer\files\base\addons\amxmodx\scripting\include\message_stocks.inc" File "installer\files\base\addons\amxmodx\scripting\include\ns.inc" - File "installer\files\base\addons\amxmodx\scripting\include\ns2amx.inc" File "installer\files\base\addons\amxmodx\scripting\include\ns_const.inc" File "installer\files\base\addons\amxmodx\scripting\include\regex.inc" File "installer\files\base\addons\amxmodx\scripting\include\newmenus.inc" @@ -285,16 +283,6 @@ Section "MainSection" SEC01 File "installer\files\base\addons\amxmodx\scripting\include\vault.inc" File "installer\files\base\addons\amxmodx\scripting\include\vector.inc" File "installer\files\base\addons\amxmodx\scripting\include\xs.inc" - SetOutPath "$INSTDIR\files\base\scripting\include\amxmod_compat" - File "installer\files\base\addons\amxmodx\scripting\include\amxmod_compat\amxmod.inc" - File "installer\files\base\addons\amxmodx\scripting\include\amxmod_compat\maths.inc" - File "installer\files\base\addons\amxmodx\scripting\include\amxmod_compat\mysql.inc" - File "installer\files\base\addons\amxmodx\scripting\include\amxmod_compat\translator.inc" - File "installer\files\base\addons\amxmodx\scripting\include\amxmod_compat\Vexd_Utilities.inc" - File "installer\files\base\addons\amxmodx\scripting\include\amxmod_compat\VexdUM.inc" - File "installer\files\base\addons\amxmodx\scripting\include\amxmod_compat\VexdUM_const.inc" - File "installer\files\base\addons\amxmodx\scripting\include\amxmod_compat\VexdUM_stock.inc" - File "installer\files\base\addons\amxmodx\scripting\include\amxmod_compat\xtrafun.inc" SetOutPath "$INSTDIR\files\base\scripting" File "installer\files\base\addons\amxmodx\scripting\mapchooser.sma" File "installer\files\base\addons\amxmodx\scripting\mapsmenu.sma" @@ -308,11 +296,6 @@ Section "MainSection" SEC01 File "installer\files\base\addons\amxmodx\scripting\statscfg.sma" File "installer\files\base\addons\amxmodx\scripting\telemenu.sma" File "installer\files\base\addons\amxmodx\scripting\timeleft.sma" - SetOutPath "$INSTDIR\files\base\scripting\amxmod_compat" - File "installer\files\base\addons\amxmodx\scripting\amxmod_compat\amxmod_compat.sma" - File "installer\files\base\addons\amxmodx\scripting\amxmod_compat\core.sma" - File "installer\files\base\addons\amxmodx\scripting\amxmod_compat\mysql.sma" - File "installer\files\base\addons\amxmodx\scripting\amxmod_compat\vexdum.sma" SetOutPath "$INSTDIR\files\base\scripting\testsuite" File "installer\files\base\addons\amxmodx\scripting\testsuite\admins_test.sma" File "installer\files\base\addons\amxmodx\scripting\testsuite\arraytest.sma" @@ -637,15 +620,6 @@ Section Uninstall Delete "$INSTDIR\files\base\addons\amxmodx\scripting\testsuite\callfunc_test.sma" Delete "$INSTDIR\files\base\addons\amxmodx\scripting\testsuite\arraytest.sma" Delete "$INSTDIR\files\base\addons\amxmodx\scripting\testsuite\admins_test.sma" - Delete "$INSTDIR\files\base\addons\amxmodx\scripting\include\amxmod_compat\xtrafun.inc" - Delete "$INSTDIR\files\base\addons\amxmodx\scripting\include\amxmod_compat\VexdUM_stock.inc" - Delete "$INSTDIR\files\base\addons\amxmodx\scripting\include\amxmod_compat\VexdUM_const.inc" - Delete "$INSTDIR\files\base\addons\amxmodx\scripting\include\amxmod_compat\VexdUM.inc" - Delete "$INSTDIR\files\base\addons\amxmodx\scripting\include\amxmod_compat\Vexd_Utilities.inc" - Delete "$INSTDIR\files\base\addons\amxmodx\scripting\include\amxmod_compat\translator.inc" - Delete "$INSTDIR\files\base\addons\amxmodx\scripting\include\amxmod_compat\mysql.inc" - Delete "$INSTDIR\files\base\addons\amxmodx\scripting\include\amxmod_compat\maths.inc" - Delete "$INSTDIR\files\base\addons\amxmodx\scripting\include\amxmod_compat\amxmod.inc" Delete "$INSTDIR\files\base\addons\amxmodx\scripting\include\xtrafun.inc" Delete "$INSTDIR\files\base\addons\amxmodx\scripting\include\xs.inc" Delete "$INSTDIR\files\base\addons\amxmodx\scripting\include\Vexd_Utilities.inc" @@ -666,7 +640,6 @@ Section Uninstall Delete "$INSTDIR\files\base\addons\amxmodx\scripting\include\sockets.inc" Delete "$INSTDIR\files\base\addons\amxmodx\scripting\include\regex.inc" Delete "$INSTDIR\files\base\addons\amxmodx\scripting\include\ns_const.inc" - Delete "$INSTDIR\files\base\addons\amxmodx\scripting\include\ns2amx.inc" Delete "$INSTDIR\files\base\addons\amxmodx\scripting\include\ns.inc" Delete "$INSTDIR\files\base\addons\amxmodx\scripting\include\nvault.inc" Delete "$INSTDIR\files\base\addons\amxmodx\scripting\include\newmenus.inc" @@ -705,10 +678,6 @@ Section Uninstall Delete "$INSTDIR\files\base\addons\amxmodx\scripting\include\amxmod.inc" Delete "$INSTDIR\files\base\addons\amxmodx\scripting\include\amxmisc.inc" Delete "$INSTDIR\files\base\addons\amxmodx\scripting\include\amxconst.inc" - Delete "$INSTDIR\files\base\addons\amxmodx\scripting\amxmod_compat\amxmod_compat.sma" - Delete "$INSTDIR\files\base\addons\amxmodx\scripting\amxmod_compat\core.sma" - Delete "$INSTDIR\files\base\addons\amxmodx\scripting\amxmod_compat\mysql.sma" - Delete "$INSTDIR\files\base\addons\amxmodx\scripting\amxmod_compat\vexdum.sma" Delete "$INSTDIR\files\base\addons\amxmodx\scripting\timeleft.sma" Delete "$INSTDIR\files\base\addons\amxmodx\scripting\telemenu.sma" Delete "$INSTDIR\files\base\addons\amxmodx\scripting\statscfg.sma" @@ -909,9 +878,7 @@ Section Uninstall RMDir "$INSTDIR\files\cstrike\modules" RMDir "$INSTDIR\files\cstrike\data" RMDir "$INSTDIR\files\cstrike\configs" - RMDir "$INSTDIR\files\base\addons\amxmodx\scripting\include\amxmod_compat" RMDir "$INSTDIR\files\base\addons\amxmodx\scripting\include" - RMDir "$INSTDIR\files\base\addons\amxmodx\scripting\amxmod_compat" RMDir "$INSTDIR\files\base\scripting" RMDir "$INSTDIR\files\base\plugins" RMDir "$INSTDIR\files\base\modules" diff --git a/plugins/AMBuilder b/plugins/AMBuilder index 059f7991..f995c3bd 100644 --- a/plugins/AMBuilder +++ b/plugins/AMBuilder @@ -106,9 +106,3 @@ build_plugin( amxx_file = 'admin_sql.amxx', extra_argv = ['USING_SQL=1'] ) - -# amxmod_compat is multi-file. -build_plugin( - script_path = os.path.join(builder.currentSourcePath, 'amxmod_compat', 'amxmod_compat.sma'), - amxx_file = 'amxmod_compat.amxx' -) diff --git a/plugins/amxmod_compat/amxmod_compat.sma b/plugins/amxmod_compat/amxmod_compat.sma deleted file mode 100644 index 5eee7aeb..00000000 --- a/plugins/amxmod_compat/amxmod_compat.sma +++ /dev/null @@ -1,75 +0,0 @@ -/** - * AMX Mod Compatibility engine - * by the AMX Mod X Development Team - */ - -#include -#include //we want fun running for extra compatibility -#include //we want engine running for extra compatibility -#include -#include -#define AMXMODX_NOAUTOLOAD -#include -#include - -#define MOD_NORMAL 0 -#define MOD_CSTRIKE 1 - -new g_ModType = MOD_NORMAL -new g_MaxPlayers - -#include "core.sma" -#include "vexdum.sma" -#include "mysql.sma" - -public plugin_init() -{ - register_plugin("AMX Mod Compat Engine", "1.76.rc4", "AMXX Dev Team") - - g_MaxPlayers = get_maxplayers() - - VexdUM_Register() -} - -public plugin_natives() -{ - set_module_filter("Plugin_ModuleFilter") - set_native_filter("Plugin_NativeFilter") - - new modname[32] - get_modname(modname, 31) - if (equali(modname, "cstrike") || equali(modname, "czero")) - { - g_ModType = MOD_CSTRIKE - } - - Core_Natives() - VexdUM_Natives() - MySQL_Natives() -} - -public Plugin_ModuleFilter(const module[]) -{ - if (equali(module, "sqlx") || equali(module, "cstrike")) - { - return PLUGIN_HANDLED - } - - return PLUGIN_CONTINUE -} - -public Plugin_NativeFilter(const name[], index, trap) -{ - if (!trap) - { - return PLUGIN_HANDLED - } - - return PLUGIN_CONTINUE -} - -public client_connect(id) -{ - VexdUM_ClientConnect(id) -} - diff --git a/plugins/amxmod_compat/core.sma b/plugins/amxmod_compat/core.sma deleted file mode 100644 index decb0909..00000000 --- a/plugins/amxmod_compat/core.sma +++ /dev/null @@ -1,301 +0,0 @@ -/** - * AMX Mod Compatibility engine - * by the AMX Mod X Development Team - */ - -Core_Natives() -{ - /* implicit compatibility */ - register_native("VelocityByAim", "__VelocityByAim") - register_native("load_translations", "__load_translations") - register_native("is_user_authorized", "__is_user_authorized") - register_native("get_user_money", "__get_user_money") - register_native("set_user_money", "__set_user_money") - register_native("angle_to_vector", "__angle_to_vector") - register_native("fabs", "__fabs") - register_native("asin", "__asin") - register_native("sin", "__sin") - register_native("sinh", "__sinh") - register_native("acos", "__acos") - register_native("cos", "__cos") - register_native("cosh", "__cosh") - register_native("atan", "__atan") - register_native("atan2", "__atan2") - register_native("tan", "__tan") - register_native("tanh", "__tanh") - register_native("fsqroot", "__fsqroot") - register_native("fpower", "__fpower") - register_native("flog", "__flog") - register_native("get_cmdaccess", "__get_cmdaccess") - register_native("is_translated", "__is_translated") - register_native("get_plugincmdsnum", "__get_plugincmdsnum") - register_native("get_plugincmd", "__get_plugincmd") - register_native("get_plugincvarsnum", "__get_plugincvarsnum") - register_native("get_plugincvar", "__get_plugincvar") - register_native("is_module_running", "__is_module_running") - register_native("is_plugin_running", "__is_plugin_running") -} - -public __VelocityByAim(plid, num) -{ - new iIndex - new iVelocity - new Float:vRetValue[3] - - iIndex = get_param(1) - iVelocity = get_param(2) - - new ret = velocity_by_aim(iIndex, iVelocity, vRetValue) - set_array_f(3, vRetValue, 3) - - return ret -} - -public __load_translations(plid, num) -{ - static file[255] - - get_string(1, file, 254) - - return load_translations(file) -} - -public __is_user_authorized(plid, num) -{ - return is_user_authorized(get_param(1)) -} - -public __get_user_money(plid, num) -{ - return get_user_money(get_param(1)) -} - -public __set_user_money(plid, num) -{ - return set_user_money(get_param(1), get_param(2), get_param(3)) -} - -public __angle_to_vector(plid, num) -{ - new Float:angle[3] - new Float:vRetValue[3] - - get_array_f(1, angle, 3) - - new ret = angle_vector(angle, get_param(2), vRetValue) - set_array_f(3, vRetValue, 3) - - return ret -} - -public Float:__fabs(plid, num) -{ - new Float:value = get_param_f(1) - - return floatabs(value) -} - -public Float:__asin(plid, num) -{ - new Float:value = get_param_f(1) - - return floatasin(value, radian) -} - -public Float:__sin(plid, num) -{ - new Float:value = get_param_f(1) - - return floatsin(value, radian) -} - -public Float:__sinh(plid, num) -{ - new Float:value = get_param_f(1) - - return floatsinh(value, radian) -} - -public Float:__acos(plid, num) -{ - new Float:value = get_param_f(1) - - return floatacos(value, radian) -} - -public Float:__cos(plid, num) -{ - new Float:value = get_param_f(1) - - return floatcos(value, radian) -} - -public Float:__cosh(plid, num) -{ - new Float:value = get_param_f(1) - - return floatcosh(value, radian) -} - -public Float:__atan(plid, num) -{ - new Float:value = get_param_f(1) - - return floatatan(value, radian) -} - -public Float:__atan2(plid, num) -{ - new Float:value1 = get_param_f(1) - new Float:value2 = get_param_f(2) - - return floatatan2(value1, value2, radian) -} - -public Float:__tan(plid, num) -{ - new Float:value = get_param_f(1) - - return floattan(value, radian) -} - -public Float:__tanh(plid, num) -{ - new Float:value = get_param_f(1) - - return floattanh(value, radian) -} - -public Float:__fsqroot(plid, num) -{ - new Float:value = get_param_f(1) - - return floatsqroot(value) -} - -public Float:__fpower(plid, num) -{ - new Float:value = get_param_f(1) - new Float:exponent = get_param_f(2) - - return floatpower(value, exponent) -} - -public Float:__flog(plid, num) -{ - new Float:value = get_param_f(1) - new Float:base = get_param_f(2) - - return floatlog(value, base) -} - -//get_cmdaccess(cmd[], accessflags[], len) -public __get_cmdaccess(plid, num) -{ - static command[32], accessflags[32] - new ret - - get_string(1, command, 31) - - if ((ret=get_cmdaccess(command, accessflags, 31))) - { - set_string(2, accessflags, get_param(3)) - } - - return ret -} - -public __is_translated(plid, num) -{ - static string[512] - - get_string(1, string, 511) - - return is_translated(string) -} - -public __get_plugincmdsnum(plid, num) -{ - static plugin[64] - - get_string(1, plugin, 63) - - return get_plugincmdsnum(plugin, get_param(2)) -} - -public __get_plugincmd(plid, num) -{ - static plugin[64] - static command[32] - static accessflags[32] - static info[512] - - get_string(1, plugin, 63) - - if (get_plugincmd(plugin, - get_param(2), - command, - 31, - accessflags, - 31, - info, - 511, - get_param(9), - get_param(10))) - { - set_string(3, command, get_param(4)) - set_string(5, accessflags, get_param(6)) - set_string(7, info, get_param(8)) - - return 1 - } - - return 0 -} - -public __get_plugincvarsnum(plid, num) -{ - static plugin[64] - - get_string(1, plugin, 63) - - return get_plugincvarsnum(plugin, get_param(2)) -} - -//stock get_plugincvar(plugin[], index, cvar[], len1, value[], len2, flags=0) -public __get_plugincvar(plid, num) -{ - static plugin[64] - static cvar[32] - static value[512] - - get_string(1, plugin, 63) - - if (get_plugincvar(plugin, get_param(2), cvar, 31, value, 511, get_param(7))) - { - set_string(3, cvar, get_param(4)) - set_string(5, value, get_param(6)) - - return 1 - } - - return 0 -} - -public __is_module_running(plid, num) -{ - static module[64] - - get_string(1, module, 63) - - return is_module_running(module) -} - -public __is_plugin_running(plid, num) -{ - static plugin[64] - - get_string(1, plugin, 63) - - return is_plugin_running(plugin) -} diff --git a/plugins/amxmod_compat/mysql.sma b/plugins/amxmod_compat/mysql.sma deleted file mode 100644 index 00c037d6..00000000 --- a/plugins/amxmod_compat/mysql.sma +++ /dev/null @@ -1,415 +0,0 @@ -/** - * AMX Mod Compatibility engine - * by the AMX Mod X Development Team - */ - -#define MAX_CONNECTIONS 64 - -new Connections[MAX_CONNECTIONS+1] = {0} -new ConnectionTracker[MAX_CONNECTIONS+1] = {0} -new ConnectionErrors[MAX_CONNECTIONS+1][255] -new ConnectionQueries[MAX_CONNECTIONS+1] = {0} -new QueryPositions[MAX_CONNECTIONS+1] - -MySQL_Natives() -{ - register_native("mysql_connect", "__mysql_connect") - register_native("mysql_query", "__mysql_query") - register_native("mysql_error", "__mysql_error") - register_native("mysql_close", "__mysql_close") - register_native("mysql_nextrow", "__mysql_nextrow") - register_native("mysql_getfield", "__mysql_getfield") - register_native("mysql_getresult", "__mysql_getresult") - register_native("mysql_affected_rows", "__mysql_affected_rows") - register_native("mysql_num_fields", "__mysql_num_fields") - register_native("mysql_num_rows", "__mysql_num_rows") - register_native("mysql_field_name", "__mysql_field_name") - register_native("mysql_insert_id", "__mysql_insert_id") -} - -MakeConnectionIndex(Handle:cn) -{ - if (ConnectionTracker[0]) - { - new idx = ConnectionTracker[ConnectionTracker[0]] - ConnectionTracker[0]-- - Connections[idx] = _:cn - return idx - } else { - Connections[0]++ - if (Connections[0] > MAX_CONNECTIONS) - { - return 0 - } - - Connections[Connections[0]] = _:cn - return Connections[0] - } - - return 0 -} - -Handle:GetConnectionIndex(idx) -{ - if (idx < 1 || idx > MAX_CONNECTIONS || !Connections[idx]) - { - return Empty_Handle - } - - return Handle:Connections[idx] -} - -FreeConnectionIndex(idx) -{ - Connections[idx] = 0 - ConnectionTracker[0]++ - ConnectionTracker[ConnectionTracker[0]] = idx - ConnectionErrors[idx][0] = 0 - ConnectionQueries[idx] = 0 - QueryPositions[idx] = 0 -} - -/* - * Unlike the previous this does not check for a matching connection. - * Unless a plugin breaks I'm not going to take that step. - */ - -public __mysql_connect(plid, num) -{ - static host[255], user[128], pass[128], dbname[128], error[512] - new errcode - - get_string(1, host, 254) - get_string(2, user, 127) - get_string(3, pass, 127) - get_string(4, dbname, 127) - - new Handle:info = SQL_MakeDbTuple(host, user, pass, dbname) - new Handle:cn = SQL_Connect(info, errcode, error, 511) - - if (cn == Empty_Handle) - { - set_string(5, error, get_param(6)) - return 0 - } - - SQL_FreeHandle(info) - - new idx = MakeConnectionIndex(cn) - if (idx == 0) - { - set_string(5, "Reached max unclosed connections", get_param(6)) - return 0 - } - - ConnectionQueries[idx] = 0 - - return idx -} - -public __mysql_query(plid, num) -{ - static queryString[4096] - new cn_idx = get_param(1) - new Handle:cn - - if ((cn=GetConnectionIndex(cn_idx)) == Empty_Handle) - { - return 0 - } - - vdformat(queryString, 4095, 2, 3) - - new Handle:query = SQL_PrepareQuery(cn, "%s", queryString) - - if (!SQL_Execute(query)) - { - SQL_QueryError(query, ConnectionErrors[cn_idx], 254) - SQL_FreeHandle(query) - return 0 - } - - if (ConnectionQueries[cn_idx]) - { - SQL_FreeHandle(Handle:ConnectionQueries[cn_idx]) - } - - ConnectionQueries[cn_idx] = _:query - QueryPositions[cn_idx] = 0 - - return 1 -} - -public __mysql_error(plid, num) -{ - new cn_idx = get_param(1) - - if (Connections[cn_idx] < 1) - { - static error[255] - format(error, 254, "Invalid connection index: %d", cn_idx) - set_string(2, error, get_param(3)) - return 1 - } - - set_string(2, ConnectionErrors[cn_idx], get_param(3)) - - return 1 -} - -public __mysql_close(plid, num) -{ - new cn_idx = get_param(1) - - new Handle:cn = GetConnectionIndex(cn_idx) - - if (cn == Empty_Handle) - { - return 0 - } - - new Handle:query = Handle:ConnectionQueries[cn_idx] - - if (query != Empty_Handle) - { - SQL_FreeHandle(query) - } - - SQL_FreeHandle(cn) - - FreeConnectionIndex(cn_idx) - - return 1 -} - -public __mysql_nextrow(plid, num) -{ - new cn_idx = get_param(1) - - new Handle:cn = GetConnectionIndex(cn_idx) - if (cn == Empty_Handle) - { - return 0 - } - - new Handle:query = Handle:ConnectionQueries[cn_idx] - if (query == Empty_Handle) - { - return 0 - } - - if (QueryPositions[cn_idx] != 0) - { - SQL_NextRow(query) - } - - if (SQL_MoreResults(query)) - { - return ++QueryPositions[cn_idx] - } - - return 0 -} - -public __mysql_getresult(plid, num) -{ - new cn_idx = get_param(1) - - new Handle:cn = GetConnectionIndex(cn_idx) - if (cn == Empty_Handle) - { - return 0 - } - - new Handle:query = Handle:ConnectionQueries[cn_idx] - if (query == Empty_Handle) - { - return 0 - } - - if (!SQL_MoreResults(query)) - { - return 0 - } - - static name[64] - get_string(2, name, 63) - new column = SQL_FieldNameToNum(query, name) - if (column == -1) - { - log_error(AMX_ERR_NATIVE, "Invalid column name: %s", name) - return 0 - } - - switch (num) - { - case 2: - { - return SQL_ReadResult(query, column) - } - case 3: - { - new Float:fma - SQL_ReadResult(query, column, fma) - set_param_byref(3, _:fma) - } - case 4: - { - static str[2048] - SQL_ReadResult(query, column, str, 2047) - set_string(3, str, get_param_byref(4)) - } - } - - return 1 -} - -public __mysql_getfield(plid, num) -{ - new cn_idx = get_param(1) - - new Handle:cn = GetConnectionIndex(cn_idx) - if (cn == Empty_Handle) - { - return 0 - } - - new Handle:query = Handle:ConnectionQueries[cn_idx] - if (query == Empty_Handle) - { - return 0 - } - - if (!SQL_MoreResults(query)) - { - return 0 - } - - switch (num) - { - case 2: - { - return SQL_ReadResult(query, get_param(2)-1) - } - case 3: - { - new Float:fma - SQL_ReadResult(query, get_param(2)-1, fma) - set_param_byref(3, _:fma) - } - case 4: - { - static str[2048] - SQL_ReadResult(query, get_param(2)-1, str, 2047) - set_string(3, str, get_param_byref(4)) - } - } - - return 1 -} - -public __mysql_affected_rows(plid, num) -{ - new cn_idx = get_param(1) - - new Handle:cn = GetConnectionIndex(cn_idx) - if (cn == Empty_Handle) - { - return 0 - } - - new Handle:query = Handle:ConnectionQueries[cn_idx] - if (query == Empty_Handle) - { - return 0 - } - - return SQL_AffectedRows(query) -} - -public __mysql_num_fields(plid, num) -{ - new cn_idx = get_param(1) - - new Handle:cn = GetConnectionIndex(cn_idx) - if (cn == Empty_Handle) - { - return 0 - } - - new Handle:query = Handle:ConnectionQueries[cn_idx] - if (query == Empty_Handle) - { - return 0 - } - - return SQL_NumColumns(query) -} - -public __mysql_insert_id(plid, num) -{ - new cn_idx = get_param(1) - - new Handle:cn = GetConnectionIndex(cn_idx) - if (cn == Empty_Handle) - { - return 0 - } - - new Handle:query = Handle:ConnectionQueries[cn_idx] - if (query == Empty_Handle) - { - return 0 - } - - return SQL_GetInsertId(query) -} - -public __mysql_num_rows(plid, num) -{ - new cn_idx = get_param(1) - - new Handle:cn = GetConnectionIndex(cn_idx) - if (cn == Empty_Handle) - { - return 0 - } - - new Handle:query = Handle:ConnectionQueries[cn_idx] - if (query == Empty_Handle) - { - return 0 - } - - return SQL_NumResults(query) -} - -public __mysql_field_name(plid, num) -{ - new cn_idx = get_param(1) - - new Handle:cn = GetConnectionIndex(cn_idx) - if (cn == Empty_Handle) - { - return 0 - } - - new Handle:query = Handle:ConnectionQueries[cn_idx] - if (query == Empty_Handle) - { - return 0 - } - - new column = get_param(2) - 1 - if (column < 0 || column >= SQL_NumColumns(query)) - { - return 0 - } - - new field[64] - SQL_FieldNumToName(query, column, field, 63) - - set_string(3, field, get_param(4)) - - return 1 -} diff --git a/plugins/amxmod_compat/vexdum.sma b/plugins/amxmod_compat/vexdum.sma deleted file mode 100644 index 4647df3b..00000000 --- a/plugins/amxmod_compat/vexdum.sma +++ /dev/null @@ -1,730 +0,0 @@ -/** - * AMX Mod Compatibility engine - * by the AMX Mod X Development Team - */ - -#include -#include - -/* Forwards */ -new g_FwdTouch -new g_FwdThink -new g_FwdSpawn -new g_FwdClientPreThink -new g_FwdClientPostThink -new g_FwdEmitSound -new g_FwdEmitAmbientSound -new g_FwdSetModel -new g_FwdTraceLine -new g_FwdSetCliKeyValue -new g_FwdKeyValue -new g_PlayerModels[33][64] -new g_PlayerModeled[33] - -/* User Messages */ -new g_msgDamage -new g_msgDeathMsg -new g_msgScoreInfo - -new g_LastTrace = 0 - -VexdUM_Register() -{ - /* Fakemeta Hooks */ - register_forward(FM_EmitSound, "Hook_FM_EmitSound") - register_forward(FM_EmitAmbientSound, "Hook_FM_EmitAmbientSound") - register_forward(FM_SetModel, "Hook_FM_SetModel") - register_forward(FM_SetClientKeyValue, "Hook_FM_SetClientKeyValue") - register_forward(FM_KeyValue, "Hook_FM_KeyValue") - register_forward(FM_Touch, "Hook_FM_Touch") - register_forward(FM_Think, "Hook_FM_Think") - register_forward(FM_Spawn, "Hook_FM_Spawn") - register_forward(FM_PlayerPreThink, "Hook_FM_PlayerPreThink") - register_forward(FM_PlayerPostThink, "Hook_FM_PlayerPostThink") - register_forward(FM_ClientUserInfoChanged, "Hook_ClientUserInfoChanged") - - // Only register the traceline forward if there actually is a plugin - // that needs it. Otherwise this will mess with set_user_hitzones - - new pluginnum = get_pluginsnum(); - for (new i = 0; i < pluginnum; i++) - { - if (plugin_flags(0, i) & AMX_FLAG_OLDFILE && // plugin is an AMX plugin being emulated - get_func_id("traceline", i) != -1) // plugin needs traceline - { - register_forward(FM_TraceLine, "Hook_FM_TraceLine") - break; - } - - } - /* Global Forwards */ - g_FwdTouch = CreateMultiForwardEx("entity_touch", ET_STOP, FORWARD_ONLY_OLD, FP_CELL, FP_CELL) - g_FwdThink = CreateMultiForwardEx("entity_think", ET_STOP, FORWARD_ONLY_OLD, FP_CELL) - g_FwdSpawn = CreateMultiForwardEx("entity_spawn", ET_STOP, FORWARD_ONLY_OLD, FP_CELL) - g_FwdClientPreThink = CreateMultiForwardEx("client_prethink", ET_IGNORE, FORWARD_ONLY_OLD, FP_CELL) - g_FwdClientPostThink = CreateMultiForwardEx("client_postthink", ET_IGNORE, FORWARD_ONLY_OLD, FP_CELL) - g_FwdEmitSound = CreateMultiForwardEx("emitsound", ET_STOP, FORWARD_ONLY_OLD, FP_CELL, FP_STRING) - g_FwdEmitAmbientSound = CreateMultiForwardEx("emitambientsound", ET_STOP, FORWARD_ONLY_OLD, FP_CELL, FP_STRING) - g_FwdSetModel = CreateMultiForwardEx("set_model", ET_STOP, FORWARD_ONLY_OLD, FP_CELL, FP_STRING) - g_FwdTraceLine = CreateMultiForwardEx("traceline", ET_STOP, FORWARD_ONLY_OLD, FP_CELL) - g_FwdSetCliKeyValue = CreateMultiForwardEx("setclientkeyvalue", ET_STOP, FORWARD_ONLY_OLD, FP_CELL, FP_STRING, FP_STRING) - g_FwdKeyValue = CreateMultiForwardEx("keyvalue", ET_STOP, FORWARD_ONLY_OLD, FP_CELL) - - /* User Messages */ - g_msgDamage = get_user_msgid("Damage") - g_msgDeathMsg = get_user_msgid("DeathMsg") - g_msgScoreInfo = get_user_msgid("ScoreInfo") -} - -VexdUM_Natives() -{ - /* implicit compatibility */ - register_native("is_entity", "__is_entity") - register_native("find_entity", "__find_entity") - register_native("find_entity_sphere", "__find_entity_sphere") - register_native("in_view_cone", "__in_view_cone") - register_native("get_offset_int", "__get_offset_int") - register_native("set_offset_int", "__set_offset_int") - register_native("trace_line", "__trace_line") - register_native("traceline_get_int", "__traceline_get_int") - register_native("traceline_set_int", "__traceline_set_int") - register_native("traceline_get_edict", "__traceline_get_edict") - register_native("traceline_set_edict", "__traceline_set_edict") - register_native("traceline_set_float", "__traceline_set_float") - register_native("can_see", "__can_see") - register_native("user_spawn", "__user_spawn") - register_native("get_maxentities", "__get_maxentities") - register_native("PointContents", "__PointContents") - register_native("DispatchKeyValue", "__DispatchKeyValue") - register_native("entity_use","__entity_use") - register_native("get_num_ents","__get_num_ents") - register_native("take_damage","__take_damage") - - if (g_ModType == MOD_CSTRIKE) - { - register_native("set_user_model", "__cs_set_user_model") - } else { - register_native("set_user_model", "__set_user_model") - } -} - -VexdUM_ClientConnect(id) -{ - g_PlayerModels[id][0] = 0 - g_PlayerModeled[id] =0 -} - -SetClientKeyValue(id, const key[], const value[]) -{ - new buffer = engfunc(EngFunc_GetInfoKeyBuffer, id) - - return engfunc(EngFunc_SetClientKeyValue, id, buffer, key, value) -} - -GetClientKeyValue(id, const key[], value[], maxlen) -{ - new buffer = engfunc(EngFunc_GetInfoKeyBuffer, id) - - engfunc(EngFunc_InfoKeyValue, buffer, key, value, maxlen) -} - -Death(victim, killer, weapon[64], hs) -{ - if(pev(victim,pev_takedamage) > DAMAGE_NO) - { - new inflictor = pev(killer,pev_owner) - if(pev(killer,pev_flags) & (FL_CLIENT | FL_FAKECLIENT)) - { - if(equal(weapon,"")) - { - pev(killer,pev_viewmodel2,weapon,63) - - replace(weapon,63,"models/v_","") - weapon[strlen(weapon) - 4] = '^0' - } - } - else if(inflictor > 0 && inflictor < get_maxplayers()) - { - if(equal(weapon,"")) - { - pev(killer,pev_viewmodel2,weapon,63) - - replace(weapon,63,"weapon_","") - replace(weapon,63,"monster_","") - replace(weapon,63,"func_","") - } - - if(inflictor == victim) - { - killer = victim - } else { - killer = inflictor - } - } - - message_begin(MSG_ALL,g_msgDeathMsg) - write_byte(killer) - write_byte(victim) - write_byte(hs) - write_string(weapon) - message_end() - - new vname[32],vauthid[32],vteam[32] - get_user_name(victim,vname,31) - get_user_authid(victim,vauthid,31) - get_user_team(victim,vteam,31) - - if(victim == killer) - { - log_message("^"%s<%i><%s><%s>^" killed self with ^"%s^"^n",vname,get_user_userid(victim), - vauthid,vteam,weapon) - } - else if(pev(killer,pev_flags) & (FL_CLIENT | FL_FAKECLIENT)) - { - new kname[32],kauthid[32],kteam[32],team - get_user_name(killer,kname,31) - get_user_authid(killer,kauthid,31) - team = get_user_team(killer,kteam,31) - - log_message("^"%s<%i><%s><%s>^" killed ^"%s<%i><%s><%s>^" with ^"%s^"^n",kname,get_user_userid(killer), - kauthid,kteam,vname,get_user_userid(victim),vauthid,vteam,weapon) - - new Float:frags - pev(killer,pev_frags,frags) - set_pev(killer,pev_frags,frags+1.0) - - message_begin(MSG_ALL,g_msgScoreInfo) - write_byte(killer) - write_short(floatround(frags)) - write_short(get_user_deaths(killer)) - write_short(0) - write_short(team) - message_end() - - pev(victim,pev_frags,frags) - set_pev(victim,pev_frags,frags+1.0) - } else { - log_message("^"%s<%i><%s><%s>^" killed by ^"%s^"^n",vname,get_user_userid(victim),vauthid,vteam,weapon) - } - - set_msg_block(g_msgDeathMsg,BLOCK_ONCE) - dllfunc(DLLFunc_ClientKill,victim) - } -} - -public __is_entity(plid, num) -{ - new ent = get_param(1) - return is_entity(ent) -} - -public __find_entity(plid, num) -{ - static entstr[256] - new startEnt, type - - startEnt = get_param(1) - get_string(2, entstr, 255) - type = get_param(3) - - return find_entity(startEnt, entstr, type) -} - -public __find_entity_sphere(plid, num) -{ - new ent - new Float:orig[3] - new Float:radius - - ent = get_param(1) - get_array_f(2, orig, 3) - radius = get_param_f(3) - - return find_entity_sphere(ent, orig, radius) -} - -public __in_view_cone(plid, num) -{ - new ent - new Float:orig[3] - - ent = get_param(1) - get_array_f(2, orig, 3) - - return in_view_cone(ent, orig) -} - -public __get_offset_int(plid, num) -{ - new ent = get_param(1) - new offs = get_param(2) - new linux = get_param(3) - - return get_pdata_int(ent, offs, linux) -} - -public __set_offset_int(plid, num) -{ - return set_offset_int(get_param(1), get_param(2), get_param(3), get_param(4)) -} - -public __trace_line(plid, num) -{ - new ent = get_param(1) - - new Float:vStart[3], Float:vEnd[3], Float:vReturn[3] - - get_array_f(2, vStart, 3) - get_array_f(3, vEnd, 3) - - if (ent == FM_NULLENT) - engfunc(EngFunc_TraceLine, vStart, vEnd, IGNORE_MONSTERS, 0, 0) - else - engfunc(EngFunc_TraceLine, vStart, vEnd, DONT_IGNORE_MONSTERS, ent, 0) - - get_tr2(0, TraceResult:TR_vecEndPos, vReturn) - - set_array_f(4, vReturn, 3) - - new traceHit = get_tr2(0, TraceResult:TR_pHit) - - if (!pev_valid(traceHit)) - return FM_NULLENT - - return traceHit -} - -public __traceline_get_int(plid, num) -{ - new iSet = get_param(1) - new iValue = 0 - - switch (iSet) - { - case TR_INT_fAllSolid: - iValue = get_tr2(g_LastTrace, TraceResult:TR_AllSolid) - case TR_INT_fStartSolid: - iValue = get_tr2(g_LastTrace, TraceResult:TR_StartSolid) - case TR_INT_fInOpen: - iValue = get_tr2(g_LastTrace, TraceResult:TR_InOpen) - case TR_INT_fInWater: - iValue = get_tr2(g_LastTrace, TraceResult:TR_InWater) - case TR_INT_iHitgroup: - iValue = get_tr2(g_LastTrace, TraceResult:TR_iHitgroup) - default: - log_error(AMX_ERR_NATIVE, "Invalid TR_ parameter") - } - - return iValue -} - -public __traceline_set_int(plid, num) -{ - new iSet = get_param(1) - new iValue = get_param(2) - - switch (iSet) - { - case TR_INT_fAllSolid: - set_tr2(g_LastTrace, TraceResult:TR_AllSolid, iValue) - case TR_INT_fStartSolid: - set_tr2(g_LastTrace, TraceResult:TR_StartSolid, iValue) - case TR_INT_fInOpen: - set_tr2(g_LastTrace, TraceResult:TR_InOpen, iValue) - case TR_INT_fInWater: - set_tr2(g_LastTrace, TraceResult:TR_InWater, iValue) - case TR_INT_iHitgroup: - set_tr2(g_LastTrace, TraceResult:TR_iHitgroup, iValue) - default: - { - log_error(AMX_ERR_NATIVE, "Invalid TR_ parameter") - return 0 - } - } - - return 1 -} - -public __traceline_get_edict(plid, num) -{ - new iSet = get_param(1) - new iValue = 0 - - switch (iSet) - { - case TR_ENT_pHit: - iValue = get_tr2(g_LastTrace, TraceResult:TR_pHit) - default: - log_error(AMX_ERR_NATIVE, "Invalid TR_ parameter") - } - - return iValue -} - -public __traceline_set_edict(plid, num) -{ - new iSet = get_param(1) - new iValue = get_param(2) - - switch (iSet) - { - case TR_ENT_pHit: - set_tr2(g_LastTrace, TraceResult:TR_pHit, iValue) - default: - { - log_error(AMX_ERR_NATIVE, "Invalid TR_ parameter") - return 0 - } - } - - return 1 -} - -public Float:__traceline_get_float(plid, num) -{ - new iSet = get_param(1) - new Float:fValue = 0.0 - - switch (iSet) - { - case TR_FL_flFraction: - get_tr2(g_LastTrace, TraceResult:TR_flFraction, fValue) - case TR_FL_flPlaneDist: - get_tr2(g_LastTrace, TraceResult:TR_flPlaneDist, fValue) - default: - log_error(AMX_ERR_NATIVE, "Invalid TR_ parameter") - } - - return fValue -} - -public __traceline_set_float(plid, num) -{ - new iSet = get_param(1) - new Float:fValue = get_param_f(2) - - switch (iSet) - { - case TR_FL_flFraction: - set_tr2(g_LastTrace, TraceResult:TR_flFraction, fValue) - case TR_FL_flPlaneDist: - set_tr2(g_LastTrace, TraceResult:TR_flPlaneDist, fValue) - default: - { - log_error(AMX_ERR_NATIVE, "Invalid TR_ parameter") - return 0 - } - } - - return 1 -} - -public __traceline_get_vector(plid, num) -{ - new iSet = get_param(1) - new Float:vValue[3] - - switch (iSet) - { - case TR_VEC_vecEndPos: - get_tr2(g_LastTrace, TraceResult:TR_vecEndPos, vValue) - case TR_VEC_vecPlaneNormal: - get_tr2(g_LastTrace, TraceResult:TR_vecPlaneNormal, vValue) - default: - { - log_error(AMX_ERR_NATIVE, "Invalid TR_ parameter") - return 0 - } - } - - set_array_f(2, vValue, 3) - - return 1 -} - -public __traceline_set_vector(plid, num) -{ - new iSet = get_param(1) - new Float:vValue[3] - - get_array_f(2, vValue, 3) - - switch (iSet) - { - case TR_VEC_vecEndPos: - set_tr2(g_LastTrace, TraceResult:TR_vecEndPos, vValue) - case TR_VEC_vecPlaneNormal: - set_tr2(g_LastTrace, TraceResult:TR_vecPlaneNormal, vValue) - default: - { - log_error(AMX_ERR_NATIVE, "Invalid TR_ parameter") - return 0 - } - } - - return 1 -} - -public __can_see(plid, num) -{ - return can_see(get_param(1), get_param(2)) -} - -public __user_spawn(plid, num) -{ - return dllfunc(DLLFunc_Spawn, get_param(1)) -} - -public __set_user_model(plid, num) -{ - new id = get_param(1) - if (id < 1 || id > g_MaxPlayers) - { - return 0 - } - - new model[64] - get_string(2, model, 63) - if (model[0] == 0) - { - if (!g_PlayerModeled[id]) - { - return 0 - } - g_PlayerModeled[id] = 0 - g_PlayerModels[id][0] = 0 - dllfunc(DLLFunc_ClientUserInfoChanged, id) - } else { - copy(g_PlayerModels[id], 63, model) - g_PlayerModeled[id] = 1 - SetClientKeyValue(id, "model", model) - } - - return 1 -} - -public __cs_set_user_model(plid, num) -{ - new id = get_param(1) - new model[64] - - get_string(2, model, 63) - - return cs_set_user_model(id, model) -} - -public __get_maxentities(plid, num) -{ - return get_maxentities() -} - -public __PointContents(plid, num) -{ - new Float:vCheckAt[3] - - get_array_f(1, vCheckAt, 3) - - return point_contents(vCheckAt) -} - -public __DispatchKeyValue(plid, num) -{ - new ent = get_param(1) - - new szClassname[32], szKey[32], szValue[32] - - if (pev_valid(ent)) - { - get_string(2, szKey, 31) - get_string(3, szValue, 31) - pev(ent, pev_classname, szClassname, 31) - - set_kvd(0, KV_ClassName, szClassname) - set_kvd(0, KV_KeyName, szKey) - set_kvd(0, KV_Value, szValue) - set_kvd(0, KV_fHandled, 0) - - dllfunc(DLLFunc_KeyValue, ent, 0) - } - - return 1 -} - -public __entity_use(plid, num) -{ - new entUsed = get_param(1) - new entOther = get_param(2) - return dllfunc(DLLFunc_Use,entUsed,entOther) -} - -public __get_num_ents(plid, num) -{ - return engfunc(EngFunc_NumberOfEntities) -} - -public __take_damage(plid, num) -{ - new victim = get_param(1) - new attacker = get_param(2) - new Float:orig[3] - get_array_f(3,orig,3) - new Float:dmg = get_param_f(4) - new bit = get_param(5) - new wpnName[64] - get_string(6,wpnName,63) - new hs = get_param(7) - - if(pev(victim,pev_takedamage) > DAMAGE_NO) - { - set_pev(victim,pev_dmg_inflictor,attacker) - - new Float:olddmg - pev(victim,pev_dmg_take,olddmg) - set_pev(victim,pev_dmg_take,olddmg+dmg) - - message_begin(MSG_ONE, g_msgDamage, {0,0,0} , victim) - write_byte(0) - write_byte(floatround(olddmg+dmg)) - write_long(bit) - write_coord(floatround(orig[0])) - write_coord(floatround(orig[1])) - write_coord(floatround(orig[2])) - message_end() - - new Float:health - pev(victim,pev_health,health) - if((dmg >= health) && (health > 0.0)) - { - Death(victim,attacker,wpnName,hs) - } else { - set_pev(victim,pev_health,health-dmg) - } - } -} - -/********************************* - ***** HOOKS ********************* - *********************************/ - -public Hook_ClientUserInfoChanged(id, buffer) -{ - if (g_PlayerModeled[id] && (pev(id, pev_deadflag) == DEAD_NO)) - { - return FMRES_SUPERCEDE - } - - return FMRES_IGNORED -} - -public Hook_FM_EmitSound(entid, channel, const sample[]) //we don't care about the rest -{ - new ret - - ExecuteForward(g_FwdEmitSound, ret, entid, sample) - - return (ret == PLUGIN_HANDLED) ? FMRES_SUPERCEDE : FMRES_IGNORED -} - -public Hook_FM_EmitAmbientSound(entid, Float:pos[3], const sample[]) //we don't care about the rest -{ - new ret - - ExecuteForward(g_FwdEmitAmbientSound, ret, entid, sample) - - return (ret == PLUGIN_HANDLED) ? FMRES_SUPERCEDE : FMRES_IGNORED -} - -public Hook_FM_SetModel(entid, const model[]) -{ - new ret - - ExecuteForward(g_FwdSetModel, ret, entid, model) - - return (ret == PLUGIN_HANDLED) ? FMRES_SUPERCEDE : FMRES_IGNORED -} - -public Hook_FM_TraceLine(Float:v1[3], Float:v2[3], noMonsters, skip_ent, ptr) -{ - g_LastTrace = ptr - - engfunc(EngFunc_TraceLine, v1, v2, noMonsters, skip_ent, ptr) - - new ret - - ExecuteForward(g_FwdTraceLine, ret, skip_ent) - - return (ret == PLUGIN_HANDLED) ? FMRES_SUPERCEDE : FMRES_IGNORED -} - -public Hook_FM_SetClientKeyValue(id, const infobuffer[], const key[], const value[]) -{ - new ret - - ExecuteForward(g_FwdSetCliKeyValue, ret, id, key, value) - - return (ret == PLUGIN_HANDLED) ? FMRES_SUPERCEDE : FMRES_IGNORED -} - -public Hook_FM_KeyValue(ent, kvd) -{ - new ret - - ExecuteForward(g_FwdKeyValue, ret, ent) - - return (ret == PLUGIN_HANDLED) ? FMRES_SUPERCEDE : FMRES_IGNORED -} - -public Hook_FM_Touch(ent1, ent2) -{ - new ret - - ExecuteForward(g_FwdTouch, ret, ent1, ent2) - - return (ret == PLUGIN_HANDLED) ? FMRES_SUPERCEDE : FMRES_IGNORED -} - -public Hook_FM_Think(entid) -{ - new ret - - ExecuteForward(g_FwdThink, ret, entid) - - return (ret == PLUGIN_HANDLED) ? FMRES_SUPERCEDE : FMRES_IGNORED -} - -public Hook_FM_Spawn(entid) -{ - new ret - - ExecuteForward(g_FwdSpawn, ret, entid) - - return (ret == PLUGIN_HANDLED) ? FMRES_SUPERCEDE : FMRES_IGNORED -} - -public Hook_FM_PlayerPreThink(id) -{ - new ret - - ExecuteForward(g_FwdClientPreThink, ret, id) - - return (ret == PLUGIN_HANDLED) ? FMRES_SUPERCEDE : FMRES_IGNORED -} - -public Hook_FM_PlayerPostThink(id) -{ - new ret - - if (g_PlayerModeled[id]) - { - new model[64] - GetClientKeyValue(id, "model", model, 63) - if (!equal(g_PlayerModels[id], model)) - { - SetClientKeyValue(id, "model", g_PlayerModels[id]) - } - } - - ExecuteForward(g_FwdClientPostThink, ret, id) - - return (ret == PLUGIN_HANDLED) ? FMRES_SUPERCEDE : FMRES_IGNORED -} diff --git a/plugins/include/amxmisc.inc b/plugins/include/amxmisc.inc index 3f307a2d..cae3cf67 100755 --- a/plugins/include/amxmisc.inc +++ b/plugins/include/amxmisc.inc @@ -12,19 +12,7 @@ #define _amxmisc_included #if !defined _amxmodx_included - #if defined AMXMOD_BCOMPAT - #include - #else - #include - #endif -#endif - -#if defined AMXMOD_BCOMPAT -#if defined _translator_included -#define SIMPLE_T(%1) _T(%1) -#else -#define SIMPLE_T(%1) %1 -#endif + #include #endif stock is_user_admin(id) @@ -60,11 +48,7 @@ stock cmd_access(id, level, cid, num, bool:accesssilent = false) { if (!accesssilent) { -#if defined AMXMOD_BCOMPAT - console_print(id, SIMPLE_T("You have no access to that command.")); -#else console_print(id,"%L",id,"NO_ACC_COM"); -#endif } return 0; } @@ -72,11 +56,7 @@ stock cmd_access(id, level, cid, num, bool:accesssilent = false) { new hcmd[32], hinfo[128], hflag; get_concmd(cid,hcmd,31,hflag,hinfo,127,level); -#if defined AMXMOD_BCOMPAT - console_print(id, SIMPLE_T("Usage: %s %s"), hcmd, SIMPLE_T(hinfo)); -#else console_print(id,"%L: %s %s",id,"USAGE",hcmd,hinfo); -#endif return 0; } @@ -113,11 +93,7 @@ stock cmd_target(id,const arg[],flags = CMDTARGET_OBEY_IMMUNITY) { if ( player != find_player("blj",arg) ) { -#if defined AMXMOD_BCOMPAT - console_print(id, SIMPLE_T("There are more clients matching to your argument")); -#else console_print(id,"%L",id,"MORE_CL_MATCHT"); -#endif return 0; } } @@ -127,11 +103,7 @@ stock cmd_target(id,const arg[],flags = CMDTARGET_OBEY_IMMUNITY) } if (!player) { -#if defined AMXMOD_BCOMPAT - console_print(id, SIMPLE_T("Client with that name or userid not found")); -#else console_print(id,"%L",id,"CL_NOT_FOUND"); -#endif return 0; } if (flags & CMDTARGET_OBEY_IMMUNITY) @@ -141,11 +113,7 @@ stock cmd_target(id,const arg[],flags = CMDTARGET_OBEY_IMMUNITY) { new imname[32]; get_user_name(player,imname,31); -#if defined AMXMOD_BCOMPAT - console_print(id, SIMPLE_T("Client ^"%s^" has immunity"), imname); -#else console_print(id,"%L",id,"CLIENT_IMM",imname); -#endif return 0; } } @@ -155,11 +123,7 @@ stock cmd_target(id,const arg[],flags = CMDTARGET_OBEY_IMMUNITY) { new imname[32]; get_user_name(player,imname,31); -#if defined AMXMOD_BCOMPAT - console_print(id, SIMPLE_T("That action can't be performed on dead client ^"%s^""), imname); -#else console_print(id,"%L",id,"CANT_PERF_DEAD",imname); -#endif return 0; } } @@ -169,11 +133,7 @@ stock cmd_target(id,const arg[],flags = CMDTARGET_OBEY_IMMUNITY) { new imname[32]; get_user_name(player,imname,31); -#if defined AMXMOD_BCOMPAT - console_print(id, SIMPLE_T("That action can't be performed on bot ^"%s^""), imname); -#else console_print(id,"%L",id,"CANT_PERF_BOT",imname); -#endif return 0; } } @@ -201,10 +161,7 @@ stock show_activity( id, const name[], const fmt[], any:... ) __amx_show_activity = register_cvar("amx_show_activity", "2"); } } -#if defined AMXMOD_BCOMPAT - new buffer[128]; - format_args( buffer , 127 , 2 ); -#else + new prefix[10]; if (is_user_admin(id)) { @@ -216,19 +173,9 @@ stock show_activity( id, const name[], const fmt[], any:... ) } new buffer[512]; vformat(buffer, charsmax(buffer), fmt, 4); -#endif + switch(get_pcvar_num(__amx_show_activity)) { -#if defined AMXMOD_BCOMPAT - case 2: // show name to all - { - client_print(0, print_chat, "%s %s: %s", is_user_admin(id) ? SIMPLE_T("ADMIN") : SIMPLE_T("PLAYER"), name, buffer); - } - case 1: // hide name to all - { - client_print(0, print_chat, "%s: %s", is_user_admin(id) ? SIMPLE_T("ADMIN") : SIMPLE_T("PLAYER"), buffer); - } -#else case 5: // hide name only to admins, show nothing to normal users { new __maxclients=get_maxplayers(); @@ -287,7 +234,6 @@ stock show_activity( id, const name[], const fmt[], any:... ) { client_print(0, print_chat, "%L: %s", LANG_PLAYER, prefix, buffer ); } -#endif } } diff --git a/plugins/include/amxmod_compat/VexdUM.inc b/plugins/include/amxmod_compat/VexdUM.inc deleted file mode 100644 index 404f0ec8..00000000 --- a/plugins/include/amxmod_compat/VexdUM.inc +++ /dev/null @@ -1,89 +0,0 @@ -/* VexdUM backwards compatibility - * - * by the AMX Mod X Development Team - * - * This file is provided as is (no warranties). - */ - - -#if !defined _fakemeta_included - #include -#endif - -#if !defined _engine_included - #include -#endif - -#if defined _vexd_bcompat_included - #endinput -#endif -#define _vexd_bcompat_included - -#include - -native radius_damage(inflictor, Float:dmg, Float:orig[3], Float:rad, bit = DMG_BULLET, wpnName[]="", hs = 0); -native take_damage(victim, attacker, Float:orig[3], Float:dmg, bit = DMG_BULLET, wpnName[]="", hs = 0); -native set_user_model(id, const Model[]=""); -native entity_use(eUsed, eOther); -native get_num_ents(); - -native DispatchKeyValue(ent, szKey[], szValue[]); - -// Trace a line from Start(X, Y, Z) to End(X, Y, Z), will return the point hit in vReturn[3] -// Will return an entindex if an entity is hit. -native trace_line(ent, Float:vStart[3], Float:vEnd[3], Float:vReturn[3]); - -native traceline_get_int(iVar); -native traceline_set_int(iVar, iVal); -native Float:traceline_get_float(iVar); -native traceline_set_float(iVar, Float:fVal); -native traceline_get_vector(iVar, Float:vVal[3]); -native traceline_set_vector(iVar, Float:vVal[3]); -native traceline_get_edict(iVar); -native traceline_set_edict(iVar, iEnt); - -/* Wrapper around pfn_touch */ -forward entity_touch(entity1, entity2); - -/* Wrapper around pfn_think */ -forward entity_think(entity); - -/* Wrapper around pfn_spawn */ -forward entity_spawn(entity); - -/* Wrapper around client_PreThink */ -forward client_prethink(id); - -/* Wrapper around client_PostThink */ -forward client_postthink(id); - -//From AMX Mod: -// Called when an Emitting Sound is played Server-Side -forward emitsound(entity, const sample[]); - -//From AMX Mod: -// Called when an Emitting Ambient Sound is played Server-Side -forward emitambientsound(entity, const sample[]); - -//From AMX Mod: -// Called when a model spawns -forward set_model(entity, const model[]); - -//From AMX Mod: -// Called whatever an entity looks at -forward traceline(entity); - -//:TODO: ? -// Called when a monster is hurt by VexdUM damage natives -// forward monster_hurt(monster, attacker, damage); - -//From AMX Mod: -// Called when a keyvalue is set on a player -forward setclientkeyvalue(id, key[], value[]); - -//From AMX Mod: -// Called when an entity gets a keyvalue set on it from the engine. -// Use copy_keyvalue to get the keyvalue information -forward keyvalue(entity); - -#include diff --git a/plugins/include/amxmod_compat/VexdUM_const.inc b/plugins/include/amxmod_compat/VexdUM_const.inc deleted file mode 100644 index f44dca62..00000000 --- a/plugins/include/amxmod_compat/VexdUM_const.inc +++ /dev/null @@ -1,30 +0,0 @@ -#if defined _vexdum_const_included - #endinput -#endif -#define _vexdum_const_included - -// TraceLine Integer -enum { - TR_INT_fAllSolid, // if true, plane is not valid - TR_INT_fStartSolid, // if true, the initial point was in a solid area - TR_INT_fInOpen, - TR_INT_fInWater, - TR_INT_iHitgroup, // 0 == generic, non zero is specific body part -}; - -// TraceLine Float -enum { - TR_FL_flFraction, // time completed, 1.0 = didn't hit anything - TR_FL_flPlaneDist, -}; - -// TraceLine Vector -enum { - TR_VEC_vecEndPos, // final position - TR_VEC_vecPlaneNormal, // surface normal at impact -}; - -// TraceLine Edict -enum { - TR_ENT_pHit, // entity the surface is on -}; diff --git a/plugins/include/amxmod_compat/VexdUM_stock.inc b/plugins/include/amxmod_compat/VexdUM_stock.inc deleted file mode 100644 index 051df957..00000000 --- a/plugins/include/amxmod_compat/VexdUM_stock.inc +++ /dev/null @@ -1,135 +0,0 @@ -/* VexdUM stocks backwards compatibility - * - * by the AMX Mod X Development Team - * - * This file is provided as is (no warranties). - */ - -#if defined _vexd_bcompat_stocks_included - #endinput -#endif -#define _vexd_bcompat_stocks_included - -#if !defined _engine_included - #include -#endif - -stock is_entity(ent) -{ - return pev_valid(ent); -} - -stock get_offset_int(ent, offset, linos = 5) -{ - return get_pdata_int(ent, offset, linos); -} - -stock set_offset_int(ent, offset, value, linos = 5) -{ - return set_pdata_int(ent, offset, value, linos); -} - -stock in_view_cone(ent, Float:Orig[3]) -{ - return is_in_viewcone(ent, Orig); -} - -stock get_maxentities() -{ - return global_get(glb_maxEntities); -} - -stock can_see(ent1, ent2) -{ - if (is_entity(ent1) && is_entity(ent2)) - { - new flags = pev(ent1, pev_flags); - if (flags & EF_NODRAW || flags & FL_NOTARGET) - { - return 0; - } - - new Float:lookerOrig[3]; - new Float:targetOrig[3]; - new Float:temp[3]; - - pev(ent1, pev_origin, lookerOrig); - pev(ent1, pev_view_ofs, temp); - lookerOrig[0] += temp[0]; - lookerOrig[1] += temp[1]; - lookerOrig[2] += temp[2]; - - pev(ent2, pev_origin, targetOrig); - pev(ent2, pev_view_ofs, temp); - targetOrig[0] += temp[0]; - targetOrig[1] += temp[1]; - targetOrig[2] += temp[2]; - - engfunc(EngFunc_TraceLine, lookerOrig, targetOrig, 0, ent1, 0); - if (get_tr2(0, TraceResult:TR_InOpen) && get_tr2(0, TraceResult:TR_InWater)) - { - return 0; - } else { - new Float:flFraction; - get_tr2(0, TraceResult:TR_flFraction, flFraction); - if (flFraction == 1.0 || (get_tr2(0, TraceResult:TR_pHit) == ent2)) - { - return 1; - } - } - } - - return 0; -} - -//From AMX Mod: -// Find an entity in the world, will return -1 if nothing is found -// type = 0: "classname" -// type = 1: "globalname" -// type = 2: "model" -// type = 3: "target" -// type = 4: "targetname" -// type = 5: "netname" -// type = 6: "message" -// type = 7: "noise" -// type = 8: "noise1" -// type = 9: "noise2" -// type = 10: "noise3" -// type = 11: "viewmodel" -// type = 12: "weaponmodel" - -stock vexd_find_entity(ent, szValue[], type=0) -{ - static _g_FindEntTypes[13][] = - { - "classname", - "globalname", - "model", - "target", - "targetname", - "netname", - "messages", - "noise", - "noise1", - "noise2", - "noise3", - "viewmodel", - "weaponmodel" - }; - - if (type < 0 || type >= 13) - { - type = 0; - } - - return engfunc(EngFunc_FindEntityByString, ent, _g_FindEntTypes[type], szValue); -} - -#define find_entity vexd_find_entity - -//From AMX Mod: -// Find an entity within a given origin and radius -stock find_entity_sphere(ent, Float:Orig[3], Float:Rad) -{ - return engfunc(EngFunc_FindEntityInSphere, ent, Orig, Rad); -} diff --git a/plugins/include/amxmod_compat/Vexd_Utilities.inc b/plugins/include/amxmod_compat/Vexd_Utilities.inc deleted file mode 100644 index 5c4d1a49..00000000 --- a/plugins/include/amxmod_compat/Vexd_Utilities.inc +++ /dev/null @@ -1,109 +0,0 @@ -/* Vexd Utility backwards compatibility -* -* by the AMX Mod X Development Team -* -* This file is provided as is (no warranties). -*/ - -#if defined _Vexd_Utilities_included - #endinput -#endif -#define _Vexd_Utilities_included - -#include -#if defined AMXMOD_BCOMPAT -#if !defined _vexd_bcompat_included -#include -#endif -#endif - -stock Entvars_Get_Int(iIndex, iVariable) - return entity_get_int(iIndex, iVariable); - -stock Entvars_Set_Int(iIndex, iVariable, iNewValue) - return entity_set_int(iIndex, iVariable, iNewValue); - -stock Float:Entvars_Get_Float(iIndex, iVariable) - return entity_get_float(iIndex, iVariable); - -stock Entvars_Set_Float(iIndex, iVariable, Float:fNewValue) - return entity_set_float(iIndex, iVariable, fNewValue); - -stock Entvars_Get_Vector(iIndex, iVariable, Float:vRetVector[3]) - return entity_get_vector(iIndex, iVariable, vRetVector); - -stock Entvars_Set_Vector(iIndex, iVariable, Float:vNewVector[3]) - return entity_set_vector(iIndex, iVariable, vNewVector); - -stock Entvars_Get_Edict(iIndex, iVariable) - return entity_get_edict(iIndex, iVariable); - -stock Entvars_Set_Edict(iIndex, iVariable, iNewIndex) - return entity_set_edict(iIndex, iVariable, iNewIndex); - -stock Entvars_Get_String(iIndex, iVariable, szReturnValue[], iReturnLen) - return entity_get_string(iIndex, iVariable, szReturnValue, iReturnLen); - -stock Entvars_Set_String(iIndex, iVariable, szNewValue[]) - return entity_set_string(iIndex, iVariable, szNewValue); - -stock Entvars_Get_Byte(iIndex, iVariable) - return entity_get_byte(iIndex, iVariable); - -stock Entvars_Set_Byte(iIndex, iVariable, iNewValue) - return entity_set_byte(iIndex, iVariable, iNewValue); - -stock CreateEntity(szClassname[]) - return create_entity(szClassname); - -stock ENT_SetModel(iIndex, szModel[]) - return entity_set_model(iIndex, szModel); - -stock ENT_SetOrigin(iIndex, Float:fNewOrigin[3]) - return entity_set_origin(iIndex, fNewOrigin); - -stock FindEntity(iIndex, szValue[]) - return find_ent_by_class(iIndex, szValue); - -stock RemoveEntity(iIndex) - return remove_entity(iIndex); - -stock TraceLn(iIgnoreEnt, Float:fStart[3], Float:fEnd[3], Float:vReturn[3]) - return trace_line(iIgnoreEnt, fStart, fEnd, vReturn); - -stock TraceNormal(iIgnoreEnt, Float:fStart[3], Float:fEnd[3], Float:vReturn[3]) - return trace_normal(iIgnoreEnt, fStart, fEnd, vReturn); - -stock VecToAngles(Float:fVector[3], Float:vReturn[3]) - return vector_to_angle(fVector, vReturn); - -stock Float:VecLength(Float:vVector[3]) - return vector_length(vVector); - -stock Float:VecDist(Float:vVector[3], Float:vVector2[3]) - return vector_distance(vVector, vVector2); - -stock MessageBlock(iMessage, iMessageFlags) - return set_msg_block(iMessage, iMessageFlags); - -stock GetMessageBlock(iMessage) - return get_msg_block(iMessage); - -stock Float:HLTime() - return halflife_time(); - -stock FakeTouch(iToucher, iTouched) - return fake_touch(iToucher, iTouched); - -stock AttachView(iIndex, iTargetIndex) - return attach_view(iIndex, iTargetIndex); - -stock SetView(iIndex, ViewType) - return set_view(iIndex, ViewType); - -stock SetSpeak(iIndex, iSpeakFlags) - return set_speak(iIndex, iSpeakFlags); - -forward vexd_pfntouch(pToucher, pTouched); - -forward ServerFrame(); diff --git a/plugins/include/amxmod_compat/amxmod.inc b/plugins/include/amxmod_compat/amxmod.inc deleted file mode 100644 index d84a7a19..00000000 --- a/plugins/include/amxmod_compat/amxmod.inc +++ /dev/null @@ -1,318 +0,0 @@ -/* AMX Mod X Backwards Compatibility - * - * by the AMX Mod X Development Team - * - * This file is provided as is (no warranties). - */ - -#if defined _amxmod_included - #endinput -#endif -#define _amxmod_included - -#if !defined AMXMOD_BCOMPAT - #define AMXMOD_BCOMPAT -#endif - -#include -#include -#include -#include -#include - -stock AMX_VERSION[] = "1.76-BC"; - -#define ADMIN_PERMBAN ADMIN_BAN //AMX Mod admin flag for permanent ban -#define ADMIN_UNBAN ADMIN_BAN //AMX Mod admin flag for unbanning -#define ADMIN_SUPREME ADMIN_IMMUNITY //AMX Mod admin flag for "super admin" (can kick, slap, ban, slay admins with Immunity) - -/* Core will identify us as an "old plugin" this way. */ -public __b_old_plugin = 1; - -public __b_ident_vers() -{ - return __b_old_plugin; -} - -stock user_spawn(index) - return spawn(index); - -stock get_logfile( name[], len ) - return get_time("admin%m%d.log",name,len); - -stock get_user_money(index) - return cs_get_user_money(index); - -stock set_user_money(index,money,flash=1) - return cs_set_user_money(index,money,flash); - -stock numtostr(num,string[],len) - return num_to_str(num,string,len); - -stock strtonum(const string[]) - return str_to_num(string); - -stock build_path(path[], len, {Float,_}:... ) -{ - format_args(path, len, 2); - new pathlen = strlen(path); - new basedir[32]; - if (containi(path, "$basedir") != -1) - { - get_localinfo("amxx_basedir", basedir, 31); - if (!basedir[0]) - { - copy(basedir, 31, "addons/amxmodx"); - } - if ((pathlen+strlen(basedir)-strlen("$basedir")) < len) - { - replace(path, len, "$basedir", basedir); - } - } - new dir[64], subdir[63]; - if (containi(path, "$configdir") != -1) - { - get_localinfo("amxx_configsdir", dir, 63); - if (!dir[0]) - { - format(dir, 63, "%s/configs", basedir); - } - if ((pathlen+strlen(basedir)-strlen("$configdir")) < len) - { - replace(path, len, "$configdir", dir); - } - dir[0] = '^0'; - } - if (containi(path, "$langdir") != -1) - { - get_localinfo("amxx_datadir", subdir, 63); - if (!subdir[0]) - { - format(subdir, 63, "%s/data", basedir); - } - format(dir, 63, "%s/amxmod-lang", subdir); - if ((pathlen+strlen(basedir)-strlen("$langdir")) < len) - { - replace(path, len, "$langdir", dir); - } - dir[0] = '^0'; - } - if (containi(path, "$modulesdir") != -1) - { - get_localinfo("amxx_modules", dir, 63); - if (!dir[0]) - { - format(dir, 63, "%s/modules", basedir); - } - if ((pathlen+strlen(basedir)-strlen("$modulesdir")) < len) - { - replace(path, len, "$modulesdir", dir); - } - dir[0] = '^0'; - } - if (containi(path, "$pluginsdir") != -1) - { - get_localinfo("amx_pluginsdir", dir, 63); - if( !dir[0]) - { - format(dir, 63, "%s/plugins", basedir); - } - if ((pathlen+strlen(basedir)-strlen("$pluginsdir")) < len) - { - replace(path, len, "$pluginsdir", dir); - } - dir[0] = '^0'; - } - if (containi(path, "$logdir") != -1) - { - get_localinfo("amx_logs", dir, 63); - if (!dir[0]) - { - format(dir, 63, "%s/logs", basedir); - } - if ((pathlen+strlen(basedir)-strlen("$logdir")) < len) - { - replace(path, len, "$logdir", dir); - } - } - return 1; -} - -stock is_user_authorized(id) -{ - static auth[32]; - - get_user_authid(id, auth, 31); - if (auth[0] == 0 || equali(auth, "STEAM_ID_PENDING")) - { - return 0; - } - - return 1; -} - -/* Vector AMX Mod compatibility */ -#define ANGLEVECTORS_FORWARD 1 -#define ANGLEVECTORS_RIGHT 2 -#define ANGLEVECTORS_UP 3 - -stock angle_to_vector(Float:vector[3], FRU, Float:ret[3]) -{ - return angle_vector(vector, FRU, ret); -} - -stock get_cmdaccess(cmd[], accessflags[], len) -{ - new num = get_concmdsnum(-1); - new command[32], info[3]; - new flags; - - for (new i=0; i -#endif - -stock Float:fabs(Float:value) -{ - return floatabs(value); -} - -stock Float:asin(Float:value) -{ - return floatasin(value, radian); -} - -stock Float:sin(Float:value) -{ - return floatsin(value, radian); -} - -stock Float:sinh(Float:value) -{ - return floatsinh(value, radian); -} - -stock Float:acos(Float:value) -{ - return floatacos(value, radian); -} - -stock Float:cos(Float:value) -{ - return floatcos(value, radian); -} - -stock Float:cosh(Float:value) -{ - return floatcosh(value, radian); -} - -stock Float:atan(Float:value) -{ - return floatatan(value, radian); -} - -stock Float:atan2(Float:value1, Float:value2) -{ - return floatatan2(value1, value2, radian); -} - -stock Float:tan(Float:value) -{ - return floattan(value, radian); -} - -stock Float:tanh(Float:value) -{ - return floattanh(value, radian); -} - -stock Float:fsqroot(Float:value) -{ - return floatsqroot(value); -} - -stock Float:fpower(Float:value, Float:exponent) -{ - return floatpower(value, exponent); -} - -stock Float:flog(Float:value, Float:base=10.0) -{ - return floatlog(value, base); -} diff --git a/plugins/include/amxmod_compat/mysql.inc b/plugins/include/amxmod_compat/mysql.inc deleted file mode 100644 index 09d22fe3..00000000 --- a/plugins/include/amxmod_compat/mysql.inc +++ /dev/null @@ -1,20 +0,0 @@ - -#if defined _mysql_included - #endinput -#endif -#define _mysql_included - -#include - -native mysql_connect(host[], user[], pass[], dbname[], error[], maxlength); -native mysql_query(sql, query[], {Float,_}:... ); -native mysql_error(sql, dest[], maxlength); -native mysql_close(sql); -native mysql_nextrow(sql); -native mysql_getfield(sql, fieldnum, {Float,_}:... ); -native mysql_getresult(sql, field[], {Float,_}:... ); -native mysql_affected_rows(sql); -native mysql_num_fields(sql); -native mysql_num_rows(sql); -native mysql_field_name(sql, field, name[], length); -native mysql_insert_id(sql); diff --git a/plugins/include/amxmod_compat/translator.inc b/plugins/include/amxmod_compat/translator.inc deleted file mode 100644 index 87551b28..00000000 --- a/plugins/include/amxmod_compat/translator.inc +++ /dev/null @@ -1,86 +0,0 @@ -/* AMX Mod X Backwards Compatibility - * - * by the AMX Mod X Development Team - * - * This file is provided as is (no warranties). - */ - -#if defined _amxmod_translator_included - #endinput -#endif -#define _amxmod_translator_included - -#define _translator_included - -#include -#include -#include - -//From AMX Mod. This is implemented in Core due to the nature of the -// translation engine and what AMX Mod did. -/* Translation backend, used by _T (since natives can't return arrays). */ -native translate(const string[], destid=-1, forcelang=-1); - -stock _T(const string[], destid=-1, forcelang=-1) -{ - new TranslationResult[2] = {0, 0}; - TranslationResult[0] = translate(string, destid, forcelang); - return TranslationResult; -} - -stock load_translations(const file[]) -{ - static dir[255], path[255]; - get_datadir(dir, 254); - - format(path, 254, "%s/amxmod-lang/%s.txt", dir, file); - new fp - if (!(fp=fopen(path, "r"))) - { - abort(AMX_ERR_NATIVE, "Could not find file: %s", path); - return 0; - } - - static buffer[1024]; - new lang[3]; - new TransKey:bad_key = TransKey:-1; - new TransKey:cur_key = bad_key; - new len; - while (!feof(fp)) - { - buffer[0] = 0; - fgets(fp, buffer, 1023); - len = strlen(buffer); - if (len == 0) - { - continue; - } - if (isspace(buffer[len-1])) - { - buffer[--len] = 0; - } - if (buffer[0] == '"') - { - remove_quotes(buffer); - cur_key = CreateLangKey(buffer); - AddTranslation("en", cur_key, buffer); - continue; - } - if (isspace(buffer[0])) - { - continue; - } - if ((cur_key != bad_key) && (buffer[2] == ':' && buffer[3] == '"')) - { - lang[0] = buffer[0]; - lang[1] = buffer[1]; - lang[2] = 0; - remove_quotes(buffer[3]); - AddTranslation(lang, cur_key, buffer[3]); - } - } - - fclose(fp); - - return 1; -} diff --git a/plugins/include/amxmod_compat/xtrafun.inc b/plugins/include/amxmod_compat/xtrafun.inc deleted file mode 100644 index 45031687..00000000 --- a/plugins/include/amxmod_compat/xtrafun.inc +++ /dev/null @@ -1,97 +0,0 @@ -/* Xtrafun backwards compatibility -* -* by the AMX Mod X Development Team -* These natives were originally made by SpaceDude, EJ, and JustinHoMi. -* -* This file is provided as is (no warranties). -*/ - -#if !defined _xtrafun_included - #define _xtrafun_included - -#if !defined _engine_included - #include -#endif - -/* Gets the velocity of an entity */ -stock get_entity_velocity(index, velocity[3]) { - new Float:vector[3]; - entity_get_vector(index, EV_VEC_velocity, vector); - FVecIVec(vector, velocity); -} - -/* Sets the velocity of an entity */ -stock set_entity_velocity(index, velocity[3]) { - new Float:vector[3]; - IVecFVec(velocity, vector); - entity_set_vector(index, EV_VEC_velocity, vector); -} - -/* Gets the origin of an entity */ -stock get_entity_origin(index, origin[3]) { - new Float:vector[3]; - entity_get_vector(index, EV_VEC_origin, vector); - FVecIVec(vector, origin); -} - -/* Sets the origin of an entity */ -stock set_entity_origin(index, origin[3]) { - new Float:vector[3]; - IVecFVec(origin, vector); - entity_set_vector(index, EV_VEC_origin, vector); -} - -/* Get the index of the grenade belonging to index. - * Model of grenade is returned in model[]. - * Specify the grenadeindex to start searching from, - * or leave it at 0 to search from the start. - * Returns grenade index. - * Paths + models of grenades in Counter-Strike: - * HEGRENADE = "models/w_hegrenade.mdl" - * FLASHBANG = "models/w_flashbang.mdl" - * SMOKEGRENADE = "models/w_smokegrenade.mdl" */ -stock get_grenade_index(index, model[], len, grenadeindex = 0) { - new entfind = grenadeindex; - new entowner = index; - - for (;;) { - entfind = find_ent_by_class(entfind, "grenade"); - - if (entfind && is_valid_ent(entfind)) { - if (entity_get_edict(entFind, EV_ENT_owner) == entowner) { - entity_get_string(entfind, EV_SZ_model, model); - return entfind; - } - } - else { - // Eventually comes here if loop fails to find a grenade with specified owner. - return 0; - } - } -} - -/* Find the number of entities in the game */ -stock current_num_ents() { - return entity_count(); -} - -enum { - classname = 0, - target, - targetname -}; - -#if !defined _vexd_bcompat_included -/* Find an entity ID from start_from_ent id (use 0 to start from - * the beginning, category is either "classname", "target" or - * "targetname", value is the name you are searching for */ -stock find_entity(start_from_ent, category, value[]) { - switch (category) { - case target: return find_ent_by_target(start_from_ent, value); - case targetname: return find_ent_by_tname(start_from_ent, value); - } - return find_ent_by_class(start_from_ent, value); -} -#endif - -#endif // _xtrafun_included \ No newline at end of file diff --git a/plugins/include/engine.inc b/plugins/include/engine.inc index a5544e4a..375b5a25 100755 --- a/plugins/include/engine.inc +++ b/plugins/include/engine.inc @@ -121,9 +121,7 @@ native fake_touch(entTouched, entToucher); /* 2 formats. Format: DispatchKeyValue("KeyName","Value") - sets keyvalues for the entity specified in the keyvalue() forward. Format: DispatchKeyValue(index,"KeyName","Value") - Sets keyvalue for entity not specified in keyvalue() forward. */ -#if !defined AMXMOD_BCOMPAT native DispatchKeyValue(...); -#endif native get_keyvalue(entity, const szKey[], value[], maxLength); @@ -133,18 +131,14 @@ native copy_keyvalue(szClassName[],sizea,szKeyName[],sizeb,szValue[],sizec); native DispatchSpawn(iIndex); /* Hurts/Kills players in a sphere, like an explosion, Multiplier determines damage. */ -#if !defined AMXMOD_BCOMPAT native radius_damage(const Float:fExplodeAt[3], iDamageMultiplier, iRadiusMultiplier); -#endif /* Will return the contents of a point (inside map? in sky? outside map? etc.). */ native point_contents(const Float:fCheckAt[3]); /* Trace a line from Start(X, Y, Z) to End(X, Y, Z), will return the point hit in vReturn[3] * and an entity index if an entity is hit. */ -#if !defined AMXMOD_BCOMPAT native trace_line(iIgnoreEnt, const Float:fStart[3], const Float:fEnd[3], Float:vReturn[3]); -#endif /* Traces a hull. */ native trace_hull(const Float:origin[3],hull,ignoredent=0,ignoremonsters=0); diff --git a/plugins/include/ns2amx.inc b/plugins/include/ns2amx.inc deleted file mode 100755 index c85823b2..00000000 --- a/plugins/include/ns2amx.inc +++ /dev/null @@ -1,263 +0,0 @@ -/* NS2AMX Utility backwards compatibility -* -* by the AMX Mod X Development Team -* -* This file is provided as is (no warranties). -*/ - -#if defined _ns2amx_included - #endinput -#endif -#define _ns2amx_included - -#include // various engine calls -#include // pev/engfunc/dllfunc/various calls which rely on engfunc/dllfunc -#include // ns specifics - -stock is_entity(id) - return is_valid_ent(id); - -/* The end of the native is buffered incase the plugin is including an NS_VERSION (no longer supported), ignore it */ -stock get_build(classname[], value, number=0,any:...) - return ns_get_build(classname, value, number); - -stock get_private_i(index, offset, linuxdiff=5) - return get_pdata_int(index, offset, linuxdiff); - -stock set_private_i(index, offset, value, linuxdiff=5) -{ - return set_pdata_int(index, offset, value, linuxdiff); -} - -stock Float:get_private_f(index, offset, linuxdiff=5) -{ - return get_pdata_float(index, offset, linuxdiff); -} - -stock set_private_f(index, offset, Float:value, linuxdiff=5) -{ - return set_pdata_float(index, offset, value, linuxdiff); -} - -stock make_string(value[]) - return engfunc(EngFunc_AllocString,value); - -stock string(value, ret[]) -{ - new szString[128]; - engfunc(EngFunc_SzFromIndex,value,szString,127); - copy(ret,127,szString); -} - -stock gpgobals_time() - return floatround(halflife_time()); - -stock Float:get_range(ida, idb) - return entity_range(ida, idb); - -stock supercede() - return 0; - -stock register_clientkill() - return 0; - -stock register_changelvl() - return 0; - -stock register_msgblock(msgName[]) - return set_msg_block(get_user_msgid(msgName), BLOCK_SET); - -stock register_msgedit(msgName[], cmd[]) - return register_message(get_user_msgid(msgName), cmd); - -stock register_playback(event, cmd[]) - return 0; - -stock get_spawn(type, number=0, Float:ret[3]) - return ns_get_spawn(type, number, ret); - -stock has_weapon(index, weapon, setweapon=-1) - return ns_has_weapon(index, weapon, setweapon); - -stock gpglobals_v(type, Float:ret[3]) -{ - new v_type=0; - switch (type) - { - case 1: - v_type = GL_v_forward; - case 2: - v_type = GL_v_right; - case 3: - v_type = GL_v_up; - } - if (!v_type) - return 0; - return get_global_vector(v_type, ret); -} - -stock pev_i(_index,_field) - return pev(_index,_field); - -stock set_pev_i(_index, _field, _val) - return set_pev(_index,_field,_val); - -stock Float:pev_f(_index,_field) -{ - new Float:f; - pev(_index,_field,f); - return f; -} -stock set_pev_f(_index,_field,Float:_val) - return set_pev(_index,_field,_val); - - -stock msg_args() - return get_msg_args(); - -stock Float:msg_loc(vec) -{ - new Float:Ret[3]; - get_msg_origin(Ret); - if (vec < 0 || vec > 3) - return float(0); - else - return Ret[vec]; - - return 0.0; // make compiler happy! -} - -stock msg_dest() - return 0; - -stock msg_type() - return 0; - -stock msg_name() - return 0; - -stock msg_set_s(number, value[]) - return set_msg_arg_string(number, value); - -stock msg_set_f(number, Float:value) - return set_msg_arg_float(number, get_msg_argtype(number), value); - -stock msg_set_i(number, value) - return set_msg_arg_int(number, get_msg_argtype(number), value); - -stock msg_data_type(value) - return get_msg_argtype(value); - -stock msg_strdata(value) - return 0; - -stock msg_data(value, ...) -{ - return (0*value); -} - -stock get_filename(szFile[], len=-1) -{ - new name[16], version[16], author[16], status[16]; - new res = get_plugin(0, szFile, len, name, 16, version, 16, author, 16, status, 16); - return res; -} - -stock get_speedchange(id) - return ns_get_speedchange(id); - -stock set_speedchange(id, speed) - return ns_set_speedchange(id,speed); - -stock get_maxspeed(id) - return ns_get_maxspeed(id); - -stock set_player_model(id, model[]="") - return ns_set_player_model(id, model); - -stock set_player_skin(id, skin=-1) - return ns_set_player_skin(id, skin); - -stock set_player_body(id, body=-1) - return ns_set_player_body(id, body); - -stock ns2amx_version() - return 0; - -stock set_kvhandled() - return 0; - -stock ns2amx_getammo(id,Weapon) - return ns_get_weap_reserve(id, Weapon); - -stock ns2amx_setammo(id,Weapon,Value) - return ns_set_weap_reserve(id, Weapon, Value); - -stock ns2amx_giveitem(id,svClassname[]) - return ns_give_item(id, svClassname); - -stock ns2amx_moveto(idMoved,idDest) -{ - new Float:origin[3]; - entity_get_vector(idDest, EV_VEC_origin,origin); - entity_set_origin(idMoved, origin); - return 1; -} -/* Returns whether or not the player has the MASK_DIGESTING flag set. */ -stock ns2amx_isdigesting(id) - return ns_get_mask(id,MASK_DIGESTING); - -/* Returns total # of active hives. */ -stock ns2amx_gethives() - return ns_get_build("team_hive",1); - -/* Returns 1 if the two entities are within the given range. */ -stock ns2amx_inrange(ida,idb,range) -{ - if (entity_range(ida,idb) <= range) - return 1; - return 0; -} - -stock ns2amx_nspopup(id,svMessage[190]) { - new szMessage[180]; - copy(szMessage,179,svMessage); - return ns_popup(id, szMessage); -} - -stock ns2amx_setres(id,value) - return ns_set_res(id, float(value)); - -stock ns2amx_getenergy(id) - return floatround(ns_get_energy(id)); - -stock ns2amx_setenergy(id,energy) - return ns_set_energy(id, float(energy)); - -stock ns2amx_getjpfuel(id) - return floatround(ns_get_jpfuel(id)); - -stock ns2amx_setjpfuel(id,fuel) - return ns_set_jpfuel(id, float(fuel)); - -stock get_mask(id,mask) - return ns_get_mask(id, mask); - -stock set_mask(id,mask,value) - return ns_set_mask(id,mask,value); - -stock get_special(id,mask) -{ - if (pev(id,pev_iuser4) & mask) - return 1; - return 0; -} - -stock get_res(id) - return floatround(ns_get_res(id)); - -stock get_class(id) - return ns_get_class(id); - -stock is_combat() - return ns_is_combat(); diff --git a/plugins/include/xs.inc b/plugins/include/xs.inc index 22574869..fe9d77a8 100755 --- a/plugins/include/xs.inc +++ b/plugins/include/xs.inc @@ -101,25 +101,6 @@ #define XS_REPLACEBUF_SIZE 3072 #endif -// **** Detect platform -#define XS_AMX 0 -#define XS_AMXX 1 - -#if defined _amxmodx_included - #define XS_PLATFORM XS_AMXX -#endif - -#if defined _amxmod_included && !defined _amxmodx_included - #define XS_PLATFORM XS_AMX -#endif - -#if !defined XS_PLATFORM - // Could not detect platform. - // Make sure you include amxmodx.inc or amxmod.inc before including xs.inc - #assert 0 - #endinput -#endif - // Turn on for release #define XS__LIBRELEASE 1 @@ -167,19 +148,9 @@ format_args(buffer, XS_LOGBUFFER_SIZE, 1 /* go from SECOND argument*/); new bool:addLogTypeName = strlen(xs__logtypenames[logtype]) ? true : false; - #if XS_PLATFORM == XS_AMX - new plugname[32]; - new dummy[1]; - get_plugin(-1, plugname, 31, dummy, 0, dummy, 0, dummy, 0, dummy, 0, dummy[0]); - // log into HL Logs - log_message("[AMX][%s]: %s%s%s", plugname, addLogTypeName ? xs__logtypenames[logtype] : "", - addLogTypeName ? ": " : "", buffer); - #else // assume AMXX - - // Use AMXX's logging system - log_amx("%s%s%s", addLogTypeName ? xs__logtypenames[logtype] : "", - addLogTypeName ? ": " : "", buffer); - #endif + // Use AMXX's logging system + log_amx("%s%s%s", addLogTypeName ? xs__logtypenames[logtype] : "", + addLogTypeName ? ": " : "", buffer); } // Assertion @@ -214,15 +185,6 @@ /****** BASIC STUFF ******/ - #if XS_PLATFORM == XS_AMX - enum anglemode - { - radian = 0, - degrees, - grades - } - #endif - // Returns -1 if num is negative, 0 if num is 0, 1 if num is positive // tested XS_LIBFUNC_ATTRIB xs_sign(num) @@ -284,36 +246,14 @@ // tested XS_LIBFUNC_ATTRIB Float:xs_rsqrt(Float:x) { - #if XS_PLATFORM == XS_AMX - // store half - new Float:xhalf = x * 0.5; - - // compute initial guess - new i = _:x; - i = 0x5f375a84 - (i >> 1); - x = Float:i; - - // refine 3 times - x = x * (1.5 - xhalf * x * x); - x = x * (1.5 - xhalf * x * x); - x = x * (1.5 - xhalf * x * x); - - return x; - #else - return 1.0 / floatsqroot(x); - #endif + return 1.0 / floatsqroot(x); } // sqrt // tested XS_LIBFUNC_ATTRIB Float:xs_sqrt(Float:x) { - #if XS_PLATFORM == XS_AMX - // 1.0 / rsqrt should still be faster than loop-using-approximation-methods - return 1.0 / xs_rsqrt(x); - #else - return floatsqroot(x); - #endif + return floatsqroot(x); } // These functions generate errors if you use the macros with wrong parameter count. @@ -373,47 +313,14 @@ #pragma unused rawr } - #if XS_PLATFORM == XS_AMX - #pragma semicolon 0 - #include - #pragma semicolon 1 - // We need stocks to provide radian / degrees / grades functionality - - XS_LIBFUNC_ATTRIB Float:xs__2rad(Float:x, anglemode:mod) - { - switch (mod) - { - case radian: - return x; - case degrees: - return xs_deg2rad(x); - case grades: - return xs_gra2rad(x); - default: - xs_assert(0, "xs_asin, xs_sin, xs_acos, xs_cos, xs_atan, xs_atan2 or xs_tan called with invalid mod param"); - } - - return 0.0; // compiler warning - } - - #define xs_fabs(%1) fabs(%1) - #define xs_asin(%1,%2) asin(xs__2rad(%1, %2)) - #define xs_sin(%1,%2) sin(xs__2rad(%1, %2)) - #define xs_acos(%1,%2) acos(xs__2rad(%1, %2)) - #define xs_cos(%1,%2) cos(xs__2rad(%1, %2)) - #define xs_atan(%1,%2) atan(xs__2rad(%1, %2)) - #define xs_atan2(%1,%2) atan2(xs__2rad(%1, %2)) - #define xs_tan(%1,%2) tan(xs__2rad(%1, %2)) - #else - #define xs_fabs(%1) floatabs(%1) - #define xs_asin(%1,%2) floatasin(%1, %2) - #define xs_sin(%1,%2) floatsin(%1, %2) - #define xs_acos(%1,%2) floatacos(%1, %2) - #define xs_cos(%1,%2) floatcos(%1, %2) - #define xs_atan(%1,%2) floatatan(%1, %2) - #define xs_atan2(%1,%2) floatatan2(%1, %2) - #define xs_tan(%1,%2) floattan(%1, %2) - #endif + #define xs_fabs(%1) floatabs(%1) + #define xs_asin(%1,%2) floatasin(%1, %2) + #define xs_sin(%1,%2) floatsin(%1, %2) + #define xs_acos(%1,%2) floatacos(%1, %2) + #define xs_cos(%1,%2) floatcos(%1, %2) + #define xs_atan(%1,%2) floatatan(%1, %2) + #define xs_atan2(%1,%2) floatatan2(%1, %2) + #define xs_tan(%1,%2) floattan(%1, %2) /****** RANDOM NUMBERS ******/ // This routine comes from the book "Inner Loops" by Rick Booth, Addison-Wesley @@ -961,16 +868,6 @@ return xs_replace(text, len, arr[0], arr[2]); } - #if XS_PLATFORM == XS_AMX - // message_begin checking for AMX - xs__hook_message_begin(dest, msg_type, origin[3]={0,0,0}, player = 0) - { - xs_assert(xs_is_msg_valid(msg_type), "message_begin called with bogus message type"); - return message_begin(dest, msg_type, origin, player); - } - - #define message_begin xs__hook_message_begin - #endif /****** MISC FUNCS *******/ // sets namestr to name of the command identified by cid // half-tested diff --git a/support/PackageScript b/support/PackageScript index ed4b38c8..265ad942 100644 --- a/support/PackageScript +++ b/support/PackageScript @@ -22,9 +22,7 @@ folder_list = [ 'base/addons/amxmodx/modules', 'base/addons/amxmodx/plugins', 'base/addons/amxmodx/scripting', - 'base/addons/amxmodx/scripting/amxmod_compat', 'base/addons/amxmodx/scripting/include', - 'base/addons/amxmodx/scripting/include/amxmod_compat', 'base/addons/amxmodx/scripting/testsuite', 'cstrike/addons/amxmodx/configs', 'cstrike/addons/amxmodx/data', @@ -215,10 +213,6 @@ scripting_files = [ 'telemenu.sma', 'timeleft.sma', 'pluginmenu.sma', - 'amxmod_compat/amxmod_compat.sma', - 'amxmod_compat/core.sma', - 'amxmod_compat/mysql.sma', - 'amxmod_compat/vexdum.sma', 'testsuite/admins_test.sma', 'testsuite/arraytest.sma', 'testsuite/callfunc_test.sma', @@ -265,7 +259,6 @@ scripting_files = [ 'include/geoip.inc', 'include/lang.inc', 'include/ns.inc', - 'include/ns2amx.inc', 'include/ns_const.inc', 'include/nvault.inc', 'include/regex.inc', @@ -295,15 +288,6 @@ scripting_files = [ 'include/svn_version.inc', 'include/time.inc', 'include/vector.inc', - 'include/amxmod_compat/VexdUM.inc', - 'include/amxmod_compat/VexdUM_const.inc', - 'include/amxmod_compat/VexdUM_stock.inc', - 'include/amxmod_compat/Vexd_Utilities.inc', - 'include/amxmod_compat/amxmod.inc', - 'include/amxmod_compat/maths.inc', - 'include/amxmod_compat/mysql.inc', - 'include/amxmod_compat/translator.inc', - 'include/amxmod_compat/xtrafun.inc', ] for filename in scripting_files: output_folder = 'base/addons/amxmodx/scripting'