• 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(playeridtext[])

{







new 
languageHttpString[512];

format(languageHttpStringsizeof languageHttpString"localhost/test.php?text=%s&lang1=%s&lang2=%s"textlang1lang2);

strreplace(languageHttpString" """);

HTTP(playeridHTTP_GETlanguageHttpString"""HttpConvert");

}





forward HttpConvert(playeridresponse_codedata[]);

public 
HttpConvert(playeridresponse_codedata[])

{



printf("%s"data[0]);

//printf("response code %d", response_code);



return 1;





strreplace by slice?https://pastebin.com/raw/x6Gea0Nq
  Reply
#2
The video is off
  Reply
#3
It's an excellent idea & has great potential. My first thought is alot of the online translators have hard limits, so it'd break functionally after the limit it reached. That'd make it ideal only for lower player base communities. Many years ago, I do remember seeing something similar to this on the now defunct SA-MP forums, although it was using some type of strange ICQ translator. Glad to see this concept has a revival, hopefully there'll be a polished & fully functional solution in the future.
[Image: c9CyzPf.png]
  Reply


Forum Jump: