SA-MP Forums Archive
Radio - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Radio (/showthread.php?tid=339416)



Radio - Dan_Barocu - 03.05.2012

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

PHP код:
/*
*/
#include <a_samp>
#define C_VERZUI        "{ACFF05}"
public OnFilterScriptInit()
{
    return 
1;
}
public 
OnFilterScriptExit()
{
    return 
1;
}
main(){}
public 
OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
newstate == PLAYER_STATE_ONFOOT)
    {
        
StopAudioStreamForPlayer(playerid);
    }
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    new 
cmd[128], id;
     
cmd strtok(cmdtextid);
     if (
strcmp(cmd"/muzica"true) == 0)
    {
        if(
IsPlayerInAnyVehicle(playerid) == && GetPlayerVehicleSeat(playerid) == 0)
        {
              new 
tmp[128], vehid;
            
tmp strtok(cmdtextid);
               if(
strlen(tmp) == 0) return SendClientMessage(playerid0xFF330000"USAGE: /muzica opreste, /muzica on");
               else if(
strcmp(tmp"opreste"true) == 0)
            {
                
vehid GetPlayerVehicleID(playerid);
                for(new 
ii<MAX_PLAYERSi++)
                {
                    if(
IsPlayerInVehicle(ivehid))
                    {
                        
StopAudioStreamForPlayer(i);
                    }
                       }
                return 
1;
            }
            else if(
strcmp(tmp"on"true) == 0)
            {
                
ShowPlayerDialog(playerid9998DIALOG_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(playerid0xFF330000"USAGE: /muzica opreste, /muzica on");
            return 
1;
        }
        else
        {
            
SendClientMessage(playerid0xFF330000"SERVER: Trebuie sa fiti la Volan pentru a porni Radio!");
            return 
1;
        }
    }
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
    {
    if(!
response) return StopAudioStreamForPlayer(playerid);
     switch(
dialogid)
    {
    case 
9998:
    {
     switch(
listitem)
    {
    case 
0:
    {
    new 
vehid GetPlayerVehicleID(playerid);
    for(new 
0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehid))
    {
    
PlayAudioStreamForPlayer(i"http://stream.profm.ro:8012/profm.mp3");
    
SendClientMessage(i0xFF330000"{ACFF05}Ascultati Radio Live: Pro Fm");
    }
    }
    return 
1;
    }
    case 
1:
    {
    new 
vehid GetPlayerVehicleID(playerid);
    for(new 
0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehid))
    {
    
PlayAudioStreamForPlayer(i"http://86.127.81.176:8000/live");
    
SendClientMessage(i0xFF330000"{ACFF05}Ascultati Radio Live: Ring Fm ");
    }
    }
    return 
1;
    }
    case 
2:
    {
    new 
vehid GetPlayerVehicleID(playerid);
    for(new 
0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehid))
    {
    
PlayAudioStreamForPlayer(i"http://stream2.srr.ro:8000/");
    
SendClientMessage(i0xFF330000"{ACFF05}Ascultati Radio Live: Actualitati ");
    }
    }
    return 
1;
    }
    case 
3:
    {
    new 
vehid GetPlayerVehicleID(playerid);
    for(new 
0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehid))
    {
    
PlayAudioStreamForPlayer(i"http://stream.profm.ro:8092/90s.mp3");
    
SendClientMessage(i0xFF330000"{ACFF05}Ascultati Radio Live: Muzica 90s  ");
    }
    }
    return 
1;
    }
    case 
4:
    {
    new 
vehid GetPlayerVehicleID(playerid);
    for(new 
0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehid))
    {
    
PlayAudioStreamForPlayer(i"http://ronix-live.rph.ro:8100/");
    
SendClientMessage(i0xFF330000"{ACFF05}Ascultati Radio Live: Prahova");
    }
    }
    return 
1;
    }
    case 
5:
    {
    new 
vehid GetPlayerVehicleID(playerid);
    for(new 
0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehid))
    {
    
PlayAudioStreamForPlayer(i"http://stream.profm.ro:8122/80s.mp3");
    
SendClientMessage(i0xFF330000"{ACFF05}Ascultati Radio Live: Muzica 80s ");
    }
    }
    return 
1;
    }
    case 
