Se puede asignar una cancion y reconocerla -
-[R]hysi- - 21.05.2012
Bueno nose como explicarme la verdad,voy a hacer lo posible para que se entienda.Estoy tratando de hacer un dialog y que al seleccionar una canciуn esa se reproduzca en algъn momento(obviamente hay mas de una canciуn y la que elijas tiene que sonar)Llege a esto pero nose como hacer que suene la que yo elijo
pawn Код:
if(dialogid == MUSICAR1)
{
if(response)
{
if(listitem == 0)
{
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, "LINK");
}
if(listitem == 1)
{
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, "LINK");
}
if(listitem == 2)
{
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, "LINK");
}
if(listitem == 3)
{
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, "LINK");
}
if(listitem == 4)
{
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, "LINK");
}
if(listitem == 5)
{
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, "LINK");
}
if(listitem == 6)
{
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, "LINK");
}
if(listitem == 7)
{
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, "LINK");
}
if(listitem == 8)
{
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, "LINK");
}
if(listitem == 9)
{
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, "LINK");
}
if(listitem == 10)
{
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, "LINK");
}
if(listitem == 11)
{
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, "LINK");
}
}
return 1;
}
Por ejemplo yo elijo la cancion 1 y que al subir al coche suene esa cancion
pawn Код:
new Musicar1[][] =
{
"LINK",
"LINK",
"LINK",
"LINK",
"LINK",
"LINK"
};
De esa manera estaria bien?pido una ayuda ya que no se me ocurre como hacerlo D:
Respuesta: Se puede asignar una cancion y reconocerla -
[J]ulian - 21.05.2012
Tendrнas que guardar el link en una variable con strmid y luego en lugar de reproducir el link lo haces con la variable.
Respuesta: Se puede asignar una cancion y reconocerla -
TiNcH010 - 21.05.2012
Si usas "" en el dialog para que tenes definido "Musicar1" ?
Usa como dice Juliбn o asн:
pawn Код:
if(dialogid == MUSICAR1)
{
if(response)
{
if(listitem == 0)
{
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, Musicar1);
}
if(listitem == 1)
{
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, Musicar1);
}
if(listitem == 2)
{
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, Musicar1);
}
if(listitem == 3)
{
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, Musicar1);
}
if(listitem == 4)
{
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, Musicar1);
}
if(listitem == 5)
{
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, Musicar1);
}
if(listitem == 6)
{
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, Musicar1);
}
if(listitem == 7)
{
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, Musicar1);
}
if(listitem == 8)
{
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, Musicar1);
}
if(listitem == 9)
{
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, Musicar1);
}
if(listitem == 10)
{
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, Musicar1);
}
if(listitem == 11)
{
StopAudioStreamForPlayer(playerid);
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
PlayAudioStreamForPlayer(playerid, Musicar1);
}
}
return 1;
}
Y luego si:
pawn Код:
new Musicar1[][] =
{
"LINK",
"LINK",
"LINK",
"LINK",
"LINK",
"LINK"
};
Respuesta: Se puede asignar una cancion y reconocerla -
-[R]hysi- - 21.05.2012
Me dio 12 errores todos son
error 048: array dimensions do not match
En las lineas que contienen.
pawn Код:
PlayAudioStreamForPlayer(playerid, Musicar1);