From 6457fc45c7da8b70d60b330f25f863b9985bbef4 Mon Sep 17 00:00:00 2001 From: Pavol Marko Date: Mon, 8 Nov 2004 19:51:20 +0000 Subject: [PATCH] On dedicated servers, the command "amxx" now prints the AMX Mod X version --- amxmodx/meta_api.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/amxmodx/meta_api.cpp b/amxmodx/meta_api.cpp index 116541e2..209ca42b 100755 --- a/amxmodx/meta_api.cpp +++ b/amxmodx/meta_api.cpp @@ -602,6 +602,19 @@ void C_ClientCommand( edict_t *pEntity ) { META_RES result = MRES_IGNORED; cell ret = 0; int err; + const char* cmd = CMD_ARGV(0); + const char* arg = CMD_ARGV(1); + + // Handle "amxx" if not on listenserver + if (IS_DEDICATED_SERVER()) + { + if (cmd && stricmp(cmd, "amxx")==0) + { + // Print version + CLIENT_PRINT(pEntity, print_console, AMX_VERSION); + RETURN_META(MRES_SUPERCEDE); + } + } #ifdef ENABLEEXEPTIONS try @@ -618,10 +631,7 @@ void C_ClientCommand( edict_t *pEntity ) { } #endif - /* check for command and if needed also for first argument and call proper function */ - const char* cmd = CMD_ARGV(0); - const char* arg = CMD_ARGV(1); #ifdef ENABLEEXEPTIONS try{