04.01.2012, 15:24
hey guys,
well i know plapaudiostream thing is for 0.3d but now i thought lets copy it from teh a_players include from the 0.3d server and put that native thing in my script and well it looks like this:
but when i start my server then it says file or function is not found... but the script isnt giving errors... can anyone help me?
greets niels
well i know plapaudiostream thing is for 0.3d but now i thought lets copy it from teh a_players include from the 0.3d server and put that native thing in my script and well it looks like this:
pawn Код:
#define DIALOG_MUSICPLAYER 1
native PlayAudioStreamForPlayer(playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0);
pawn Код:
if(dialogid == DIALOG_MUSICPLAYER) // This checks to see if the dialog the players viewing is the music player one
{
if(response) // If the player clicked a song
{
if(listitem == 0) // Since this is a list, we check if they clicked the first song on the list.
{
PlayAudioStreamForPlayer(playerid, "http://www.youtube.com/watch?v=_ovdm2yX4MA&ob=av2n"); // Play the song
}
if(listitem == 1) // We now check if the player clicked the second song
{
PlayAudioStreamForPlayer(playerid, "http://www.youtube.com/watch?v=dLhFDYQHDQY&ob=av2e"); // Play the song
}
if(listitem == 2) // or the third song.
{
PlayAudioStreamForPlayer(playerid, "http://www.youtube.com/watch?v=Wa5B22KAkEk&ob=av2e"); // Play the song
}
}
}
pawn Код:
CMD:radio(playerid, params[])
{
ShowPlayerDialog(playerid, DIALOG_MUSICPLAYER, DIALOG_STYLE_LIST, "Music Player", "Avicii - Levels\nTaio Cruz ft. Flo Rida -Hangover\nSnoop Dogg & Wiz Khalifa - Young, Wild and Free ft. Bruno Mars", "Play", "Close"); //This shows the dialog, notice we used DIALOG_MUSICPLAYER for the dialogid!
return 1;
}
greets niels