Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Инклуд написал: iRaiDeN.
- Перевод: Salvacore(Salvador)(ИТА ШЫДЕВР)
- Все авторские права защищены (C).
- */
- #if defined _translate_INC
- #endinput
- #endif
- #define _translate_INC
- #include <a_http>
- static
- globalString[257],
- msgColor,
- dDialogID,
- dDialogStyle,
- dTitle[128],
- dButton_1[60],
- dButton_2[60],
- tURL[256]
- ;
- forward responseDialogTL(index,response_code,data[]);
- public responseDialogTL(index,response_code,data[])
- {
- if(response_code == 200)
- {
- format(globalString,257,"%s",data);
- ShowPlayerDialog(index,dDialogID,dDialogStyle,dTitle,globalString,dButton_1,dButton_2);
- } else {
- SendClientMessage(index,-1,"Переводчик не может перевести этот текст");
- }
- }
- forward responseMsgTL(index,response_code,data[]);
- public responseMsgTL(index,response_code,data[])
- {
- if(response_code == 200)
- {
- format(globalString,257,"Сообщение: %s",data);
- SendClientMessage(index,msgColor,globalString);
- } else {
- SendClientMessage(index,-1,"Переводчик не может перевести этот текст");
- }
- }
- forward SendClientMessageTL(clientid,color,msg[],langauge[],tolangauge[]);
- public SendClientMessageTL(clientid,color,msg[],langauge[],tolangauge[])
- {
- new iMsg = strfind(msg," ");
- strdel(msg,iMsg,iMsg+1);
- strins(msg,"+",iMsg,strlen(msg));
- 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);
- HTTP(clientid,HTTP_GET,tURL,"","responseMsgTL");
- msgColor = color;
- }
- forward ShowPlayerDialogTL(clientid,dialogid,dialog_style,title[],msg[],button1[],button2[],langauge[],tolangauge[]);
- public ShowPlayerDialogTL(clientid,dialogid,dialog_style,title[],msg[],button1[],button2[],langauge[],tolangauge[])
- {
- 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);
- HTTP(clientid,HTTP_GET,tURL,"","responseDialogTL");
- dDialogID = dialogid;
- dDialogStyle = dialog_style;
- format(dTitle,128,"%s",title);
- format(dButton_1,60,"%s",button1);
- format(dButton_2,60,"%s",button2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement