From 8a4bf716002a017de77fe7df301ef8e4aaf00a2e Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 9 Apr 2021 11:00:49 -0300 Subject: Initial commit --- npc/functions/asklanguage.txt | 56 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 npc/functions/asklanguage.txt (limited to 'npc/functions/asklanguage.txt') diff --git a/npc/functions/asklanguage.txt b/npc/functions/asklanguage.txt new file mode 100644 index 00000000..f0cbe0f8 --- /dev/null +++ b/npc/functions/asklanguage.txt @@ -0,0 +1,56 @@ +// Evol functions. +// Author: +// Reid +// Description: +// Function setting the player language + +function script asklanguage { + + .@nb_language = 11; + + switch (getarg(0, 0)) + { + case LANG_ON_SEA: + setarray .@messages$[0], "I hear you... (English)", // English + "Je vous entends... (Français)", // French + "Te oigo... (Español)", // Spanish + "Ich höre euch... (Deutsch)"; // German + break; + case LANG_IN_SHIP: + setarray .@messages$[0], "I speak English.", // English + "Je parle français.", // French + "Hablo Español.", // Spanish + "Ich spreche Deutsch."; // German + break; + default: + return; + } + + setarray .@flags$[0], "flags/en", + "flags/fr", + "flags/es", + "flags/de"; + + .@menustr$ = ""; + .@separator$ = ":"; + + for (.@i = 0; .@i <= .@nb_language; .@i++) + { + if (.@i == .@nb_language) + { + .@separator$ = ""; + } + .@menustr$ = .@menustr$ + .@flags$[.@i] + "|" + .@messages$[.@i] + .@separator$; + } + + select(.@menustr$); + + .@lang = @menu - 1; + + if (.@lang >= 0 || .@lang <= .@nb_language) + { + Lang = .@lang; + } + + return; +} -- cgit v1.2.3-70-g09d2