Форум

  • Страница 1 из 1
  • 1
Модератор форума: AlexPPPP  
Форум | www.SAMP-TEAM.com » Wiki SA-MP » Команды » [C.M.D] /megaphone (Голос)
[C.M.D] /megaphone
Данная команда позволяет воспроизводить текст.

Code
else if(strcmp(cmd, "/megaphone", true) == 0 || strcmp(cmd, "/mg", true) == 0)    
       {    
           GetPlayerName(playerid, sendername, sizeof(sendername));    
               new length = strlen(cmdtext);    
               while ((idx < length) && (cmdtext[idx] <= ' '))    
               {    
                   idx++;    
               }    
                 new offset = idx;    
                 new result[64];    
               while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))    
               {    
                   result[idx - offset] = cmdtext[idx];    
                   idx++;    
               }    
               result[idx - offset] = EOS;    
                   if(!strlen(result)) return    SendClientMessage(playerid, -1, "» Введите: /megaphone(/mg) [текст]. ");    
               format(string, sizeof(string), "- %s сказал(а) в мегафон: %s ", sendername, result);    
                 ProxDetector(20.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);    
               AudioMess(playerid,20,result);    
               return 1;    
                   }  


Code
stock AudioMess(id,rad,str[]) {    
       new Float:px,Float:py,Float:pz;    
       GetPlayerPos(id,px,py,pz);    
        new stream[256];    
       format(stream,sizeof(stream),"http://translate.google.kg/translate_tts?ie=UTF-8&q=%s&tl=ru&prev=input",str);    
       for(new i=0; i != MAX_PLAYERS; i++) {    
           if(IsPlayerInRangeOfPoint(i,rad,px,py,pz) && GetPlayerVirtualWorld(id) == GetPlayerVirtualWorld(i)) {    
               PlayAudioStreamForPlayer(i,stream);    
           }    
       }    
       return 1;    
     }  


Автор: Agada
15.07.2012 в 19:16
Форум | www.SAMP-TEAM.com » Wiki SA-MP » Команды » [C.M.D] /megaphone (Голос)
  • Страница 1 из 1
  • 1
Поиск: