Advertisement
DraKiNs

[Include] Texto para Falar (SAMP 0.3d)

Sep 12th, 2011
982
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.76 KB | None | 0 0
  1. /*=================================================================
  2.              _ ____        _____          __  __
  3.             (_)  _ \ ___  |_   _|__  __ _|  \/  |
  4.             | | |_) / __|   | |/ _ \/ _` | |\/| |
  5.             | |  __/\__ \   | |  __/ (_| | |  | |
  6.             |_|_|   |___/   |_|\___|\__,_|_|  |_|
  7.  
  8.                 Created by Bruno da Silva
  9.                 www.ips-team.blogspot.com
  10.  
  11.                  Working only in SA:MP 0.3D
  12.  
  13. =================================================================*/
  14.  
  15.  
  16. new
  17.     languageCodes[][][] =
  18. {
  19.     {"AFRIKAANS", "af"},
  20.     {"ALBANIAN", "sq"},
  21.     {"AMHARIC", "am"},
  22.     {"ARABIC", "ar"},
  23.     {"ARMENIAN", "hy"},
  24.     {"AZERBAIJANI", "az"},
  25.     {"BASQUE", "eu"},
  26.     {"BELARUSIAN", "be"},
  27.     {"BENGALI", "bn"},
  28.     {"BIHARI", "bh"},
  29.     {"BRETON", "br"},
  30.     {"BULGARIAN", "bg"},
  31.     {"BURMESE", "my"},
  32.     {"CATALAN", "ca"},
  33.     {"CHEROKEE", "chr"},
  34.     {"CHINESE", "zh"},
  35.     {"CHINESE_SIMPLIFIED", "zh-CN"},
  36.     {"CHINESE_TRADITIONAL", "zh-TW"},
  37.     {"CORSICAN", "co"},
  38.     {"CROATIAN", "hr"},
  39.     {"CZECH", "cs"},
  40.     {"DANISH", "da"},
  41.     {"DHIVEHI", "dv"},
  42.     {"DUTCH", "nl"},
  43.     {"ENGLISH", "en"},
  44.     {"ESPERANTO", "eo"},
  45.     {"ESTONIAN", "et"},
  46.     {"FAROESE", "fo"},
  47.     {"FILIPINO", "tl"},
  48.     {"FINNISH", "fi"},
  49.     {"FRENCH", "fr"},
  50.     {"FRISIAN", "fy"},
  51.     {"GALICIAN", "gl"},
  52.     {"GEORGIAN", "ka"},
  53.     {"GERMAN", "de"},
  54.     {"GREEK", "el"},
  55.     {"GUJARATI", "gu"},
  56.     {"HAITIAN_CREOLE", "ht"},
  57.     {"HEBREW", "iw"},
  58.     {"HINDI", "hi"},
  59.     {"HUNGARIAN", "hu"},
  60.     {"ICELANDIC", "is"},
  61.     {"INDONESIAN", "id"},
  62.     {"INUKTITUT", "iu"},
  63.     {"IRISH", "ga"},
  64.     {"ITALIAN", "it"},
  65.     {"JAPANESE", "ja"},
  66.     {"JAVANESE", "jw"},
  67.     {"KANNADA", "kn"},
  68.     {"KAZAKH", "kk"},
  69.     {"KHMER", "km"},
  70.     {"KOREAN", "ko"},
  71.     {"KURDISH", "ku"},
  72.     {"KYRGYZ", "ky"},
  73.     {"LAO", "lo"},
  74.     {"LATIN", "la"},
  75.     {"LATVIAN", "lv"},
  76.     {"LITHUANIAN", "lt"},
  77.     {"LUXEMBOURGISH", "lb"},
  78.     {"MACEDONIAN", "mk"},
  79.     {"MALAY", "ms"},
  80.     {"MALAYALAM", "ml"},
  81.     {"MALTESE", "mt"},
  82.     {"MAORI", "mi"},
  83.     {"MARATHI", "mr"},
  84.     {"MONGOLIAN", "mn"},
  85.     {"NEPALI", "ne"},
  86.     {"NORWEGIAN", "no"},
  87.     {"OCCITAN", "oc"},
  88.     {"ORIYA", "or"},
  89.     {"PASHTO", "ps"},
  90.     {"PERSIAN", "fa"},
  91.     {"POLISH", "pl"},
  92.     {"PORTUGUESE", "pt"},
  93.     {"PORTUGUESE_PORTUGAL", "pt-PT"},
  94.     {"PUNJABI", "pa"},
  95.     {"QUECHUA", "qu"},
  96.     {"ROMANIAN", "ro"},
  97.     {"RUSSIAN", "ru"},
  98.     {"SANSKRIT", "sa"},
  99.     {"SCOTS_GAELIC", "gd"},
  100.     {"SERBIAN", "sr"},
  101.     {"SINDHI", "sd"},
  102.     {"SINHALESE", "si"},
  103.     {"SLOVAK", "sk"},
  104.     {"SLOVENIAN", "sl"},
  105.     {"SPANISH", "es"},
  106.     {"SUNDANESE", "su"},
  107.     {"SWAHILI", "sw"},
  108.     {"SWEDISH", "sv"},
  109.     {"SYRIAC", "syr"},
  110.     {"TAJIK", "tg"},
  111.     {"TAMIL", "ta"},
  112.     {"TATAR", "tt"},
  113.     {"TELUGU", "te"},
  114.     {"THAI", "th"},
  115.     {"TIBETAN", "bo"},
  116.     {"TONGA", "to"},
  117.     {"TURKISH", "tr"},
  118.     {"UKRAINIAN", "uk"},
  119.     {"URDU", "ur"},
  120.     {"UZBEK", "uz"},
  121.     {"UIGHUR", "ug"},
  122.     {"VIETNAMESE", "vi"},
  123.     {"WELSH", "cy"},
  124.     {"YIDDISH", "yi"},
  125.     {"YORUBA", "yo"},
  126.     {"UNKNOWN", " "}
  127. };
  128.  
  129. getLanguage(language[])
  130. {
  131.     for(new i = 0; i != sizeof(languageCodes); i++) {
  132.         if(!strcmp(language, languageCodes[i][0], true)) {
  133.             return i;
  134.         }
  135.     }
  136.     return sizeof(languageCodes)-1;
  137. }
  138.  
  139.  
  140. SendClientAudioMessage(playerid, language[], texto[])
  141. {
  142.     #if !defined MAX_SPEECH
  143.     #define MAX_SPEECH 256
  144.     #endif
  145.  
  146.     static
  147.         string[MAX_SPEECH]
  148.     ;
  149.  
  150.     format(string, MAX_SPEECH, "http://translate.google.com/translate_tts?tl=%s&q=%s", language, texto);
  151.  
  152.     return PlayAudioStreamForPlayer(playerid, string);
  153. }
  154.  
  155.  
  156. //
  157. //   Thanks Robson to Post (Strong)
  158. //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement