#include
#if defined FILTERSCRIPT
#define DIALOG_RADIO 2000
#define DIALOG_VLASTNI_RADIO 2001
#define DIALOG_OSTATNI_POSLOUCHAJI 2002
#define MAX_PLAYERS_EX 500
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0)(dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
/////////////////////////////////////////////////////////////////
new Posluchaci[15] = {0,...};
new Posloucham[MAX_PLAYERS_EX];
new Streamed[MAX_PLAYERS_EX][128];
dcmd_radio(playerid, params[])
{
#pragma unused params
if(!IsPlayerInAnyVehicle(playerid)) return ShowPlayerDialog(playerid, 29999, DIALOG_STYLE_MSGBOX, "{FF0000}CHYBA","{FF0000}CHYBA: Nejste ve vozidle.","Zavřít","");
new PosluchaciS[1000];
format(PosluchaciS, 1000,"{FF0000}Vypnout Rádio\nVlastní Rádio nebo MP3\n{FFFFFF}Evropa 2\t(Posluchačů: %d)\nRádio Spin\t(Posluchačů: %d)\nHip Hop Stage\t(Posluchačů: %d)\nDrum and Bass\t(Posluchačů: %d)\nRádio Beat\t(Posluchačů: %d)\nBonton Rádio\t(Posluchačů: %d)\nClub Rádio\t(Posluchačů: %d)\nCountry Rádio\t(Posluchačů: %d)\nFrekvence 1\t(Posluchačů: %d)\nRádio Impuls\t(Posluchačů: %d)\nKiss Morava\t(Posluchačů: %d)\nHelax 93.7\t(Posluchačů: %d)\n"
,Posluchaci[0],Posluchaci[1],Posluchaci[2],Posluchaci[3],Posluchaci[4],Posluchaci[5],Posluchaci[6],Posluchaci[7],Posluchaci[8],Posluchaci[9],Posluchaci[10],Posluchaci[11],Posluchaci[12]);
ShowPlayerDialog(playerid, DIALOG_RADIO, DIALOG_STYLE_LIST, "Výběr Rádia:",PosluchaciS,"Spusťit", "Zavřít");
return 1;
}
dcmd_ostatni(playerid, params[])
{
#pragma unused params
ShowPlayerCoPoslouchaji(playerid);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(radio,5,cmdtext);
dcmd(ostatni, 7, cmdtext);
return 0;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER){
switch(Posloucham[playerid]){
case 1:{ Posluchaci[0] ++; PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/evropa2-128.mp3.m3u"); }
case 2:{ Posluchaci[1] ++; PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/spin64.mp3.m3u"); }
case 3:{ Posluchaci[2] ++; PlayAudioStreamForPlayer(playerid, "http://www.hiphopstage.cz/radio128.pls"); }
case 4:{ Posluchaci[3] ++; PlayAudioStreamForPlayer(playerid, "http://www.247drumandbass.com/128k.m3u"); }
case 5:{ Posluchaci[4] ++; PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/beat128.mp3.m3u"); }
case 6:{ Posluchaci[5] ++; PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/bonton128.mp3.m3u"); }
case 7:{ Posluchaci[6] ++; PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/clubradio128.mp3.m3u"); }
case 8:{ Posluchaci[7] ++; PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/country64.mp3.m3u"); }
case 9:{ Posluchaci[8] ++; PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/frekvence1-128.mp3.m3u"); }
case 10:{ Posluchaci[9] ++; PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/impuls128.mp3.m3u"); }
case 11:{ Posluchaci[10] ++; PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/kissmoravaov64.mp3.m3u"); }
case 12:{ Posluchaci[11] ++; PlayAudioStreamForPlayer(playerid, "http://ice.abradio.cz:8000/helax128.mp3.m3u"); }
case 15:{ PlayAudioStreamForPlayer(playerid, Streamed[playerid]); }
}
}
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_PASSENGER){
switch(Posloucham[playerid]){
case 1:{ Posluchaci[0] ++; PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/evropa2-128.mp3.m3u"); }
case 2:{ Posluchaci[1] ++; PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/spin64.mp3.m3u"); }
case 3:{ Posluchaci[2] ++; PlayAudioStreamForPlayer(playerid, "http://www.hiphopstage.cz/radio128.pls"); }
case 4:{ Posluchaci[3] ++; PlayAudioStreamForPlayer(playerid, "http://www.247drumandbass.com/128k.m3u"); }
case 5:{ Posluchaci[4] ++; PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/beat128.mp3.m3u"); }
case 6:{ Posluchaci[5] ++; PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/bonton128.mp3.m3u"); }
case 7:{ Posluchaci[6] ++; PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/clubradio128.mp3.m3u"); }
case 8:{ Posluchaci[7] ++; PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/country64.mp3.m3u"); }
case 9:{ Posluchaci[8] ++; PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/frekvence1-128.mp3.m3u"); }
case 10:{ Posluchaci[9] ++; PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/impuls128.mp3.m3u"); }
case 11:{ Posluchaci[10] ++; PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/kissmoravaov64.mp3.m3u"); }
case 12:{ Posluchaci[11] ++; PlayAudioStreamForPlayer(playerid, "http://ice.abradio.cz:8000/helax128.mp3.m3u"); }
case 15:{ PlayAudioStreamForPlayer(playerid, Streamed[playerid]); }
}
}
if(oldstate == PLAYER_STATE_DRIVER){
PoslouchamPryc(playerid); StopAudioStreamForPlayer(playerid);
}
if(oldstate == PLAYER_STATE_PASSENGER){
PoslouchamPryc(playerid);StopAudioStreamForPlayer(playerid);
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_RADIO && response){
if(listitem == 0){
if(!IsPlayerInAnyVehicle(playerid)) return ShowPlayerDialog(playerid, 29999, DIALOG_STYLE_MSGBOX, "{FF0000}CHYBA","{FF0000}CHYBA: Nejste ve vozidle.","Zavřít","");
PosluchacPryc(playerid);Posloucham[playerid] = 0;StopAudioStreamForPlayer(playerid);
return 1;
}
else if(listitem == 1){
if(!IsPlayerInAnyVehicle(playerid)) return ShowPlayerDialog(playerid, 29999, DIALOG_STYLE_MSGBOX, "{FF0000}CHYBA","{FF0000}CHYBA: Nejste ve vozidle.","Zavřít","");
ShowPlayerDialog(playerid, DIALOG_VLASTNI_RADIO, DIALOG_STYLE_INPUT, "Vlastní Rádio", "Zadej URL Písničky nebo Rádia ve formátu MP3.","Přehrát","Zavřít");
}
else if(listitem == 2){
if(!IsPlayerInAnyVehicle(playerid)) return ShowPlayerDialog(playerid, 29999, DIALOG_STYLE_MSGBOX, "{FF0000}CHYBA","{FF0000}CHYBA: Nejste ve vozidle.","Zavřít","");
PosluchacPryc(playerid);Posloucham[playerid] = 1;Posluchaci[0] ++;PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/evropa2-128.mp3.m3u");
return 1;
}
else if(listitem == 3){
if(!IsPlayerInAnyVehicle(playerid)) return ShowPlayerDialog(playerid, 29999, DIALOG_STYLE_MSGBOX, "{FF0000}CHYBA","{FF0000}CHYBA: Nejste ve vozidle.","Zavřít","");
PosluchacPryc(playerid);Posloucham[playerid] = 2;Posluchaci[1] ++;PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/spin64.mp3.m3u");
return 1;
}
else if(listitem == 4){
if(!IsPlayerInAnyVehicle(playerid)) return ShowPlayerDialog(playerid, 29999, DIALOG_STYLE_MSGBOX, "{FF0000}CHYBA","{FF0000}CHYBA: Nejste ve vozidle.","Zavřít","");
PosluchacPryc(playerid);Posluchaci[2] ++;Posloucham[playerid] = 3;PlayAudioStreamForPlayer(playerid, "http://www.hiphopstage.cz/radio128.pls");
return 1;
}
else if(listitem == 5){
if(!IsPlayerInAnyVehicle(playerid)) return ShowPlayerDialog(playerid, 29999, DIALOG_STYLE_MSGBOX, "{FF0000}CHYBA","{FF0000}CHYBA: Nejste ve vozidle.","Zavřít","");
PosluchacPryc(playerid);Posluchaci[3] ++;Posloucham[playerid] = 4;PlayAudioStreamForPlayer(playerid, "http://www.247drumandbass.com/128k.m3u");
return 1;
}
else if(listitem == 6){
if(!IsPlayerInAnyVehicle(playerid)) return ShowPlayerDialog(playerid, 29999, DIALOG_STYLE_MSGBOX, "{FF0000}CHYBA","{FF0000}CHYBA: Nejste ve vozidle.","Zavřít","");
PosluchacPryc(playerid);Posluchaci[4] ++;Posloucham[playerid] = 5;PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/beat128.mp3.m3u");
return 1;
}
else if(listitem == 7){
if(!IsPlayerInAnyVehicle(playerid)) return ShowPlayerDialog(playerid, 29999, DIALOG_STYLE_MSGBOX, "{FF0000}CHYBA","{FF0000}CHYBA: Nejste ve vozidle.","Zavřít","");
PosluchacPryc(playerid);Posluchaci[5] ++;Posloucham[playerid] = 6;PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/bonton128.mp3.m3u");
return 1;
}
else if(listitem == 8){
if(!IsPlayerInAnyVehicle(playerid)) return ShowPlayerDialog(playerid, 29999, DIALOG_STYLE_MSGBOX, "{FF0000}CHYBA","{FF0000}CHYBA: Nejste ve vozidle.","Zavřít","");
PosluchacPryc(playerid);Posluchaci[6] ++;Posloucham[playerid] = 7;PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/clubradio128.mp3.m3u");
return 1;
}
else if(listitem == 9){
if(!IsPlayerInAnyVehicle(playerid)) return ShowPlayerDialog(playerid, 29999, DIALOG_STYLE_MSGBOX, "{FF0000}CHYBA","{FF0000}CHYBA: Nejste ve vozidle.","Zavřít","");
PosluchacPryc(playerid);Posluchaci[7] ++;Posloucham[playerid] = 8;PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/country64.mp3.m3u");
return 1;
}
else if(listitem == 10){
if(!IsPlayerInAnyVehicle(playerid)) return ShowPlayerDialog(playerid, 29999, DIALOG_STYLE_MSGBOX, "{FF0000}CHYBA","{FF0000}CHYBA: Nejste ve vozidle.","Zavřít","");
PosluchacPryc(playerid);Posluchaci[8] ++;Posloucham[playerid] = 9;PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/frekvence1-128.mp3.m3u");
return 1;
}
else if(listitem == 11){
if(!IsPlayerInAnyVehicle(playerid)) return ShowPlayerDialog(playerid, 29999, DIALOG_STYLE_MSGBOX, "{FF0000}CHYBA","{FF0000}CHYBA: Nejste ve vozidle.","Zavřít","");
PosluchacPryc(playerid);Posluchaci[9] ++;Posloucham[playerid] = 10;PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/impuls128.mp3.m3u");
return 1;
}
else if(listitem == 12){
if(!IsPlayerInAnyVehicle(playerid)) return ShowPlayerDialog(playerid, 29999, DIALOG_STYLE_MSGBOX, "{FF0000}CHYBA","{FF0000}CHYBA: Nejste ve vozidle.","Zavřít","");
PosluchacPryc(playerid);Posluchaci[10] ++;Posloucham[playerid] = 11;PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/kissmoravaov64.mp3.m3u");
return 1;
}
else if(listitem == 13){
if(!IsPlayerInAnyVehicle(playerid)) return ShowPlayerDialog(playerid, 29999, DIALOG_STYLE_MSGBOX, "{FF0000}CHYBA","{FF0000}CHYBA: Nejste ve vozidle.","Zavřít","");
PosluchacPryc(playerid);Posluchaci[11] ++;Posloucham[playerid] = 12;PlayAudioStreamForPlayer(playerid, "http://ice.abradio.cz:8000/helax128.mp3.m3u");
return 1;
}
}
if(dialogid == DIALOG_VLASTNI_RADIO && response)
{
if(!IsPlayerInAnyVehicle(playerid)) return ShowPlayerDialog(playerid, 29999, DIALOG_STYLE_MSGBOX, "{FF0000}CHYBA","{FF0000}CHYBA: Nejste ve vozidle.","Zavřít","");
if(strlen(inputtext) == 0) return ShowPlayerDialog(playerid, DIALOG_VLASTNI_RADIO, DIALOG_STYLE_INPUT, "Vlastní Rádio", "Zadej název vlastní písničky nebo Rádia z Youtube nebo ze stránky.","Přehrát","Zavřít");
PlayAudioStreamForPlayer(playerid, inputtext);
format(Streamed[playerid],128,inputtext);
PosluchacPryc(playerid);
Posloucham[playerid] = 15;
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
stock PosluchacPryc(playerid)
{
switch(Posloucham[playerid]){
case 1: Posluchaci[0] --;case 2: Posluchaci[1] --;case 3: Posluchaci[2] --;case 4: Posluchaci[3] --;case 5: Posluchaci[4] --;case 6: Posluchaci[5] --;case 7: Posluchaci[6] --;case 8: Posluchaci[7] --;case 9: Posluchaci[8] --;case 10: Posluchaci[9] --;case 11: Posluchaci[10] --;case 12: Posluchaci[11] --;case 13: Posluchaci[12] --;case 14: Posluchaci[13] --;case 15: Posluchaci[14] --;
}
Posloucham[playerid] = 0;
}
////////////////////////////////////////////////////////////////////////////////
stock PoslouchamPryc(playerid)
{
switch(Posloucham[playerid]){
case 1: Posluchaci[0] --;case 2: Posluchaci[1] --;case 3: Posluchaci[2] --;case 4: Posluchaci[3] --;case 5: Posluchaci[4] --;case 6: Posluchaci[5] --;case 7: Posluchaci[6] --;case 8: Posluchaci[7] --;case 9: Posluchaci[8] --;case 10: Posluchaci[9] --;case 11: Posluchaci[10] --;case 12: Posluchaci[11] --;case 13: Posluchaci[12] --;case 14: Posluchaci[13] --;case 15: Posluchaci[14] --;
}
}
////////////////////////////////////////////////////////////////////////////////
public ShowPlayerCoPoslouchaji(playerid)
{
new String1[256],String2[100];
format(String1,256,"{FF0000}Nick\t\t\tURL\n");
for(new i; i < MAX_PLAYERS_EX;i++){
if(Posloucham == 15){
format(String2,100,"%s\t\t\t%s\n",Jmeno(i),Streamed);
format(String1,256,"%s%s",String1,String2);
}
}
ShowPlayerDialog(playerid,DIALOG_OSTATNI_POSLOUCHAJI,DIALOG_STYLE_LIST,"{FFFFFF}Seznam MP3 co poslouchají ostatní:",String1,"Přehrát","Zavřít");
}
////////////////////////////////////////////////////////////////////////////////
stock Jmeno(playerid)
{
new j[24];
GetPlayerName(playerid,j,24);
return j;
}
A Errory
C:\Users\Kvakal\Documents\GTA San Andreas User Files\samp03e_svr_win32\pawno\include\youtube.inc(28) : error 017: undefined symbol "PlayAudioStreamForPlayer"
C:\Users\Kvakal\Documents\GTA San Andreas User Files\samp03e_svr_win32\gamemodes\Untitled.pwn(161) : error 017: undefined symbol "dcmd"
C:\Users\Kvakal\Documents\GTA San Andreas User Files\samp03e_svr_win32\gamemodes\Untitled.pwn(162) : error 017: undefined symbol "dcmd"
C:\Users\Kvakal\Documents\GTA San Andreas User Files\samp03e_svr_win32\gamemodes\Untitled.pwn(179) : error 017: undefined symbol "Posloucham"
C:\Users\Kvakal\Documents\GTA San Andreas User Files\samp03e_svr_win32\gamemodes\Untitled.pwn(179) : error 029: invalid expression, assumed zero
C:\Users\Kvakal\Documents\GTA San Andreas User Files\samp03e_svr_win32\gamemodes\Untitled.pwn(179) : error 029: invalid expression, assumed zero
C:\Users\Kvakal\Documents\GTA San Andreas User Files\samp03e_svr_win32\gamemodes\Untitled.pwn(179) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
7 Errors.