SA-MP Forums Archive
Radio problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Radio problem (/showthread.php?tid=526332)



Radio problem - mkdim9z6 - 16.07.2014

when I use the script in the gamemode, it works, but when I use it in a filterscript it doesnt.

pawn Код:
#include <a_samp>

//COLORS
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_BRIGHTRED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_BLUE 0x3A47DEFF
#define COLOR_TAN 0xBDB76BAA
#define COLOR_PURPLE 0x800080AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_BLACK 0x00000000
#define COLOR_DARKGREY 0x696969FF
#define COLOR_RED 0xFF000000
#define COLOR_LBLUE     0x33CCFF19
#define RADIO 66

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
        print("\n--------------------------------------");
        print(" Radio Filterscript by Da_Light");
        print("--------------------------------------\n");
        return 1;
}

public OnFilterScriptExit()
{
        return 1;
}

#endif

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/radio", true))
    {
        new string[3000];
        strcat(string,"{FF0000}Stop Radio\n");
        strcat(string,"{0000FF}Dumbledore's Farewell\n");
        strcat(string,"{006400}Posthumus - Unstoppable\n");
        strcat(string,"{FF8C00}Katy Perry - ROAR\n");
        strcat(string,"{008000}Lords OF The Realm\n");
        strcat(string,"{4B00B0}Karate Chop Future Ft. Lil Wayne\n");
        strcat(string,"{00FF00}Emotional Sad Music\n");
        strcat(string,"{FFC0CB}EPIC Music (The Best Of) Mix VIII - Epic Emotion (HD)\n");
        strcat(string,"{A52A2A}Eminem - The Monster (FT. Rihana)\n");
        strcat(string,"{808080}Eminem - Rap God\n");
        strcat(string,"{FF0000}Eminem - Legacy\n");
        ShowPlayerDialog(playerid, RADIO, DIALOG_STYLE_LIST,"{ADD8E6}mmtech {90EE90}Radio",string,"Select","Cancel");
        return 1;
    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == RADIO)
    {
        if(listitem == 0)
        {
            StopAudioStreamForPlayer(playerid);
            GameTextForPlayer(playerid, "Radio Stopped.",2500,1);
        }
        if(listitem == 1)
        {
            PlayAudioStreamForPlayer(playerid, "http://dl.dropboxusercontent.com/s/7ua68fpx6w4y22f/1.mp3");
            GameTextForPlayer(playerid, "Playing Dumbledore's Farewell",2500,1);
        }
        if(listitem == 2)
        {
            PlayAudioStreamForPlayer(playerid, "http://dl.dropboxusercontent.com/s/bhcfyxb1bjiz6mt/2.mp3");
            GameTextForPlayer(playerid, "Playing Posthumus - Unstoppable",2500,1);
        }
        if(listitem == 3)
        {
            PlayAudioStreamForPlayer(playerid, "http://dl.dropboxusercontent.com/s/cm8ei54pepgrbx3/10.mp3");
            GameTextForPlayer(playerid, "Playing Katy Perry - ROAR",2500,1);
        }
        if(listitem == 4)
        {
            PlayAudioStreamForPlayer(playerid, "http://dl.dropboxusercontent.com/s/zfe8r72dwpj57ko/9.mp3");
            GameTextForPlayer(playerid, "Playing Lords OF The Realm",2500,1);
        }
        if(listitem == 5)
        {
            PlayAudioStreamForPlayer(playerid, "http://dl.dropboxusercontent.com/s/v4yjphcdl5yjggw/8.mp3");
            GameTextForPlayer(playerid, "Playing Karate Chop Future Ft. Lil Wayne",2500,1);
        }
        if(listitem == 6)
        {
            PlayAudioStreamForPlayer(playerid, "http://dl.dropboxusercontent.com/s/utorz2iricbmxmg/6.mp3");
            GameTextForPlayer(playerid, "Playing Emotional Sad Music",2500,1);
        }
        if(listitem == 7)
        {
            PlayAudioStreamForPlayer(playerid, "http://dl.dropboxusercontent.com/s/cnw13d44ztschpe/7.mp3");
            GameTextForPlayer(playerid, "Playing EPIC Music (The Best Of) Mix VIII - Epic Emotion (HD)",2500,1);
        }
        if(listitem == 8)
        {
            PlayAudioStreamForPlayer(playerid, "http://dl.dropboxusercontent.com/s/t03svun7xheeiiy/5.mp3");
            GameTextForPlayer(playerid, "Playing Eminem - The Monster (FT. Rihana)",2500,1);
        }
        if(listitem == 9)
        {
            PlayAudioStreamForPlayer(playerid, "http://dl.dropboxusercontent.com/s/64eez15r2j6me3k/4.mp3");
            GameTextForPlayer(playerid, "Playing Eminem - Rap God",2500,1);
        }
        if(listitem == 10)
        {
            PlayAudioStreamForPlayer(playerid, "http://dl.dropboxusercontent.com/s/lskcqw0g01db7pv/3.mp3");
            GameTextForPlayer(playerid, "Playing Eminem - Legacy",2500,1);
        }
    }
}
When I use the radio as a filterscript, I can see the dialogs, but the music doesn't play


