AudioStream listem random ?
#1

Queria hacer una emisora, la cual elegis una y empiezan a correr los temas, osea que no se esuche solo uno que se termine uno y que comienze el sigiente y asi random :P

Esto es lo que hize.

pawn Код:
CMD:emisora(playerid, params[])
{
    if(!IsPlayerInAnyVehicle(playerid) || GetPlayerState(playerid) != PLAYER_STATE_DRIVER){
        return SendClientMessageEx(playerid, COLOR_GRAD2, "Necesitas estar en un vehiculo y ser el conductor.");
    }
    else if(isnull(params)){
        SendClientMessageEx(playerid, COLOR_GRAD2, "{ffff00}Emisoras disponibles:");
        SendClientMessageEx(playerid, COLOR_GRAD2, "{ffff00}Emisora 1: {ffffff}Electronica FM");
        return 1;
    }
    new string[84], station[64, randomize;
    switch(strval(params)){
        case 0:{
            format(string, sizeof(string), "%s apaga la radio del vehiculo.",GetPlayerNameEx(playerid));
            foreach(Player, i) if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
            {
                StopAudioStreamForPlayer(playerid);
                estacionp[i] = 0;
                estacionveh[GetPlayerVehicleID(playerid)] = 0;
            }
        }
        case 1:{
            format(string, sizeof(string), "%s cambia la emisora a Electronica FM.",GetPlayerNameEx(playerid));
            randomize = random(sizeof(Electronica));
            estacionveh[GetPlayerVehicleID(playerid)] = 1;
        }
        default: return SendClientMessageEx(playerid, COLOR_GRAD2, "Estб estaciуn es invбlida.");
    }
    ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    foreach(Player, i) if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
    {
        StopAudioStreamForPlayer(playerid);
        estacionp[i] = PlayAudioStreamForPlayer(playerid, station, 1, 1, 1, 1, 0);
    }
    return 1;
}

pawn Код:
new Float:Electronica[2][2] = {
        {www.zonaroja.com.nu/radio/sebastian%20ingrosso%20&%20alesso%20feat%20ryan%20tedder%20-%20calling%20(lose%20my%20mind)%20(radio%20edit).mp3},
        {www.zonaroja.com.nu/radio/will.i.am%20-%20Scream%20&%20Shout%20ft.%20Britney%20Spears.mp3}
};
(Solo son 2 temas xD, estaba probando aver si funciona y no funciono ):


Errores

pawn Код:
(537) : error 001: expected token: ";", but found "."
(539) : error 010: invalid function or declaration
(42720) : error 001: expected token: "]", but found ","
(42733) : warning 204: symbol is assigned a value that is never used: "randomize"
(53328) : warning 203: symbol is never used: "Electronica"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
Que esta mal?
Reply


Messages In This Thread
AudioStream listem random ? - by Jejox - 16.12.2013, 21:08
Respuesta: AudioStream listem random ? - by OTACON - 16.12.2013, 21:29
Respuesta: AudioStream listem random ? - by Jejox - 16.12.2013, 22:31
Respuesta: AudioStream listem random ? - by OTACON - 17.12.2013, 16:57
Respuesta: AudioStream listem random ? - by EduGTA - 17.12.2013, 17:30

Forum Jump:


Users browsing this thread: 1 Guest(s)