15.06.2012, 21:55
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
error code: 1
http://i50.tinypic.com/kd0n12.png
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);
}
}
http://i50.tinypic.com/kd0n12.png