14.03.2014, 06:57
I made a radio system one day, so here it is
Код:
// This is a FS created by Shiffey. #define FILTERSCRIPT #include <a_samp> public OnFilterScriptInit() { print("\n--------------------------------------"); print(" Radio loaded "); print("--------------------------------------\n"); return 1; } public OnFilterScriptExit() { return 1; } public OnGameModeInit() { return 1; } public OnGameModeExit() { return 1; } public OnPlayerRequestClass(playerid, classid) { return 1; } public OnPlayerConnect(playerid) { return 1; } public OnPlayerDisconnect(playerid, reason) { return 1; } public OnPlayerSpawn(playerid) { SendClientMessage(playerid, -1, "{FC160A}[Radio] {73D60F}Use /radio to play some real music. "); return 1; } public OnPlayerDeath(playerid, killerid, reason) { return 1; } public OnVehicleSpawn(vehicleid) { return 1; } public OnVehicleDeath(vehicleid, killerid) { return 1; } public OnPlayerText(playerid, text[]) { return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/radio", cmdtext, true, 10) == 0) { ShowPlayerDialog(playerid, 7778, DIALOG_STYLE_LIST, "{0FCC08}Radio system by Shiffey", "A to Z hits (POP)\nKickin County\nHOT 108 JAMZ\n100Hitz - Top 40 (Pop)\nLSPD Scanner\nFDSA Scanner\nHome Grown Radio (Rap)", "Play", "Cancel"); return 1; } if (strcmp("/stopmusic", cmdtext, true, 10) == 0) { StopAudioStreamForPlayer(playerid); return 1; } return 0; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { return 1; } public OnPlayerExitVehicle(playerid, vehicleid) { return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { return 1; } public OnPlayerEnterCheckpoint(playerid) { return 1; } public OnPlayerLeaveCheckpoint(playerid) { return 1; } public OnPlayerEnterRaceCheckpoint(playerid) { return 1; } public OnPlayerLeaveRaceCheckpoint(playerid) { return 1; } public OnRconCommand(cmd[]) { return 1; } public OnPlayerRequestSpawn(playerid) { return 1; } public OnObjectMoved(objectid) { return 1; } public OnPlayerObjectMoved(playerid, objectid) { return 1; } public OnPlayerPickUpPickup(playerid, pickupid) { return 1; } public OnVehicleMod(playerid, vehicleid, componentid) { return 1; } public OnVehiclePaintjob(playerid, vehicleid, paintjobid) { return 1; } public OnVehicleRespray(playerid, vehicleid, color1, color2) { return 1; } public OnPlayerSelectedMenuRow(playerid, row) { return 1; } public OnPlayerExitedMenu(playerid) { return 1; } public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) { return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { return 1; } public OnRconLoginAttempt(ip[], password[], success) { return 1; } public OnPlayerUpdate(playerid) { return 1; } public OnPlayerStreamIn(playerid, forplayerid) { return 1; } public OnPlayerStreamOut(playerid, forplayerid) { return 1; } public OnVehicleStreamIn(vehicleid, forplayerid) { return 1; } public OnVehicleStreamOut(vehicleid, forplayerid) { return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(response) { switch(dialogid) { case 7778: { switch(listitem) { case 0: { SendClientMessage(playerid, 0xFFFFFF, "Now playing A to Z hits (POP). (/stopmusic to stop it)"); PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=164772"); } case 1: { SendClientMessage(playerid, 0xFFFFFF, "Now playing Kickin County. (/stopmusic to stop it)"); PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=221956"); } case 2: { SendClientMessage(playerid, 0xFFFFFF, "Now playing HOT 108 JAMS. (/stopmusic to stop it)"); PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=8318"); } case 3: { SendClientMessage(playerid, 0xFFFFFF, "100Hitz - Top 40 (Pop). (/stopmusic to stop it)"); PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=49892"); } case 4: { SendClientMessage(playerid, 0xFFFFFF, "Now playing LSPD Scanner. (/stopmusic to stop it)"); PlayAudioStreamForPlayer(playerid, "http://www.radioreference.com/scripts/playlists/1/3711/0-5420481236.m3u"); } case 5: { SendClientMessage(playerid, 0xFFFFFF, "Now playing FDSA Scanner. (/stopmusic to stop it)"); PlayAudioStreamForPlayer(playerid, "http://www.radioreference.com/scripts/playlists/1/3440/0-5420482708.m3u"); } case 6: { SendClientMessage(playerid, 0xFFFFFF, "Now playing Home Grown Radio (Rap). (/stopmusic to stop it)"); PlayAudioStreamForPlayer(playerid, "http://ghost.wavestreamer.com:4431/stream.mp3"); } } } } } return 1; } public OnPlayerClickPlayer(playerid, clickedplayerid, source) { return 1; }