Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #file "player.amx"
- #include <a_samp>
- #include <YSI\y_hooks>
- hook OnFilterScriptInit() print(">> Radio R1 successfully loaded.");
- hook OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp(cmdtext, "/radio", true) == 0) return Useradio(playerid);
- return SendClientMessage(playerid,-1,"SERVER: unknown command.");
- }
- hook OnPlayerDeath(playerid, killerid, reason) StopAudioStreamForPlayer(playerid);
- hook OnPlayerDisconnect(playerid, reason) StopAudioStreamForPlayer(playerid);
- hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
- switch(dialogid){
- case 1:{
- switch(listitem) {
- case 0: PlayAudioStreamForPlayer(playerid,"http://webcast.emg.fm:55655/europaplus128.mp3");
- case 1: StopAudioStreamForPlayer(playerid);
- }
- }
- }
- }
- Useradio(playerid)
- {
- printf("Use radio %s.",Name(playerid));
- return ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Selecting a radio station","Europa plus\n\
- {FF0000}Radio OFF{FFFFFF}","ENTER","EXIT");
- }
- stock Name(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- return name;
- }
- #endscript
Advertisement
Add Comment
Please, Sign In to add comment