SA-MP Forums Archive
Another help needed. - 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: Another help needed. (/showthread.php?tid=424695)



Another help needed. - LeeXian99 - 23.03.2013

Well, I wonder why /music is not working... :/ (It's a fliterscript)

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/music", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid, 69, DIALOG_STYLE_LIST, "Music", "1. Daniel Kim - Pop Danthology 2012\n2. Test", "Play", "Cancel");
        return 1;
    }
    return 0;
}
Yeah, if this is solved, I will add more songs into it.

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response)// They pressed the first button.
    {
        switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
        {
            case 1:// Our dialog!
            {
                switch(listitem)// Checking which listitem was selected
            {
                case 0: PlayAudioStreamForPlayer(playerid, "http://racerevolution.cu.cc/music/Daniel%20Kim%20-%20Pop%20Danthology%202012.mp3");
                case 1: SendClientMessage(playerid, 0xFF000000, "Testing only!");
            }
        }
    }
 }
    return 1;
}
I will give +rep if who has helped and solved this problem.


Re: Another help needed. - Rock - 23.03.2013

You dialog id is 69 in ShowPlayerDialog


Re: Another help needed. - RenovanZ - 23.03.2013

Maybe your URL isn't working.
and for info, you can give reputation point if your post not 50 or above
EDIT:
Change this code
pawn Код:
ShowPlayerDialog(playerid, 69, DIALOG_STYLE_LIST, "Music", "1. Daniel Kim - Pop Danthology 2012\n2. Test", "Play", "Cancel");
to this code
pawn Код:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Music", "1. Daniel Kim - Pop Danthology 2012\n2. Test", "Play", "Cancel");



Re: Another help needed. - Gamer_007 - 23.03.2013

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid ==69)
     {
          if(response)
        {
        if(listitem == 0)
        {
                PlayAudioStreamForPlayer(playerid, "http://racerevolution.cu.cc/music/Daniel%20Kim%20-%20Pop%20Danthology%202012.mp3");
}
                if(listitem == 0)
        {
 SendClientMessage(playerid, 0xFF000000, "Testing only!");
}
}
}
}
return 1;
}
Try this one.Maybe it works.I didnt tested yet


Re: Another help needed. - Rock - 23.03.2013

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 69)
    {
        if(response)
        {
            if(listitem == 0)
            {
                PlayAudioStreamForPlayer(playerid, "http://racerevolution.cu.cc/music/Daniel%20Kim%20-%20Pop%20Danthology%202012.mp3");
                SendClientMessage(playerid, 0xFF000000, "Testing only!");
            }
            if(listitem == 0)
            {
                PlayAudioStreamForPlayer(playerid, "http://racerevolution.cu.cc/music/Daniel%20Kim%20-%20Pop%20Danthology%202012.mp3");
                SendClientMessage(playerid, 0xFF000000, "Testing only!");
            }
        }
        return 1;
    }
    return 1;
}
Read THIS!

EDIT: too late


Re: Another help needed. - LeeXian99 - 23.03.2013

Oops, my mistake. Anyway, Kiyozi, it's working, www.racerevolution.cu.cc/music as I created a folder via volt-host file manager.