Advertisement
Guest User

Untitled

a guest
May 13th, 2014
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.56 KB | None | 0 0
  1. /*
  2.                                                                             Инклуд написал: iRaiDeN.
  3.                                                                             Перевод: Salvacore(Salvador)(ИТА ШЫДЕВР)
  4.                                                                             Все авторские права защищены (C).
  5. */
  6. #if defined _translate_INC
  7. #endinput
  8. #endif
  9. #define _translate_INC
  10. #include <a_http>
  11. static
  12.     globalString[257],
  13.     msgColor,
  14.     dDialogID,
  15.     dDialogStyle,
  16.     dTitle[128],
  17.     dButton_1[60],
  18.     dButton_2[60],
  19.     tURL[256]
  20. ;
  21. forward responseDialogTL(index,response_code,data[]);
  22. public responseDialogTL(index,response_code,data[])
  23. {
  24.     if(response_code == 200)
  25.         {
  26.             format(globalString,257,"%s",data);
  27.             ShowPlayerDialog(index,dDialogID,dDialogStyle,dTitle,globalString,dButton_1,dButton_2);
  28.         } else {
  29.                 SendClientMessage(index,-1,"Переводчик не может перевести этот ​​текст");
  30.         }
  31. }
  32. forward responseMsgTL(index,response_code,data[]);
  33. public responseMsgTL(index,response_code,data[])
  34. {
  35.         if(response_code == 200)
  36.         {
  37.             format(globalString,257,"Сообщение: %s",data);
  38.             SendClientMessage(index,msgColor,globalString);
  39.         } else {
  40.                 SendClientMessage(index,-1,"Переводчик не может перевести этот текст");
  41.         }
  42. }
  43. forward SendClientMessageTL(clientid,color,msg[],langauge[],tolangauge[]);
  44. public SendClientMessageTL(clientid,color,msg[],langauge[],tolangauge[])
  45. {
  46.     new iMsg = strfind(msg," ");
  47.     strdel(msg,iMsg,iMsg+1);
  48.     strins(msg,"+",iMsg,strlen(msg));
  49.     format(tURL,255,"%s%s%s%s%s%s","http://translate.google.com/translate_t?hl=&ie=UTF-8&text=",msg,"&sl=",langauge,"&tl=",tolangauge);
  50.     HTTP(clientid,HTTP_GET,tURL,"","responseMsgTL");
  51.     msgColor = color;
  52. }
  53. forward ShowPlayerDialogTL(clientid,dialogid,dialog_style,title[],msg[],button1[],button2[],langauge[],tolangauge[]);
  54. public ShowPlayerDialogTL(clientid,dialogid,dialog_style,title[],msg[],button1[],button2[],langauge[],tolangauge[])
  55. {
  56.     format(tURL,255,"%s%s%s%s%s%s","http://translate.google.com/translate_t?hl=&ie=UTF-8&text=",msg,"&sl=",langauge,"&tl=",tolangauge);
  57.     HTTP(clientid,HTTP_GET,tURL,"","responseDialogTL");
  58.     dDialogID = dialogid;
  59.     dDialogStyle = dialog_style;
  60.     format(dTitle,128,"%s",title);
  61.     format(dButton_1,60,"%s",button1);
  62.     format(dButton_2,60,"%s",button2);
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement