I need help with HTTP_GET
#1

ok, I'm trying make a cmd which will translate his text to other language, I just testing on 2 languages and I getting error when I use the cmd

pawn Код:
if(!strcmp(cmdtext, "/nme", true, 4)) if(Logged[playerid] == 1)
    {
        new string[256];
        if(cmdtext[4] == 0)return SendClientMessage(playerid, COLOR_YELLOW, "( ! ) /nme <message>");
        Translated(playerid,cmdtext[4]);
        format(string,256,"( T ) Original message: %s",cmdtext[5]);
        SendClientMessageToAll(COLOR_WHITE,string);
        return 1;
    }
stock Translated(playerid,string[])
{
    new text[256];
    format(text,256,"http://translate.******.ru/#%s|%s|%s","ro","en",string);
    HTTP(playerid, HTTP_GET,text, "", "MyHttpResponse");
    return 1;
}
public MyHttpResponse(index, response_code, data[])
{
    new buffer[256];
    if(response_code == 200)
    {
        format(buffer,256,"( T ) %s: %s",PlayerName(index),data);
        SendClientMessageToAll(GetPlayerColor(index),buffer);
    }
    else
    {
        format(buffer, sizeof(buffer),"( T ) The text couldn't translate, error code: %d", response_code);
        SendClientMessageToAll(c_r,buffer);
    }
}
error code: 1
http://i50.tinypic.com/kd0n12.png
Reply
#2

I tried
pawn Код:
stock Translated(playerid,string[])
{
    new text[256];
    format(text,256,"translate.******.ru/#%s|%s|%s","ro","en",string);
    HTTP(playerid, HTTP_GET,text, "", "MyHttpResponse");
    return 1;
}
and I got error code:400
I checked it in internet and its mean bad request :/
Reply
#3

Like I said in another topic just today, ******'s Translate API is now a paid only service.
Reply
#4

Quote:
Originally Posted by Vince
Посмотреть сообщение
Like I said in another topic just today, ******'s Translate API is now a paid only service.
damn
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)