Help with this code
#1

Hi,

I made a simply code which function is, when someone do a cmd, it gives a dialog where you can paste a .mp3 url that will play to all the ppl in the server. It gave me the following errors

Код:
#include <a_samp>
#include <zcmd>

public OnFilterScriptInit()
{
    printf("\n ~~Play to all FS by Aribaba Loaded~~\n");
    return 1;
}

CMD:pta(playerid, params[])
{
    ShowPlayerDialog(playerid, 300, DIALOG_STYLE_INPUT, "Play to all", "Enter a .mp3 URL\n", "Play", "Cancel");
    public OnDialogResponse(playerid, dialogid, response, inputtext[])
	{
    if(dialogid == 300)
    {
        if(response)
        {
            new song = strval(inputtext);
            for(new i, j = GetMaxPlayers(); i < j; i++)
    		{
       	 		if(IsPlayerConnected( i ))
        		{
             	PlayAudioStreamForPlayer(i, song);
            	return 1;
				}
            return 1;
			}
			return 1;
		}
        return 1;
    }
    return 1;
}
    
    return 1;
}



Код:
C:\Documents and Settings\Alejandro\Escritorio\pta.pwn(13) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Alejandro\Escritorio\pta.pwn(13) : error 004: function "OnDialogResponse" is not implemented
C:\Documents and Settings\Alejandro\Escritorio\pta.pwn(15) : error 017: undefined symbol "dialogid"
C:\Documents and Settings\Alejandro\Escritorio\pta.pwn(17) : error 017: undefined symbol "response"
C:\Documents and Settings\Alejandro\Escritorio\pta.pwn(19) : error 017: undefined symbol "inputtext"
C:\Documents and Settings\Alejandro\Escritorio\pta.pwn(24) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\Alejandro\Escritorio\pta.pwn(27) : warning 217: loose indentation
C:\Documents and Settings\Alejandro\Escritorio\pta.pwn(19) : warning 204: symbol is assigned a value that is never used: "song"
C:\Documents and Settings\Alejandro\Escritorio\pta.pwn(36) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
Can someone help me? xD
Reply
#2

pawn Код:
#include <a_samp>
#include <zcmd>

public OnFilterScriptInit()
{
    printf("\n ~~Play to all FS by Aribaba Loaded~~\n");
    return 1;
}

CMD:pta(playerid, params[])
{
    ShowPlayerDialog(playerid, 300, DIALOG_STYLE_INPUT, "Play to all", "Enter a .mp3 URL\n", "Play", "Cancel");
}


public OnDialogResponse(playerid, dialogid, response, inputtext[])
{
    if(dialogid == 300)
    {
        if(response)
        {
            new song = strval(inputtext);
            for(new i, j = GetMaxPlayers(); i < j; i++)
            {
                if(IsPlayerConnected( i ))
                {
                PlayAudioStreamForPlayer(i, song);
                return 1;
                }
            return 1;
            }
            return 1;
        }
        return 1;
    }
    return 1;
}

    return 1;
}
Reply
#3

mmmm thanks but it gave me this errors xD



C:\Documents and Settings\Alejandro\Escritorio\pta2.pwn(16) : error 025: function heading differs from prototype
C:\Documents and Settings\Alejandro\Escritorio\pta2.pwn(27) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\Alejandro\Escritorio\pta2.pwn(30) : warning 217: loose indentation
C:\Documents and Settings\Alejandro\Escritorio\pta2.pwn(22) : warning 204: symbol is assigned a value that is never used: "song"
C:\Documents and Settings\Alejandro\Escritorio\pta2.pwn(39) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Reply
#4

pawn Код:
#include <a_samp>
#include <zcmd>

public OnFilterScriptInit()
{
    printf("\n ~~Play to all FS by Aribaba Loaded~~\n");
    return 1;
}

CMD:pta(playerid, params[])
{
    ShowPlayerDialog(playerid, 300, DIALOG_STYLE_INPUT, "Play to all", "Enter a .mp3 URL\n", "Play", "Cancel");
}


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 300)
    {
        if(response)
        {
            new song = strval(inputtext);
            for(new i = 0; i < GetMaxPlayers(); i++)
            {
                if(IsPlayerConnected( i ))
                {
                PlayAudioStreamForPlayer(i, song);
                return 1;
                }
            }
        }
    }
    return 1;
}
Reply
#5

It still will not work... What is it with all the USELESS returns??!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)