Problem with PlayAudioStreamForPlayer -
Petricko - 23.04.2012
I made that when a player uses the command / Music, DIALOG_STYLE_INPUT him out, and bring the link of a song. There are no eror but the problem is that it will not load link of the song.
I do not know what the problem.
pawn Код:
if(strcmp(cmd, "/muzika", true) ==0)
{
ShowPlayerDialog(playerid, 125, DIALOG_STYLE_INPUT, "Muzika", "Unesite link pesme.", "Pusti", "Otkazi" );
return 1;
}
pawn Код:
if(dialogid == 125)
{
if(strlen(inputtext))
{
new linkbre;
linkbre = strval(inputtext);
new link[128];
format(link, sizeof(link), "%s",linkbre);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i, 50 , X, Y, Z))
{
PlayAudioStreamForPlayer(i, link, X, Y, Z, 50, 1);
return 1;
}
return 1;
}
}
}
}
Re: Problem with PlayAudioStreamForPlayer -
Ballu Miaa - 23.04.2012
Try this one brother. I Guess i got the mistake you did.
pawn Код:
if(dialogid == 125)
{
if(strlen(inputtext))
{
new linkbre[128];
linkbre = strval(inputtext);
new link[128];
format(link, sizeof(link), "%s",linkbre);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i, 50 , X, Y, Z))
{
PlayAudioStreamForPlayer(i, link, X, Y, Z, 50, 1);
return 1;
}
return 1;
}
}
}
}
Re: Problem with PlayAudioStreamForPlayer -
MP2 - 23.04.2012
Why are you using strval on inputtext..?
Get rid of all the string shit and just do
PlayAudioStreamForPlayer(i, inputtext, X, Y, Z, 50, 1);
and remove the return under PlayAudioStreamForPlayer because that's going to stop your loop as soon as it finds a player in range.
Re: Problem with PlayAudioStreamForPlayer -
Petricko - 23.04.2012
Now i have eror...
Код:
C:\Users\xp\Desktop\BlizZard RP 0.3d\gamemodes\BlizZard.pwn(19717) : error 033: array must be indexed (variable "linkbre")
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Re: Problem with PlayAudioStreamForPlayer -
Ballu Miaa - 23.04.2012
Quote:
Originally Posted by MP2
Why are you using strval on inputtext..?
Get rid of all the string shit and just do
PlayAudioStreamForPlayer(i, inputtext, X, Y, Z, 50, 1);
|
Hell yeah Damn my bad too MP2
![Cheesy](images/smilies/biggrin.png)
Ty for this bruh.
Here's the code lil bruh. Try this one
pawn Код:
if(dialogid == 125)
{
if(strlen(inputtext))
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i, 50 , X, Y, Z))
{
PlayAudioStreamForPlayer(i, inputtext, X, Y, Z, 50, 1);
return 1;
}
return 1;
}
}
}
}
Re: Problem with PlayAudioStreamForPlayer -
MP2 - 23.04.2012
Quote:
Originally Posted by MP2
Get rid of all the string shit
|
^^^^
Do I have to do it for you? (not going to, going to bed.)
Re: Problem with PlayAudioStreamForPlayer -
Ballu Miaa - 23.04.2012
Quote:
Originally Posted by MP2
^^^^
Do I have to do it for you? (not going to, going to bed.)
|
I've already done that. He needs to check my post above.
Re: Problem with PlayAudioStreamForPlayer -
Petricko - 23.04.2012
Thank you very much ... I do not know what I looking when I was making ... xD
Re: Problem with PlayAudioStreamForPlayer -
MP2 - 23.04.2012
Make sure you remove the return from inside the loop.