6:
    {
    new 
vehid GetPlayerVehicleID(playerid);
    for(new 
0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehid))
    {
    
PlayAudioStreamForPlayer(i"http://82.77.45.227:8000");
    
SendClientMessage(i0xFF330000"{ACFF05}Ascultati Radio Live: Brasov ");
    }
    }
    return 
1;
    }
    case 
7:
    {
    new 
vehid GetPlayerVehicleID(playerid);
    for(new 
0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehid))
    {
    
PlayAudioStreamForPlayer(i"http://86.35.4.198:8006/");
    
SendClientMessage(i0xFF330000"{ACFF05}Ascultati Radio Live: Cluj ");
    }
    }
    return 
1;
    }
    case 
8:
    {
    new 
vehid GetPlayerVehicleID(playerid);
    for(new 
0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehid))
    {
    
PlayAudioStreamForPlayer(i"http://95.76.53.191:8001/");
    
SendClientMessage(i0xFF330000"{ACFF05}Ascultati Radio Live: Braila  ");
    }
    }
    return 
1;
    }
    case 
9:
    {
    new 
vehid GetPlayerVehicleID(playerid);
    for(new 
0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehid))
    {
    
PlayAudioStreamForPlayer(i"http://85.120.237.64:8000/");
    
SendClientMessage(i0xFF330000"{ACFF05}Ascultati Radio Live: Galati  ");
    }
    }
    return 
1;
    }
    case 
10:
    {
    new 
vehid GetPlayerVehicleID(playerid);
    for(new 
0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehid))
    {
    
PlayAudioStreamForPlayer(i"http://89.238.227.6:8032/");
    
SendClientMessage(i0xFF330000"{ACFF05}Ascultati Radio Live: Bucuresti");
    }
    }
    return 
1;
    }
    case 
11:
    {
    new 
vehid GetPlayerVehicleID(playerid);
    for(new 
0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehid))
    {
    
PlayAudioStreamForPlayer(i"http://asculta.radiotaraf.com:7100/");
    
SendClientMessage(i0xFF330000"{ACFF05}Ascultati Radio Live: Taraf");
    }
    }
    return 
1;
    }
    case 
12:
    {
    new 
vehid GetPlayerVehicleID(playerid);
    for(new 
0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehid))
    {
    
PlayAudioStreamForPlayer(i"http://asculta.radiovenus.ro:8100/");
    
SendClientMessage(i0xFF330000"{ACFF05}Ascultati Radio Live: Venus");
    }
    }
    return 
1;
    }
    case 
13:
    {
    new 
vehid GetPlayerVehicleID(playerid);
    for(new 
0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehid))
    {
    
PlayAudioStreamForPlayer(i"http://stream.profm.ro:8072/love.mp3");
    
SendClientMessage(i0xFF330000"{ACFF05}Ascultati Radio Live: ProFm Love");
    }
    }
    return 
1;
    }
    case 
14:
    {
    new 
vehid GetPlayerVehicleID(playerid);
    for(new 
0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehid))
    {
    
PlayAudioStreamForPlayer(i"http://hit-radio.no-ip.org:8374/");
    
SendClientMessage(i0xFF330000"{ACFF05}Ascultati Radio Live: Hit");
    }
    }
    return 
1;
    }
    case 
15:
    {
    new 
vehid GetPlayerVehicleID(playerid);
    for(new 
0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehid))
    {
    
PlayAudioStreamForPlayer(i"http://live.radioconstanta.ro:9002/");
    
SendClientMessage(i0xFF330000"{ACFF05}Ascultati Radio Live: Constanta ");
    }
    }
    return 
1;
    }
    case 
16:
    {
    new 
vehid GetPlayerVehicleID(playerid);
    for(new 
0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehid))
    {
    
PlayAudioStreamForPlayer(i"http://live.ardeleanulfm.ro:8000/live128");
    
SendClientMessage(i0xFF330000"{ACFF05}Ascultati Radio Live: Alba Iulia");
    }
    }
    return 
1;
    }
    case 
17:
    {
    new 
vehid GetPlayerVehicleID(playerid);
    for(new 
0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehid))
    {
    
PlayAudioStreamForPlayer(i"http://94.23.232.141:8070/");
    
SendClientMessage(i0xFF330000"{ACFF05}Ascultati Radio Live: Muzica Populara");
    }
    }
    return 
