Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Releases Filterscripts [Filterscript] Auto Translate chat

 
  • 0 Vote(s) - 0 Average
Filterscript Auto Translate chat
billz
Offline

Burgershot Member
Posts: 4
Threads: 2
Joined: Sep 2019
Reputation: 0
Location: UK
#1
2020-06-04, 01:25 PM
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
xbruno1000x
Offline

Burgershot Member
Posts: 32
Threads: 2
Joined: Mar 2020
Reputation: 1
Location: Brasil
#2
2020-07-05, 03:34 AM
The video is off
portalsamp.com
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode