command doesnt show ig!
#1

recently i made my own radio system but when i go ig and type /playradio i get 'unkown command'

(( its a fs))

code

pawn Код:
#include <a_samp>
#include <zcmd>
#if defined FILTERSCRIPT

#define COLOR_BLUE 0xFFFFFF

#define DIALOG1 9312
#define DIALOG2 9313


public OnPlayerCommandText(playerid, cmdtext[])
{
CMD:playradio(playerid, params [])
{
    if(!IsPlayerInAnyVehicle(playerid)) // You can remove this if you want, this means the radio won't start If you're not inside a vehicle.
    {
    SendClientMessageEx(playerid, COLOR_BLUE, "In-case you want to turn the radio on, you have to be in a vehicle!");
    return 1;
    }

        ShowPlayerDialog(playerid, 9312, DIALOG_STYLE_LIST, "Radio Station", "Radio Channels\nTurn the music off", "Select", "Cancel"); // Now, we're using the first dialog, you can add any options you want, for example, I've added 'Radio Channels, and turn the music off.
        return 1;
    }
    return 0;
}


        return 1;
    }
    return 0;
}


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 9313) // Here, we're gonna use the second dialog, which contains the radio channels
    {
      if(response)
      {
       if(listitem == 0)
       {
       new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0; // This means the distance that the player would be able to hear music
       GetPlayerPos(playerid, X, Y, Z);
       PlayAudioStreamForPlayer(playerid, "http://205.188.215.230:8002/listen.pls"); // Here, you can add any stream URL you'd like,
       SendClientMessage(playerid, COLOR_BLUE, "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_BLUE, "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_BLUE, "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_BLUE, "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_BLUE, "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_BLUE, "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_BLUE, "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_BLUE, "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_BLUE, "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_BLUE, "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_BLUE, "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_BLUE, "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_BLUE, "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_BLUE, "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_BLUE, "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_BLUE, "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_BLUE, "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"); // Here, you can add any channel you want, incase you have the streaming URL for it
       }
       if(listitem == 1)
       {
       StopAudioStreamForPlayer(playerid); // Now, this will turn the radio stream off, this means you won't be able to hear the streaming.
       SendClientMessage(playerid, COLOR_BLUE, "Music off.");
       }
       return 1;
            }
        }
    return 1;
#endif
Reply
#2

Try this:
pawn Код:
CMD:playradio(playerid, params [])
{
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessageEx(playerid, COLOR_BLUE, "In-case you want to turn the radio on, you have to be in a vehicle!");
    {
        ShowPlayerDialog(playerid, 9312, DIALOG_STYLE_LIST, "Radio Station", "Radio Channels\nTurn the music off", "Select", "Cancel"); // Now, we're using the first dialog, you can add any options you want, for example, I've added 'Radio Channels, and turn the music off.
    }
    return 1;
}
Reply
#3

still doesnt show up
Reply
#4

pawn Код:
CMD:playradio(playerid, params [])
{
    if(!IsPlayerInAnyVehicle(playerid)) // You can remove this if you want, this means the radio won't start If you're not inside a vehicle.
    {
    SendClientMessageEx(playerid, COLOR_BLUE, "In-case you want to turn the radio on, you have to be in a vehicle!");
    }
    else
    {
        ShowPlayerDialog(playerid, 9312, DIALOG_STYLE_LIST, "Radio Station", "Radio Channels\nTurn the music off", "Select", "Cancel"); // Now, we're using the first dialog, you can add any options you want, for example, I've added 'Radio Channels, and turn the music off.
        return 1;
    }
put it at anywhere on your script ,
Reply
#5

Cut the Ex from the SendClientMessageEx, try?
Reply
#6

Don't use zcmd into OnPlayerCommandText
Reply
#7

Zcmd commands have to be on Bottom of the script, else it will not work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)