diff --git a/Makefile b/Makefile index f9f6f47..2bf6a87 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ SOURCEDIR=src SMINCLUDES=env/include BUILDDIR=build -SPCOMP=env/linux/bin/spcomp-1.3.4 +SPCOMP=env/linux/bin/spcomp-1.4.0-3218 VERSIONDUMP=./updateversion.sh vpath %.sp $(SOURCEDIR) diff --git a/compile.bat b/compile.bat index 38e5e5b..fc407ee 100644 --- a/compile.bat +++ b/compile.bat @@ -3,7 +3,7 @@ set SOURCEDIR=src set SMINCLUDES=env\include set BUILDDIR=build -set SPCOMP=env\win32\bin\spcomp-1.3.4.exe +set SPCOMP=env\win32\bin\spcomp-1.4.0-3218.exe set VERSIONDUMP=updateversion.bat :: Dump version and revision information first. diff --git a/env/linux/bin/spcomp-1.3.4 b/env/linux/bin/spcomp-1.3.4 deleted file mode 100755 index 0410aee..0000000 Binary files a/env/linux/bin/spcomp-1.3.4 and /dev/null differ diff --git a/env/linux/bin/spcomp-1.4.0-3218 b/env/linux/bin/spcomp-1.4.0-3218 new file mode 100644 index 0000000..a80107c Binary files /dev/null and b/env/linux/bin/spcomp-1.4.0-3218 differ diff --git a/env/win32/bin/spcomp-1.3.4.exe b/env/win32/bin/spcomp-1.3.4.exe deleted file mode 100644 index c3aaf89..0000000 Binary files a/env/win32/bin/spcomp-1.3.4.exe and /dev/null differ diff --git a/env/win32/bin/spcomp-1.4.0-3218.exe b/env/win32/bin/spcomp-1.4.0-3218.exe new file mode 100644 index 0000000..0984fcc Binary files /dev/null and b/env/win32/bin/spcomp-1.4.0-3218.exe differ diff --git a/src/zr/menu.inc b/src/zr/menu.inc index fcb5102..617ef17 100644 --- a/src/zr/menu.inc +++ b/src/zr/menu.inc @@ -80,13 +80,6 @@ ZMenuMain(client) // Create menu handle. new Handle:menu_main = CreateMenu(ZMenuMainHandle); - decl String:publictrigger[4]; - decl String:silenttrigger[4]; - - // Get public/silent chat triggers. - SayHooksGetPublicChatTrigger(publictrigger, sizeof(publictrigger)); - SayHooksGetSilentChatTrigger(silenttrigger, sizeof(silenttrigger)); - SetGlobalTransTarget(client); // Initialize menu lines. @@ -100,7 +93,7 @@ ZMenuMain(client) decl String:zmarket[MENU_LINE_HUGE_LENGTH]; // Translate each line into client's language. - Format(title, sizeof(title), "%t\n ", "Menu main title", publictrigger, silenttrigger); + Format(title, sizeof(title), "%t\n ", "Menu main title", SAYHOOKS_CHAT_PUBLIC_DEFAULT, SAYHOOKS_CHAT_SILENT_DEFAULT); Format(zadmin, sizeof(zadmin), "%t", "Menu main zadmin"); Format(zclass, sizeof(zclass), "%t", "Menu main zclass"); Format(zcookies, sizeof(zcookies), "%t", "Menu main zcookies"); diff --git a/src/zr/roundstart.inc b/src/zr/roundstart.inc index 071a8a6..033df31 100644 --- a/src/zr/roundstart.inc +++ b/src/zr/roundstart.inc @@ -43,18 +43,8 @@ RoundStartOnClientSpawn(client) return; } - // Get public chat trigger prefix. - decl String:publictrigger[4]; - SayHooksGetPublicChatTrigger(publictrigger, sizeof(publictrigger)); - - // If public chat trigger is disabled, then don't print message. - if (StrEqual(publictrigger, "N/A", false)) - { - return; - } - // Print to client, how to access ZMenu. - TranslationPrintToChat(client, "General zmenu reminder", publictrigger, SAYHOOKS_KEYWORD_ZMENU); + TranslationPrintToChat(client, "General zmenu reminder", SAYHOOKS_CHAT_PUBLIC_DEFAULT, SAYHOOKS_KEYWORD_ZMENU); } /** diff --git a/src/zr/sayhooks.inc b/src/zr/sayhooks.inc index 2274f58..1020a09 100644 --- a/src/zr/sayhooks.inc +++ b/src/zr/sayhooks.inc @@ -28,8 +28,6 @@ /** * @section SM core config info. */ -#define SAYHOOKS_CORE_KVNAME "Core" -#define SAYHOOKS_CORE_KVPATH "configs/core.cfg" #define SAYHOOKS_CHAT_PUBLIC_DEFAULT "!" #define SAYHOOKS_CHAT_SILENT_DEFAULT "/" /** @@ -55,89 +53,3 @@ /** * @endsection */ - -/** - * Hack function to get the public chat trigger value. - * - * @param trigger The string to store value in. - * @param maxlen The maximum length of the string. - */ -SayHooksGetPublicChatTrigger(String:trigger[], maxlen) -{ - // Create kv handle. - new Handle:kvCore = CreateKeyValues(SAYHOOKS_CORE_KVNAME); - - // Build path to file. - decl String:filepath[PLATFORM_MAX_PATH]; - BuildPath(Path_SM, filepath, PLATFORM_MAX_PATH, SAYHOOKS_CORE_KVPATH); - - // Load kv into memory. - new bool:success = FileToKeyValues(kvCore, filepath); - - // If the file couldn't be loaded, then return the default value. - if (!success) - { - strcopy(trigger, maxlen, SAYHOOKS_CHAT_PUBLIC_DEFAULT); - - // Close the handle. - CloseHandle(kvCore); - - return; - } - - // Rewind and find value. - KvRewind(kvCore); - KvGetString(kvCore, "PublicChatTrigger", trigger, maxlen, SAYHOOKS_CHAT_PUBLIC_DEFAULT); - - // If trigger is disabled, then display as "N/A". - if (!trigger[0]) - { - strcopy(trigger, maxlen, "N/A"); - } - - // Close the handle. - CloseHandle(kvCore); -} - -/** - * Hack function to get the silent chat trigger value. - * - * @param trigger The string to store value in. - * @param maxlen The maximum length of the string. - */ -SayHooksGetSilentChatTrigger(String:trigger[], maxlen) -{ - // Create kv handle. - new Handle:kvCore = CreateKeyValues(SAYHOOKS_CORE_KVNAME); - - // Build path to file. - decl String:filepath[PLATFORM_MAX_PATH]; - BuildPath(Path_SM, filepath, PLATFORM_MAX_PATH, SAYHOOKS_CORE_KVPATH); - - // Load kv into memory. - new bool:success = FileToKeyValues(kvCore, filepath); - - // If the file couldn't be loaded, then return the default value. - if (!success) - { - strcopy(trigger, maxlen, SAYHOOKS_CHAT_SILENT_DEFAULT); - - // Close the handle. - CloseHandle(kvCore); - - return; - } - - // Rewind and find value. - KvRewind(kvCore); - KvGetString(kvCore, "SilentChatTrigger", trigger, maxlen, SAYHOOKS_CHAT_SILENT_DEFAULT); - - // If trigger is disabled, then display as "N/A". - if (!trigger[0]) - { - strcopy(trigger, maxlen, "N/A"); - } - - // Close the handle. - CloseHandle(kvCore); -} \ No newline at end of file