Question

ОБКУРЕННЫЙ-КОТЭ
Новичок
if(dialogid == DIALOG_BOOMBOX)
    {
        if(!response)
        {
            switch(listitem)
                        {
                        if(strlen(inputtext))
                        {
                case 0:
                {
                        foreach(Player, i)
                        {
                        if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
                                        PlayStream(i,"http://ep256.hostingradio.ru:8052/europaplus256.mp3",
GetPVarFloat(playerid, "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
                                        SetPVarString(playerid, "BBStation", "http://ep256.hostingradio.ru:8052/europaplus256.mp3");
                                }
                        }
                        case 1:
                        {
                        foreach(Player, i)
                                {
                                        if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
                                        PlayStream(i,"http://icecast.radiodfm.cdnvideo.ru/dfm.mp3",GetPVarFloat(playerid,
 "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
                                SetPVarString(playerid, "BBStation", "http://icecast.radiodfm.cdnvideo.ru/dfm.mp3");
                                }
                        }
                        case 2:
                {
                        foreach(Player, i)
                        {
                                        if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
                        PlayStream(i,"http://ic3.101.ru:8000/v1_1?setst=-1",GetPVarFloat(playerid,
 "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
                        SetPVarString(playerid, "BBStation", "http://ic3.101.ru:8000/v1_1?setst=-1");
                                }
                        }
                        case 3:
                {
                        foreach(Player, i)
                        {
                                if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
                        PlayStream(i,"http://air2.radiorecord.ru:805/rr_320",GetPVarFloat(playerid,
 "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
                        SetPVarString(playerid, "BBStation", "http://air2.radiorecord.ru:805/rr_320");
                                }
                        }
                        case 4:
                {
                        foreach(Player, i)
                {
                                if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
                                        PlayStream(i,"http://chanson.hostingradio.ru:8041/chanson256.mp3",GetPVarFloat(playerid,
 "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
                                        SetPVarString(playerid, "BBStation", "http://chanson.hostingradio.ru:8041/chanson256.mp3");
                                }
                        }
                        case 5:
                {
                        foreach(Player, i)
                        {
                                        if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
                                        PlayStream(i,"http://stream.variant.fm:8000/LOVE-192",GetPVarFloat(playerid,
 "BBX"), GetPVarFloat(playerid, "BBY"), GetPVarFloat(playerid, "BBZ"), 30.0, 1);
                                        SetPVarString(playerid, "BBStation", "http://stream.variant.fm:8000/LOVE-192");
                }
                        }
                        case 6: ShowPlayerDialog(playerid,DIALOG_BOOMBOX2,DIALOG_STYLE_INPUT, !"Введите URL-адрес на свою музыку", !"{ffffff}Пожалуйста, вставьте ссылку на музыку для воспроизведения музыки\n Загрузить свою песню для получения ссылки можно сюда {00FF00}https://zaix.ru", !"Play", !"Отмена");
                        {
                if(GetPVarInt(playerid, "BBArea"))
                            {
                                new string[128], pName[MAX_PLAYER_NAME];
                                GetPlayerName(playerid, pName, sizeof(pName));
                                        format(string, sizeof(string), "%s отключил магнитофон", GetName2(playerid));
                                        Do(playerid, string);
                                foreach(Player, i)
                                if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
                            StopStream(i);
                                DeletePVar(playerid, "BBStation");
                                }
                                SendClientMessage(playerid, COLOR_SYSTEM, !"Ты выключил свой магнитофон");
                        }
        }
        return 1;
        }

Ошибки 

(37835) : error 002: only a single statement (or expression) can follow each "case"
(37835) -- (37836) : error 028: invalid subscript (not an array or too many subscripts): "strlen"
(37835) -- (37837) : error 001: expected token: "}", but found "case"
(37835) -- (37837) : fatal error 107: too many error messages on one line

строка

{
                case 0:

 

Share this post


Link to post

4 answers to this question

  • 0
DEST
Maintainer

@ОБКУРЕННЫЙ-КОТЭ после switch должны идти только case, никаких strlen туда впихивать нельзя. 

47 минут назад, ОБКУРЕННЫЙ-КОТЭ сказал:

if(strlen(inputtext)) {

вот это переместите в начало кода, перед switch(listitem). 

Share this post


Link to post
  • 0
ОБКУРЕННЫЙ-КОТЭ
Новичок
32 минуты назад, DEST сказал:

@ОБКУРЕННЫЙ-КОТЭ после switch должны идти только case, никаких strlen туда впихивать нельзя. 

вот это переместите в начало кода, перед switch(listitem). 

теперь ругается на 

error 002: only a single statement (or expression) can follow each "case"

На строку

На скобку

case 6: ShowPlayerDialog(playerid,DIALOG_BOOMBOX2,DIALOG_STYLE_INPUT, !"Введите URL-адрес на свою музыку", !"{ffffff}Пожалуйста, вставьте ссылку на музыку для воспроизведения музыки\n Загрузить свою песню для получения ссылки можно сюда {00FF00}https://zaix.ru", !"Play", !"Отмена");
					{

 

Share this post


Link to post
  • 0
HAZZY
Свой человек

case 7:
{
if(GetPVarInt(playerid, "BBArea"))
                            {
                                new string[128], pName[MAX_PLAYER_NAME];
                                GetPlayerName(playerid, pName, sizeof(pName));
                                        format(string, sizeof(string), "%s отключил магнитофон", GetName2(playerid));
                                        Do(playerid, string);
                                foreach(Player, i)
                                if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "BBArea")))
                            StopStream(i);
                                DeletePVar(playerid, "BBStation");
                                }
                                SendClientMessage(playerid, COLOR_SYSTEM, !"Ты выключил свой магнитофон");
                        }
}

 

Share this post


Link to post
Guest
This topic is now closed to further replies.
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)