Second Dialog isn't showing up.
#1

Alright, I've been working really hard on my new radio system, as I've decided to create it as Dialogs, so I created two dialogs (I will show code later) as the first dialog shows, but the second does not show up at all.

Here are the codes.

At the first, I've added this:

pawn Код:
// Radio Station
#define RADIOSTATIONMENU 9312
#define MUSICSTATIONS 9313
And then, I've added this command (I'm using ZCMD):

pawn Код:
CMD:playradio(playerid, params[])
{
   if(!IsPlayerInAnyVehicle(playerid))
   {
      SendClientMessageEx(playerid, COLOR_GRAD2, " In-case you want to turn the radio on, you have to be in a vehicle!");
      return 1;
   }
   if(IsPlayerInAnyVehicle(playerid))
   {
      ShowPlayerDialog(playerid, 9312, DIALOG_STYLE_LIST, "Radio Station", "Radio Channels\nTurn the music off", "Select", "Cancel");
    }
    return 1;
}
And, I've added these too (The dialogs):

pawn Код:
if(dialogid == 9313)
    {
      if(response)
      {
       if(listitem == 0)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.230:8002/listen.pls");
       SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 1)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8004/listen.pls");
       SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 2)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8002/listen.pls");
       SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 3)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8006/listen.pls");
       SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 4)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8042/listen.pls");
       SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 5)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.225:8022/listen.pls");
       SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 6)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8040/listen.pls");
       SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
       return 1;
       if(listitem == 7)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=357703");
       SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 8)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1026951");
       SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
       return 1;
       if(listitem == 9)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
       SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 10)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1543115");
       SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 11)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
       SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 12)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283516");
       SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 13)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=737152");
       SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 14)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=259629");
       SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 15)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1193516");
       SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 16)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1878");
       SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
       }
       return 1;

            }
        }
    }
   
    if(dialogid == 9312)
    {
      if(response)
      {
       if(listitem == 0)
       {
       ShowPlayerDialog(playerid, 9313, DIALOG_STYLE_LIST, "Choose the channel you would like to listen!", "977 The Hitz Channel\n977 The 80s Channel\n181.FM - POWER 181\n1POWER\n108.FM - THE HITLIST\nChroniX Metal\nHOT 108 JAMZ\nSpart FM Tupac Channel\nAlex Jones FM\nFrench Kiss FM\nBlackBeat FM\nDEFJAY\nPower Hitz\nSky FM\nOld School 99\nTrance Channel\nIbiza Sonica", "Select", "Cancel");
       }
       if(listitem == 1)
       {
       StopAudioStreamForPlayer(playerid);
       }
       return 1;
            }
        }
    }
I guess there's no errors in them, but when I go ingame, I type the command which is /playradio, the first dialog shows up(9312) as I click on 'Radio Channels' so the the other dialog would show up (9313) as nothing happens when I click on it, I need help ASAP please.
Reply
#2

Found many problems in {}.. many were unclosed

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 9313)
    {
      if(response)
      {
       if(listitem == 0)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.230:8002/listen.pls");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 1)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8004/listen.pls");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 2)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8002/listen.pls");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 3)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8006/listen.pls");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 4)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8042/listen.pls");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 5)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.225:8022/listen.pls");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 6)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8040/listen.pls");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 7)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=357703");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 8)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1026951");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 9)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 10)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1543115");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 11)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 12)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283516");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 13)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=737152");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 14)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=259629");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 15)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1193516");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 16)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1878");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       }
       return 1;

       }
    }
    if(dialogid == 9312)
    {
      if(response)
      {
       if(listitem == 0)
       {
       ShowPlayerDialog(playerid, 9313, DIALOG_STYLE_LIST, "Choose the channel you would like to listen!", "977 The Hitz Channel\n977 The 80s Channel\n181.FM - POWER 181\n1POWER\n108.FM - THE HITLIST\nChroniX Metal\nHOT 108 JAMZ\nSpart FM Tupac Channel\nAlex Jones FM\nFrench Kiss FM\nBlackBeat FM\nDEFJAY\nPower Hitz\nSky FM\nOld School 99\nTrance Channel\nIbiza Sonica", "Select", "Cancel");
       }
       if(listitem == 1)
       {
       StopAudioStreamForPlayer(playerid);
       }
       return 1;
            }
        }
    return 1;
}
Reply
#3

Quote:
Originally Posted by [MM]RoXoR[FS]
Посмотреть сообщение
Found many problems in {}.. many were unclosed

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 9313)
    {
      if(response)
      {
       if(listitem == 0)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.230:8002/listen.pls");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 1)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8004/listen.pls");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 2)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8002/listen.pls");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 3)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8006/listen.pls");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 4)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8042/listen.pls");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 5)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.225:8022/listen.pls");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 6)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8040/listen.pls");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 7)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=357703");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 8)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1026951");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 9)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 10)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1543115");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 11)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 12)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283516");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 13)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=737152");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 14)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=259629");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 15)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1193516");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 16)
       {
       new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1878");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       }
       return 1;

       }
    }
    if(dialogid == 9312)
    {
      if(response)
      {
       if(listitem == 0)
       {
       ShowPlayerDialog(playerid, 9313, DIALOG_STYLE_LIST, "Choose the channel you would like to listen!", "977 The Hitz Channel\n977 The 80s Channel\n181.FM - POWER 181\n1POWER\n108.FM - THE HITLIST\nChroniX Metal\nHOT 108 JAMZ\nSpart FM Tupac Channel\nAlex Jones FM\nFrench Kiss FM\nBlackBeat FM\nDEFJAY\nPower Hitz\nSky FM\nOld School 99\nTrance Channel\nIbiza Sonica", "Select", "Cancel");
       }
       if(listitem == 1)
       {
       StopAudioStreamForPlayer(playerid);
       }
       return 1;
            }
        }
    return 1;
}
My pawno crashes when I add your codes.
Reply
#4

In all your listitem , there is no use of Distance.
Remove it(or comment if for later use).
Also add this at top of your script.
pawn Код:
#pragma tabsize 0
Here is your code compiling. Enter /radio to listem music.
pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#pragma tabsize 0
#define COLOR_WHITE 0xFFFFFF
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

public OnPlayerConnect(playerid)
{
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/radio", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid, 9312, DIALOG_STYLE_LIST, "Radio Station", "Radio Channels\nTurn the music off", "Select", "Cancel");
        return 1;
    }
    return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 1;
}

