Help with this code -
Aribaba - 04.04.2012
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
Re: Help with this code -
TzAkS. - 04.04.2012
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;
}
Respuesta: Help with this code -
Aribaba - 04.04.2012
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.
Re: Help with this code -
TzAkS. - 04.04.2012
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;
}
Re: Help with this code -
AndreT - 04.04.2012
It still will not work... What is it with all the USELESS returns??!!