03.05.2012, 14:48
hi a friend gave me an fs with radio but if i click in dialog opreste then i get server closed connection.. i have no kick thing..please help!i dont want server closd connection i just want the music to stop!
opreste=close
opreste=close
PHP код:
/*
*/
#include <a_samp>
#define C_VERZUI "{ACFF05}"
public OnFilterScriptInit()
{
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
main(){}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_ONFOOT)
{
StopAudioStreamForPlayer(playerid);
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128], id;
cmd = strtok(cmdtext, id);
if (strcmp(cmd, "/muzica", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid) == 1 && GetPlayerVehicleSeat(playerid) == 0)
{
new tmp[128], vehid;
tmp = strtok(cmdtext, id);
if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFF330000, "USAGE: /muzica opreste, /muzica on");
else if(strcmp(tmp, "opreste", true) == 0)
{
vehid = GetPlayerVehicleID(playerid);
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
StopAudioStreamForPlayer(i);
}
}
return 1;
}
else if(strcmp(tmp, "on", true) == 0)
{
ShowPlayerDialog(playerid, 9998, DIALOG_STYLE_LIST, "Radio InFlame Live", "Pro Fm\nRing Fm\nActualitati\nMuzica 90s\nPrahova\nMuzica 80s\nBrasov\nCluj\nBraila\nGalati\nBucuresti\nTaraf\nVenus\nPro Fm Love\nHit\nConstanta\nAlba Iulia\nPopulara\nHouse\nDans\nMuzica Copii\nBlue Sky Fm\nUBB Radio\nMuzica Romaneasca", "Asculta","Opreste");
return 1;
}
SendClientMessage(playerid, 0xFF330000, "USAGE: /muzica opreste, /muzica on");
return 1;
}
else
{
SendClientMessage(playerid, 0xFF330000, "SERVER: Trebuie sa fiti la Volan pentru a porni Radio!");
return 1;
}
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(!response) return StopAudioStreamForPlayer(playerid);
switch(dialogid)
{
case 9998:
{
switch(listitem)
{
case 0:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://stream.profm.ro:8012/profm.mp3");
SendClientMessage(i, 0xFF330000, "{ACFF05}Ascultati Radio Live: Pro Fm");
}
}
return 1;
}
case 1:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://86.127.81.176:8000/live");
SendClientMessage(i, 0xFF330000, "{ACFF05}Ascultati Radio Live: Ring Fm ");
}
}
return 1;
}
case 2:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://stream2.srr.ro:8000/");
SendClientMessage(i, 0xFF330000, "{ACFF05}Ascultati Radio Live: Actualitati ");
}
}
return 1;
}
case 3:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://stream.profm.ro:8092/90s.mp3");
SendClientMessage(i, 0xFF330000, "{ACFF05}Ascultati Radio Live: Muzica 90s ");
}
}
return 1;
}
case 4:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://ronix-live.rph.ro:8100/");
SendClientMessage(i, 0xFF330000, "{ACFF05}Ascultati Radio Live: Prahova");
}
}
return 1;
}
case 5:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://stream.profm.ro:8122/80s.mp3");
SendClientMessage(i, 0xFF330000, "{ACFF05}Ascultati Radio Live: Muzica 80s ");
}
}
return 1;
}
case 6:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://82.77.45.227:8000");
SendClientMessage(i, 0xFF330000, "{ACFF05}Ascultati Radio Live: Brasov ");
}
}
return 1;
}
case 7:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://86.35.4.198:8006/");
SendClientMessage(i, 0xFF330000, "{ACFF05}Ascultati Radio Live: Cluj ");
}
}
return 1;
}
case 8:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://95.76.53.191:8001/");
SendClientMessage(i, 0xFF330000, "{ACFF05}Ascultati Radio Live: Braila ");
}
}
return 1;
}
case 9:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://85.120.237.64:8000/");
SendClientMessage(i, 0xFF330000, "{ACFF05}Ascultati Radio Live: Galati ");
}
}
return 1;
}
case 10:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://89.238.227.6:8032/");
SendClientMessage(i, 0xFF330000, "{ACFF05}Ascultati Radio Live: Bucuresti");
}
}
return 1;
}
case 11:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://asculta.radiotaraf.com:7100/");
SendClientMessage(i, 0xFF330000, "{ACFF05}Ascultati Radio Live: Taraf");
}
}
return 1;
}
case 12:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://asculta.radiovenus.ro:8100/");
SendClientMessage(i, 0xFF330000, "{ACFF05}Ascultati Radio Live: Venus");
}
}
return 1;
}
case 13:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://stream.profm.ro:8072/love.mp3");
SendClientMessage(i, 0xFF330000, "{ACFF05}Ascultati Radio Live: ProFm Love");
}
}
return 1;
}
case 14:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://hit-radio.no-ip.org:8374/");
SendClientMessage(i, 0xFF330000, "{ACFF05}Ascultati Radio Live: Hit");
}
}
return 1;
}
case 15:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://live.radioconstanta.ro:9002/");
SendClientMessage(i, 0xFF330000, "{ACFF05}Ascultati Radio Live: Constanta ");
}
}
return 1;
}
case 16:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://live.ardeleanulfm.ro:8000/live128");
SendClientMessage(i, 0xFF330000, "{ACFF05}Ascultati Radio Live: Alba Iulia");
}
}
return 1;
}
case 17:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://94.23.232.141:8070/");
SendClientMessage(i, 0xFF330000, "{ACFF05}Ascultati Radio Live: Muzica Populara");
}
}
return 1;
}
case 18:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://www.texfm.ro:8000/house");
SendClientMessage(i, 0xFF330000, "{ACFF05}Ascultati Radio Live: Muzica House ");
}
}
return 1;
}
case 19:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://radiohit-dance.no-ip.org:8888/");
SendClientMessage(i, 0xFF330000, "{ACFF05}Ascultati Radio Live: Muzica Dance ");
}
}
return 1;
}
case 20:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://stream.profm.ro:8262/kids.mp3");
SendClientMessage(i, 0xFF330000, "{ACFF05}Ascultati Radio Live: Muzica Copii ");
}
}
return 1;
}
case 21:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://radiobluesky.net:8200/");
SendClientMessage(i, 0xFF330000, "{ACFF05}Ascultati Radio Live: Blue Sky Fm ");
}
}
return 1;
}
case 22:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://stream.radio.ubbcluj.ro:8000/ubb.mp3");
SendClientMessage(i, 0xFF330000, "{ACFF05}Ascultati Radio Live: UBB Radio ");
}
}
return 1;
}
case 23:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://stream.profm.ro:8242/profmro.mp3");
SendClientMessage(i, 0xFF330000, "{ACFF05}Ascultati Radio Live: Muzica Romaneasca ");
}
}
return 0;
}
}
}
}
return 0;
}
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}