On Dialog Response, dosen't Work, No Errors
#1

pawn Код:
#define DIALOG_MUSIC2 45232

pawn Код:
COMMAND:playmusic(playerid, params[])
{
    ShowPlayerDialog(playerid, DIALOG_MUSIC2, DIALOG_STYLE_LIST, "Choose a song", "Sandstorm - Darude\nDanza Kuduro - Don Omar\nDragon Born - Headhunterz\nKill For Lies - Ulrik Munther\nLabrinth Ft. Emeli Sande - Beneath Your Beautiful\nDon't Laugh At Me - Mark Wills\nA1 - Caught In The Middle\nA1 - Don't Wanna Lose You Again\nEminem - Like Toy Soldiers\nEminem - Mocking Bird\nEminem - Talking To My self\nAkon - Don't Matter", "Select", "Close");
    return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_MUSIC2)
    {
        if(response) // If they clicked 'Select' or double-clicked a weapon
        {
            // Give them the weapon
            if(listitem == 0) // They selected the first item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                PlayAudioStreamForPlayer(i, "http://dl.dropbox.com/u/18961700/Darude%20-%20Sandstorm.mp3");
            }
            if(listitem == 1) // They selected the second item - AK-47
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                PlayAudioStreamForPlayer(i, "http://dl.dropbox.com/u/18961700/Don%20Omar%20-%20Danza%20Kuduro%20ft.%20Lucenzo.mp3");
            }
            if(listitem == 2) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                PlayAudioStreamForPlayer(i, "http://dl.dropbox.com/u/18961700/Headhunterz%20-%20Dragonborn%20(Official%20Videoclip).mp3");
            }
            if(listitem == 3) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                PlayAudioStreamForPlayer(i, "http://dl.dropbox.com/u/18961700/Ulrik%20Munther%20-%20Kill%20for%20Lies%20(with%20Lyrics).mp3");
            }
            if(listitem == 4) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                PlayAudioStreamForPlayer(i, "http://dl.dropbox.com/u/18961700/Labrinth%20ft.%20Emeli%20Sande%20-%20Beneath%20Your%20Beautiful.mp3");
            }
            if(listitem == 5) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                PlayAudioStreamForPlayer(i, "http://dl.dropbox.com/u/18961700/Mark%20Wills%20-%20Don't%20Laugh%20At%20Me.mp3");
            }
            if(listitem == 6) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                PlayAudioStreamForPlayer(i, "http://dl.dropbox.com/u/18961700/A1%20-%20Caught%20In%20The%20Middle.mp3");
            }
            if(listitem == 7) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                PlayAudioStreamForPlayer(i, "http://dl.dropbox.com/u/18961700/A1%20-%20Don't%20wanna%20lose%20you%20again%20(LYRICS).mp3");
            }
            if(listitem == 8) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                PlayAudioStreamForPlayer(i, "http://dl.dropbox.com/u/18961700/Eminem%20-%20Like%20Toy%20Soldiers.mp3");
            }
            if(listitem == 9) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                PlayAudioStreamForPlayer(i, "http://dl.dropbox.com/u/18961700/Eminem%20-%20Mockingbird.mp3");
            }
            if(listitem == 10) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                PlayAudioStreamForPlayer(i, "http://dl.dropbox.com/u/18961700/eminem%20-%20talking%20to%20my%20self%20(official%20music).mp3");
            }
            if(listitem == 11) // They selected the third item - Desert Eagle
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                PlayAudioStreamForPlayer(i, "http://dl.dropbox.com/u/18961700/Akon%20-%20Don't%20Matter.mp3");
            }
        }
        return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
    }

    return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}
The only warning:

pawn Код:
C:\Users\fravag\Desktop\Server 0.3e\pawno\include\YSI\internal\..\y_scriptinit.inc(91) : warning 209: function "SSCANF_OnFilterScriptInit" should return a value
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.
Works on my lan server but not on my hosted server, any tips? It's a filterscript, and i am sure I have loaded it.
Reply
#2

what's the line 91?
Reply
#3

Quote:
Originally Posted by Rudy_
Посмотреть сообщение
what's the line 91?
Turns out to be this line:

pawn Код:
CreateDynamicObject(2906,1360.8000488,-1521.8000488,12.6000004,0.0000000,0.0000000,311.0000000); //object(kmb_deadarm) (1)
EDIT: That was the line in the FS not the include

I dont happen to have any y_scriptinit in:

C:\Users\fravag\Desktop\Server 0.3e\pawno\include\YSI\internal
Reply
#4

#define DIALOG_MUSIC2 45232 try to lower that for ex 4523
Reply
#5

If you exceed a certain value in dialog IDs it wont work. I don't remember the exact value.

Edit: Found it. Its 32767. Try lowering the value of dialog ID.
Reply
#6

tried with:

pawn Код:
#define DIALOG_MUSIC2 4523
But didnt work. The FS works in the local server, but not on the host..
Reply
#7

by the way , if you want to load the fs add it in server.cfg sometimes they don't work with rcon loadfs or loadfs from console
Reply
#8

The whole FS didn't work, but it might have had something to do with PlayAudioStreamForPlayer, i found out that that didnt work on volt-host, but when i am now using a audio plugin and then it works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)