Re: Radio problem - Scottas - 17.07.2014

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == RADIO)
    {
        if(listitem == 0)
        {
            StopAudioStreamForPlayer(playerid);
            GameTextForPlayer(playerid, "Radio Stopped.",2500,1);
        }
        if(listitem == 1)
        {
            PlayAudioStreamForPlayer(playerid, "http://dl.dropboxusercontent.com/s/7ua68fpx6w4y22f/1.mp3");
            GameTextForPlayer(playerid, "Playing Dumbledore's Farewell",2500,1);
        }
        if(listitem == 2)
        {
            PlayAudioStreamForPlayer(playerid, "http://dl.dropboxusercontent.com/s/bhcfyxb1bjiz6mt/2.mp3");
            GameTextForPlayer(playerid, "Playing Posthumus - Unstoppable",2500,1);
        }
        if(listitem == 3)
        {
            PlayAudioStreamForPlayer(playerid, "http://dl.dropboxusercontent.com/s/cm8ei54pepgrbx3/10.mp3");
            GameTextForPlayer(playerid, "Playing Katy Perry - ROAR",2500,1);
        }
        if(listitem == 4)
        {
            PlayAudioStreamForPlayer(playerid, "http://dl.dropboxusercontent.com/s/zfe8r72dwpj57ko/9.mp3");
            GameTextForPlayer(playerid, "Playing Lords OF The Realm",2500,1);
        }
        if(listitem == 5)
        {
            PlayAudioStreamForPlayer(playerid, "http://dl.dropboxusercontent.com/s/v4yjphcdl5yjggw/8.mp3");
            GameTextForPlayer(playerid, "Playing Karate Chop Future Ft. Lil Wayne",2500,1);
        }
        if(listitem == 6)
        {
            PlayAudioStreamForPlayer(playerid, "http://dl.dropboxusercontent.com/s/utorz2iricbmxmg/6.mp3");
            GameTextForPlayer(playerid, "Playing Emotional Sad Music",2500,1);
        }
        if(listitem == 7)
        {
            PlayAudioStreamForPlayer(playerid, "http://dl.dropboxusercontent.com/s/cnw13d44ztschpe/7.mp3");
            GameTextForPlayer(playerid, "Playing EPIC Music (The Best Of) Mix VIII - Epic Emotion (HD)",2500,1);
        }
        if(listitem == 8)
        {
            PlayAudioStreamForPlayer(playerid, "http://dl.dropboxusercontent.com/s/t03svun7xheeiiy/5.mp3");
            GameTextForPlayer(playerid, "Playing Eminem - The Monster (FT. Rihana)",2500,1);
        }
        if(listitem == 9)
        {
            PlayAudioStreamForPlayer(playerid, "http://dl.dropboxusercontent.com/s/64eez15r2j6me3k/4.mp3");
            GameTextForPlayer(playerid, "Playing Eminem - Rap God",2500,1);
        }
        if(listitem == 10)
        {
            PlayAudioStreamForPlayer(playerid, "http://dl.dropboxusercontent.com/s/lskcqw0g01db7pv/3.mp3");
            GameTextForPlayer(playerid, "Playing Eminem - Legacy",2500,1);
        }
        return 1;
    }
    return 0;
}



Re: Radio problem - mkdim9z6 - 17.07.2014

it didn't work


Re: Radio problem - paulommu - 17.07.2014

Do you use any command processor on your server?


Re: Radio problem - Blast3r - 17.07.2014

Is this FS defined as the first one (in case you got more FSs) because if you put this FS after another FS in the server.cfg the dialogs won't work properly.


Re: Radio problem - mkdim9z6 - 17.07.2014

Quote:
Originally Posted by Blast3r
Посмотреть сообщение
Is this FS defined as the first one (in case you got more FSs) because if you put this FS after another FS in the server.cfg the dialogs won't work properly.
well it's not the first one, I have around 3-4 filterscipts with dialogs, 2 of them work (not my own filterscrpts).