SA-MP Forums Archive
[Ajuda] AudioStream nгo salva ao entrar carro - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] AudioStream nгo salva ao entrar carro (/showthread.php?tid=659292)



AudioStream nгo salva ao entrar carro - B4z3ll - 29.09.2018

Fala meu amigos, tudo blz?

Entгo, estou com um problema no meu sistema. Criei um sistema de colocar som dentro do veнculo, ele pega tudo certo aparentemente, mas quando o player sai do veнculo e entra novamente, nгo foi salvo a Url e nгo volta para ele.

Obs: Jб tentei colocar ele na base do sistema de carros(CarInfo), porйm ele buga, nгo pega em todos, jб nesta forma pega.

Vou colocar todo o Sistema cуdigo do Sistema.

Code:
new radioTesteOn[MAX_VEHICLES] = 0;
enum radio_info
{
    vehURL[128 char],
}
new radioTeste[MAX_VEHICLES][radio_info];

//OnPlayerState
	if (newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
	{
        new vehicleid = GetPlayerVehicleID(playerid);
	    if (IsEngineVehicle(vehicleid) && radioTesteOn[vehicleid])
	    {
	        static
	            url[128];

			strunpack(url, radioTeste[vehicleid][vehURL]);

			StopAudioStreamForPlayer(playerid);

			PlayAudioStreamForPlayer(playerid, url);

			PlayerInfo[playerid][pPlayRadio] = 1;
		}
    }

//Apуs colocar a URL no dialog, й este comando. Ele funciona normal.

stock SetVehicleRadio(vehicleid, url[])
{
	if (IsValidVehicle(vehicleid) && IsEngineVehicle(vehicleid))
	{
        radioTesteOn[vehicleid] = 1;
        strpack(radioTeste[vehicleid][vehURL], url, 128 char);

        for(new i = 0; i < MAX_PLAYERS; i++)
		{
			if (IsPlayerInVehicle(i, vehicleid))
			{
			    PlayerInfo[i][pPlayRadio] = 1;

			    StopAudioStreamForPlayer(i);
				PlayAudioStreamForPlayer(i, url);
            }
        }
	}
	return 1;
}



Re: AudioStream nгo salva ao entrar carro - WeslleySSGames - 29.09.2018

Em off
Este й aquele sistema que o sistema de rбdio aparece com animaзгo dentro do veнculo?


Re: AudioStream nгo salva ao entrar carro - B4z3ll - 29.09.2018

Isso.

Ele usa o comando e seta uma Url dentro do veнculo, e todos que estгo ou entrarem ouvem.