Sign in to follow this  
Followers 0

AudioMessage - воспроизведение текста голосом.

13 posts in this topic

Бот
Великий Гуру

С помощью этого урока Вы научитесь воспроизводить текст голосом 
В команду (например в /s) добавим это:
 

AudioMessage(playerid, 60, "Ваш текст"); // 60 - дальность

И в самый конец мода:

stock AudioMessage(playerid, rad, str[])
{
    new Float:px, Float:py, Float:pz;
    GetPlayerPos(playerid, px, py, pz);
    new world = GetPlayerVirtualWorld(playerid);
    static const    translate_str1[] = "http://translate.google.kg/translate_tts?ie=UTF-8&q=",
                    translate_str2[] = "&tl=ru&prev=input";
    new stream[(sizeof(translate_str1)-1)+128+(sizeof(translate_str2)-1)+1];
    stream = translate_str1, strcat(stream, str), strcat(stream, translate_str2);
    new i = GetMaxPlayers();
    do{
        if(IsPlayerInRangeOfPoint(--i, rad, px, py, pz) && (GetPlayerVirtualWorld(i) == world))
            PlayAudioStreamForPlayer(i, stream);
    }while(i!=0);
    return 1;
}
?

Share this post


Link to post
Share on other sites

Немного не понял, то есть гугл бот будет говорить текст который будет проигран через бота? Если это так - то очень интересная система!

Share this post


Link to post
Share on other sites
DEST
Maintainer

@Timur_Top да, баба-переводчик будет озвучивать указанный текст. 

Только работать будет, если включены звуки радио в настройках игры. 

Share this post


Link to post
Share on other sites
Дима Нисанский
Новичок

Куда кидать его?

AudioMessage(playerid, 60, "Ваш текст"); // 60 - дальность

Share this post


Link to post
Share on other sites
keyl
Великий Гуру

Довольно-таки интересная тема) Можно например заюзать при общении с NPC)

Share this post


Link to post
Share on other sites
mrsp00
Новичок

У меня почему то не работает, в чате выводиться сыллка гугл переводчика и текст который я вставил, но нечего не услышал 

Share this post


Link to post
Share on other sites
Drummer1993
Постоянный

типо вот так ? 
 

Спойлер

}
CMD:s(playerid,params[]) {
	if(PI[playerid][pMute] > 0) return ErrorMessage(playerid,"У Вас бан чата");
	if(GetPVarInt(playerid,"FloodByPlayer") > unix && PI[playerid][pExp] < 3) return ErrorMessage(playerid,"Пожалуйста подождите");
	else if(isnull(params) || strlen(params) > 100) return SendEsp(playerid, "/s [текст]");
	new string[145];
	format(string, sizeof(string), "%s[%d] кричит: %s", player_name[playerid],playerid,params);
  	AudioMessage(playerid, 60, "Ваш текст"); // 60 - дальность
	ProxDetector(35.0,playerid,string,COLOR_WHITE);
	if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && !TI[playerid][tCuffed]) ApplyAnimation(playerid,"ON_LOOKERS","shout_in",9000.999,0,0,0,0,0,1);
	SetPlayerChatBubble(playerid, params, COLOR_WHITE, 60.0, 10000);
	SetPVarInt(playerid,"FloodByPlayer", unix+7);
	return 1;

 

 

Share this post


Link to post
Share on other sites
Shakoladka
Великий Гуру

Вопрос, можно ли сделать что бы озвучивал и без включения звуков игры 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • grizly57a
      By grizly57a
      1 захожу на сервер и не мой хост хотя в сервер коннекте я указал все свое
      2 выкидывает через секунду
      3 пишет Loading filterscript 'voice.amx'...
      [15:50:18] No collision data found.

      ----------
      Loaded log file: "server_log.txt".
      ----------
      SA-MP Dedicated Server
      ----------------------
      v0.3.7-R2, (C)2005-2015 SA-MP Team
      [15:50:16] weburl = "www.sa-mp.com"  (string)
      [15:50:16] 
      [15:50:16] Server Plugins
      [15:50:16] --------------
      [15:50:16]  Loading plugin: crashdetect.so
      [15:50:16]   CrashDetect plugin 4.19.4
      [15:50:16]   Loaded.
      [15:50:16]  Loading plugin: pawncmd.so
      [15:50:17] Pawn.CMD plugin v3.2.0 by urShadow has been loaded
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: pawnraknet.so
      [15:50:17] [Pawn.RakNet] plugin v1.6.0 loading...
      [15:50:17] [Pawn.RakNet] 
          | Pawn.RakNet 1.6.0 | 2016 - 2023
          |--------------------------------
          | Author and maintainer: katursis

          | Compiled: Feb 12 2023 at 19:35:06
          |--------------------------------------------------------------
          | Repository: https://github.com/katursis/Pawn.RakNet
          |--------------------------------------------------------------
          | Wiki: https://github.com/katursis/Pawn.RakNet/wiki
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: sscanf.so
      [15:50:17] 
      [15:50:17]  ===============================
      [15:50:17]       sscanf plugin loaded.     
      [15:50:17]          Version:  2.8.3        
      [15:50:17]   (c) 2018 Alex "Y_Less" Cole  
      [15:50:17]  ===============================
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: streamer.so
      [15:50:17] 
      *** Streamer Plugin v2.9.6 by Incognito loaded ***
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: mysql_static.so
      [15:50:17]  >> plugin.mysql: R39-6 successfully loaded.
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: TOTP.so
      [15:50:17] TOTP plugin v1.0.1 by Games loaded.
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: profiler.so
      [15:50:17]   Profiler plugin 2.15.1
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: timerfix.so
      [15:50:17]   >> TimerFix v1.5 successfully loaded.
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: UTuning.so
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: housecar.so
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: TOTP.so
      [15:50:17] TOTP plugin v1.0.1 by Games loaded.
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: FCNPC.so
      [15:50:17] 
      [15:50:17] -------------------------------------------------
      [15:50:17]      FCNPC - Fully Controllable NPC v2.0.11
      [15:50:17]             GNU/Linux SA-MP 0.3.7 R2
      [15:50:17]            Aug 23 2024 at 16:35:48
      [15:50:17] 
      [15:50:17]   Author:       OrMisicL (2013 - 2015)
      [15:50:17]   Continued by: ziggi    (2016 - present)
      [15:50:17] 
      [15:50:17]   See full credits in the README.md file
      [15:50:17] -------------------------------------------------
      [15:50:17] 
      [15:50:17] Loading...
      [15:50:17] 
      [15:50:17] -------------------------------------------------
      [15:50:17]    ColAndreasv1.4.0
      [15:50:17] 
      [15:50:17]    Created By:
      [15:50:17]      [uL]Chris42O
      [15:50:17]      [uL]Slice
      [15:50:17]      [uL]Pottus
      [15:50:17] -------------------------------------------------
      [15:50:17] 
      [15:50:17] Loading...
      [15:50:17] ColAndreas v1.4.0 Loaded.
      [15:50:17]   Loaded.
      [15:50:17]  Loaded 13 plugins.
      [15:50:17] 
      [15:50:17] Filterscripts
      [15:50:17] ---------------
      [15:50:17]   Loading filterscript 'voice.amx'...
      [15:50:18] No collision data found.
      [15:50:18] 
      --------------------------------------
      [15:50:18]    VOICE COPY RADMIR BY Маттео dev.    
      [15:50:18] --------------------------------------
      [15:50:18]   Loaded 1 filterscripts.
      [15:50:20] ------------------------------------------
      [15:50:20]                  MELONITY AC                 
      [15:50:20] ------------------------------------------
      [15:50:20] weburl = "www.sa-mp.com"  (string)
      [15:50:20] [Vehicle]: Все транспортные средства созданы
      [15:50:20] [TP]: Все входы/выходы созданы
      [15:50:20] [ATM]: Все банкоматы созданы
      [15:50:20] Подключение к базе данных не удалось [Неизвестная ошибка. Код ошибки: -1]
      [15:50:20] -----------------------------------------
      [15:50:20]                                          
      [15:50:20]        CanVas Dev
      [15:50:20]                                          
      [15:50:20] -----------------------------------------
      [15:50:20] Number of vehicle models: 38
      [16:00:35] [connection] 93.159.241.195:1523 requests connection cookie.
      [16:00:36] [connection] incoming connection: 93.159.241.195:1523 id: 0
      [16:00:36] [join] Whoole_Daadadw has joined the server (0:93.159.241.195)
      [16:00:36] [part] Whoole_Daadadw has left the server (0:2)
    • grizly57a
      By grizly57a
      вот логи 
       
       
      ---------- Loaded log file: "server_log.txt". ---------- SA-MP Dedicated Server ---------------------- v0.3.7-R2, (C)2005-2015 SA-MP Team [16:41:25] [16:41:25] Server Plugins [16:41:25] -------------- [16:41:25] Loading plugin: crashdetect.so [16:41:25] CrashDetect plugin 4.19.4 [16:41:25] Loaded. [16:41:25] Loading plugin: pawncmd.so [16:41:25] Pawn.CMD plugin v3.2.0 by urShadow has been loaded [16:41:25] Loaded. [16:41:25] Loading plugin: pawnraknet.so [16:41:25] [Pawn.RakNet] plugin v1.6.0 loading... [16:41:25] [Pawn.RakNet] | Pawn.RakNet 1.6.0 | 2016 - 2023 |-------------------------------- | Author and maintainer: katursis | Compiled: Feb 12 2023 at 19:35:06 |-------------------------------------------------------------- | Repository: https://github.com/katursis/Pawn.RakNet |-------------------------------------------------------------- | Wiki: https://github.com/katursis/Pawn.RakNet/wiki [16:41:25] Loaded. [16:41:25] Loading plugin: sscanf.so [16:41:25] [16:41:25] =============================== [16:41:25] sscanf plugin loaded. [16:41:25] Version: 2.8.3 [16:41:25] (c) 2018 Alex "Y_Less" Cole [16:41:25] =============================== [16:41:25] Loaded. [16:41:25] Loading plugin: streamer.so [16:41:25] *** Streamer Plugin v2.9.4 by Incognito loaded *** [16:41:25] Loaded. [16:41:25] Loading plugin: mysql_static.so [16:41:25] >> plugin.mysql: R39-6 successfully loaded. [16:41:25] Loaded. [16:41:25] Loading plugin: TOTP.so [16:41:25] TOTP plugin v1.0.1 by Games loaded. [16:41:25] Loaded. [16:41:25] Loading plugin: profiler.so [16:41:25] Profiler plugin 2.15.1 [16:41:25] Loaded. [16:41:25] Loading plugin: timerfix.so [16:41:25] >> TimerFix v1.5 successfully loaded. [16:41:25] Loaded. [16:41:25] Loading plugin: UTuning.so [16:41:25] Loaded. [16:41:25] Loading plugin: housecar.so [16:41:25] Loaded. [16:41:25] Loading plugin: TOTP.so [16:41:25] TOTP plugin v1.0.1 by Games loaded. [16:41:25] Loaded. [16:41:25] Loading plugin: FCNPC.so [16:41:25] [16:41:25] ------------------------------------------------- [16:41:25] FCNPC - Fully Controllable NPC v2.0.9 [16:41:25] GNU/Linux SA-MP 0.3.7 R2 [16:41:25] Apr 17 2024 at 09:11:36 [16:41:25] [16:41:25] Author: OrMisicL (2013 - 2015) [16:41:25] Continued by: ziggi (2016 - present) [16:41:25] [16:41:25] See full credits in the README.md file [16:41:25] ------------------------------------------------- [16:41:25] [16:41:25] Loading... [16:41:25] [16:41:25] ------------------------------------------------- [16:41:25] ColAndreasv1.4.0 [16:41:25] [16:41:25] Created By: [16:41:25] [uL]Chris42O [16:41:25] [uL]Slice [16:41:25] [uL]Pottus [16:41:25] ------------------------------------------------- [16:41:25] [16:41:25] Loading... [16:41:25] ColAndreas v1.4.0 Loaded. [16:41:25] Loaded. [16:41:25] Loaded 13 plugins. [16:41:25] [16:41:25] Filterscripts [16:41:25] --------------- [16:41:25] Loading filterscript 'voice.amx'... [16:41:25] No collision data found. [16:41:25] [FCNPC] Warning: Unable to create NPCs. The maxnpc limit in server.cfg is 0. [16:41:25] -------------------------------------- [16:41:25] VOICE COPY RADMIR BY ������ dev. [16:41:25] -------------------------------------- [16:41:25] Loaded 1 filterscripts. [16:41:25] *** Streamer Plugin: Include file version (0x295) does not match plugin version (0x294) (script might need to be recompiled with the correct include file). [16:41:25] ------------------------------------------ [16:41:25] SSSS [16:41:25] ------------------------------------------ [16:41:25] mapname = "San Andreas" (string) [16:41:25] [Vehicle]: ��� ������������ �������� ������� [16:41:25] [TP]: ��� �����/������ ������� [16:41:25] [ATM]: ��� ��������� ������� [16:41:25] ����������� � ���� ������ �� ������� [������� � ����� ������ ����������] [16:41:25] ----------------------------------------- [16:41:25] [16:41:25] [16:41:25] [16:41:25] ----------------------------------------- [16:41:25] Number of vehicle models: 55 [16:42:00] [connection] 93.159.241.195:2395 requests connection cookie. [16:42:01] [connection] incoming connection: 93.159.241.195:2395 id: 0 [16:42:02] [join] Dkak_wlaas has joined the server (0:93.159.241.195) [16:42:02] [part] Dkak_wlaas has left the server (0:2)