• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Filterscript] Auto Translate chat
#1
THE FILTERSCRIPT IS INCREDIBLY MESSY - BUT IT WAS MADE FOR TESTING PURPOSES TO EVEN SEE IF IT WOULD EVEN WORK



This basically contains a php file which gets the translation data from?mymemory.translated.net. It also replaces all the weird foreign characters with normal ones.



The example I've shared translates ES to EN and EN to ES. However, with the api you have no limitations of which languages you want to translate.





[Video: https://www.youtube.com/watch?v=Auf4zXZcqfc]











test.php



https://pastebin.com/raw/YsAQkH3q





example.pwn



https://pastebin.com/raw/Q4tZ1Zrg



like I said... VERY MESSY and stupid.





how to basically use the api:



PHP Code:
#include <a_samp> #include <a_http> new lang1 = "en"; new lang2 = "it"; public OnPlayerText(playerid, text[]) { new languageHttpString[512]; format(languageHttpString, sizeof languageHttpString, "localhost/test.php?text=%s&lang1=%s&lang2=%s", text, lang1, lang2); strreplace(languageHttpString, " ", ""); HTTP(playerid, HTTP_GET, languageHttpString, "", "HttpConvert"); } forward HttpConvert(playerid, response_code, data[]); public HttpConvert(playerid, response_code, data[]) { printf("%s", data[0]); //printf("response code %d", response_code); return 1; }



strreplace by slice?https://pastebin.com/raw/x6Gea0Nq
  Reply


Messages In This Thread
Auto Translate chat - by billz - 2020-06-04, 01:25 PM
RE: Auto Translate chat - by xbruno1000x - 2020-07-05, 03:34 AM
RE: Auto Translate chat - by Chaprnks - 2023-07-10, 10:53 PM