public OnRconCommand(cmd[])
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
    return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 9313)
    {
      if(response)
      {
       if(listitem == 0)
       {
       new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.230:8002/listen.pls");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 1)
       {
       new Float:X, Float:Y, Float:Z;// Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8004/listen.pls");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 2)
       {
       new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8002/listen.pls");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 3)
       {
       new Float:X, Float:Y, Float:Z;// Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8006/listen.pls");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 4)
       {
       new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8042/listen.pls");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 5)
       {
       new Float:X, Float:Y, Float:Z;//Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.225:8022/listen.pls");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 6)
       {
       new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8040/listen.pls");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 7)
       {
       new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=357703");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 8)
       {
       new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1026951");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 9)
       {
       new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 10)
       {
       new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1543115");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 11)
       {
       new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 12)
       {
       new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283516");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 13)
       {
       new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=737152");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 14)
       {
       new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=259629");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 15)
       {
       new Float:X, Float:Y, Float:Z;//, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1193516");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       return 1;
       }
       if(listitem == 16)
       {
       new Float:X, Float:Y, Float:Z;//, Float:Distance = 10.0;
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1878");
       SendClientMessage(playerid, COLOR_WHITE, "Music started!");
       }
       return 1;

       }
    }
    if(dialogid == 9312)
    {
      if(response)
      {
       if(listitem == 0)
       {
       ShowPlayerDialog(playerid, 9313, DIALOG_STYLE_LIST, "Choose the channel you would like to listen!", "977 The Hitz Channel\n977 The 80s Channel\n181.FM - POWER 181\n1POWER\n108.FM - THE HITLIST\nChroniX Metal\nHOT 108 JAMZ\nSpart FM Tupac Channel\nAlex Jones FM\nFrench Kiss FM\nBlackBeat FM\nDEFJAY\nPower Hitz\nSky FM\nOld School 99\nTrance Channel\nIbiza Sonica", "Select", "Cancel");
       }
       if(listitem == 1)
       {
       StopAudioStreamForPlayer(playerid);
       }
       return 1;
            }
        }
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}
Reply
#5

Also, your indentation is killing me. Something like this is much better.

pawn Код:
if(dialogid == 9313)
{
    if(response)
    {
        if(listitem == 0)
        {
            new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
            GetPlayerPos(playerid, X, Y, Z);
            PlayAudioStreamForPlayer(playerid, "http://205.188.215.230:8002/listen.pls");
            SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
            return 1;
        }
        if(listitem == 1)
        {
            new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
            GetPlayerPos(playerid, X, Y, Z);
            PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8004/listen.pls");
            SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
            return 1;
        }
        if(listitem == 2)
        {
            new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
            GetPlayerPos(playerid, X, Y, Z);
            PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8002/listen.pls");
            SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
            return 1;
        }
        if(listitem == 3)
        {
            new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
            GetPlayerPos(playerid, X, Y, Z);
            PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8006/listen.pls");
            SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
            return 1;
        }
        if(listitem == 4)
        {
            new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
            GetPlayerPos(playerid, X, Y, Z);
            PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8042/listen.pls");
            SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
            return 1;
        }
        if(listitem == 5)
        {
            new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
            GetPlayerPos(playerid, X, Y, Z);
            PlayAudioStreamForPlayer(playerid, "http://205.188.215.225:8022/listen.pls");
            SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
            return 1;
        }
        if(listitem == 6)
        {
            new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
            GetPlayerPos(playerid, X, Y, Z);
            PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8040/listen.pls");
            SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
            return 1;
        }
        if(listitem == 7)
        {
            new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
            GetPlayerPos(playerid, X, Y, Z);
            PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=357703");
            SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
            return 1;
        }
        if(listitem == 8)
        {
            new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
            GetPlayerPos(playerid, X, Y, Z);
            PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1026951");
            SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
            return 1;
        }
        if(listitem == 9)
        {
            new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
            GetPlayerPos(playerid, X, Y, Z);
            PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
            SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
            return 1;
       }
       if(listitem == 10)
       {
            new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
            GetPlayerPos(playerid, X, Y, Z);
            PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1543115");
            SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
            return 1;
       }
       if(listitem == 11)
       {
            new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
            GetPlayerPos(playerid, X, Y, Z);
            PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
            SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
            return 1;
       }
       if(listitem == 12)
       {
            new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
            GetPlayerPos(playerid, X, Y, Z);
            PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283516");
            SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
            return 1;
       }
       if(listitem == 13)
       {
            new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
            GetPlayerPos(playerid, X, Y, Z);
            PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=737152");
            SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
            return 1;
       }
       if(listitem == 14)
       {
            new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
            GetPlayerPos(playerid, X, Y, Z);
            PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=259629");
            SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
            return 1;
       }
       if(listitem == 15)
       {
            new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
            GetPlayerPos(playerid, X, Y, Z);
            PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1193516");
            SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
            return 1;
       }
       if(listitem == 16)
       {
            new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
            GetPlayerPos(playerid, X, Y, Z);
            PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1878");
            SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
            return 1;
        }
    }
    if(dialogid == 9312)
    {
        if(response)
        {
            if(listitem == 0)
            {
                ShowPlayerDialog(playerid, 9313, DIALOG_STYLE_LIST, "Choose the channel you would like to listen!", "977 The Hitz Channel\n977 The 80s Channel\n181.FM - POWER 181\n1POWER\n108.FM - THE HITLIST\nChroniX Metal\nHOT 108 JAMZ\nSpart FM Tupac Channel\nAlex Jones FM\nFrench Kiss FM\nBlackBeat FM\nDEFJAY\nPower Hitz\nSky FM\nOld School 99\nTrance Channel\nIbiza Sonica", "Select", "Cancel");
            }
            if(listitem == 1)
            {
                StopAudioStreamForPlayer(playerid);
            }
        }
        return 1;
    }
}
Reply
#6

Quote:
Originally Posted by Mimic
Посмотреть сообщение
Also, your indentation is killing me. Something like this is much better.
He is right..
Reply
#7

Not working...
Reply
#8

Bump.
Reply
#9

I really apologize for triple posting, as I want this to be fixed ATM..
Reply
#10

Sorry for my late reply, PM me your team viewer details.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)