CMD:radio(playerid, params[]) { if(!IsPlayerInAnyVehicle) return SendClientMessage(playerid, -1, "You need to be in a vehicle to use this command!"); ShowPlayerDialog(playerid, DIALOG_MUSICPLAYER, DIALOG_STYLE_LIST, "Radio Vinewood", "Chicosci - Raspberry Girl\nI Like That - Richard Vission & Static\nAsking Alexandria- Not The American Average\nChamillionaire - Ridin' ft. Krayzie Bone\nKid Frost ft Big Tank - I'm a Bad Ass\nChris Brown - Should've Kissed You", "Play", "Close"); return 1; }
#define DIALOG_MUSICPLAYER 1
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { 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, "URL"); // Play the song } if(listitem == 1) // We now check if the player clicked the second song { PlayAudioStreamForPlayer(playerid, "URL"); // Play the song } if(listitem == 2) // or the third song. { PlayAudioStreamForPlayer(playerid, "URL"); // Play the song } } } return 1; }
...
if(!IsPlayerInAnyVehicle(playerid)) // and the rest of the code
...
it should be
pawn Код:
|