1;
    }
    case 
18:
    {
    new 
vehid GetPlayerVehicleID(playerid);
    for(new 
0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehid))
    {
    
PlayAudioStreamForPlayer(i"http://www.texfm.ro:8000/house");
    
SendClientMessage(i0xFF330000"{ACFF05}Ascultati Radio Live: Muzica House ");
    }
    }
    return 
1;
    }
    case 
19:
    {
    new 
vehid GetPlayerVehicleID(playerid);
    for(new 
0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehid))
    {
    
PlayAudioStreamForPlayer(i"http://radiohit-dance.no-ip.org:8888/");
    
SendClientMessage(i0xFF330000"{ACFF05}Ascultati Radio Live: Muzica Dance  ");
    }
    }
    return 
1;
    }
    case 
20:
    {
    new 
vehid GetPlayerVehicleID(playerid);
    for(new 
0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehid))
    {
    
PlayAudioStreamForPlayer(i"http://stream.profm.ro:8262/kids.mp3");
    
SendClientMessage(i0xFF330000"{ACFF05}Ascultati Radio Live: Muzica Copii  ");
    }
    }
    return 
1;
    }
    case 
21:
    {
    new 
vehid GetPlayerVehicleID(playerid);
    for(new 
0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehid))
    {
    
PlayAudioStreamForPlayer(i"http://radiobluesky.net:8200/");
    
SendClientMessage(i0xFF330000"{ACFF05}Ascultati Radio Live: Blue Sky Fm ");
    }
    }
    return 
1;
    }
    case 
22:
    {
    new 
vehid GetPlayerVehicleID(playerid);
    for(new 
0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehid))
    {
    
PlayAudioStreamForPlayer(i"http://stream.radio.ubbcluj.ro:8000/ubb.mp3");
    
SendClientMessage(i0xFF330000"{ACFF05}Ascultati Radio Live: UBB Radio ");
    }
    }
    return 
1;
    }
    case 
23:
    {
    new 
vehid GetPlayerVehicleID(playerid);
    for(new 
0i<MAX_PLAYERSi++)
    {
    if(
IsPlayerInVehicle(ivehid))
    {
    
PlayAudioStreamForPlayer(i"http://stream.profm.ro:8242/profmro.mp3");
    
SendClientMessage(i0xFF330000"{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;




Re: Radio - $$inSane - 03.05.2012

Код:
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(32) : error 017: undefined symbol "strtok"
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(32) : error 033: array must be indexed (variable "cmd")
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(39) : error 017: undefined symbol "strtok"
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(39) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(40) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(51) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(54) : warning 217: loose indentation
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(58) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(60) : warning 217: loose indentation
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(63) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(66) : warning 217: loose indentation
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(66) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(69) : warning 217: loose indentation
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(69) : error 029: invalid expression, assumed zero
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(69) : error 004: function "OnDialogResponse" is not implemented
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(70) : warning 217: loose indentation
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(71) : error 017: undefined symbol "response"
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(71) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(72) : error 017: undefined symbol "dialogid"
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(76) : error 017: undefined symbol "listitem"
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(89) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(102) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(115) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(128) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(141) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(154) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(167) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(180) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(193) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(206) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\KSS\Desktop\SAMP\gamemodes\music.pwn(219) : error 079: inconsistent return types (array & non-array)

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
The whole script is wrong or badly done.


Re: Radio - bashar0151 - 03.05.2012

why dont you use this code i use http://pastebin.com/Dh2RSwnC


Re: Radio - Dan_Barocu - 04.05.2012

why dont i get errors?i get no errors can someone help me if i click on opreste i get server closed connection..its fs.


Re: Radio - Dan_Barocu - 05.05.2012

anyone help?


Re: Radio - TzAkS. - 05.05.2012

Maybe you have in gamemode one dialog with that id,try this.
pawn Код:
/*
*/


#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 1;
     }


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;
}



Re: Radio - Dan_Barocu - 05.05.2012

Quote:
Originally Posted by TzAkS.
Посмотреть сообщение
Maybe you have in gamemode one dialog with that id,try this.
pawn Код:
/*
*/


#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 1;
     }


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;
}
no work..i have nothing in gamemode with 9998..still same