Jump to content

Question

Posted

Nick:Colonelul

Problema:Am un sistem de Radio.Cand apesi pe y inafara sau inauntru masini se deschide o casuta de dialog cu mai multe radiouri.Ma rog selectezi aoclo ce vr sa asculti!Eu as dori ca radioul sa mearga doar cand esti intr-o masina adica cand apesi pe y inafara masini sa iti zica ca nu esti intr-o masina si cand iesi din amsina sa se opreasca muzica!

Erori / warnings:-

Lini/script:--

Ai incercat sa rezolvi singur ?:Nu pentru ca nu stiu unde sa gasesc acest radio adica linia cu apasatu pe y!

11 answers to this question

Recommended Posts

Posted

pai dupa cum vezi nu stiu unde se afla!

@edit:

if(dialogid == 9991)
		{
		    new cpid = GetPlayerVehicleID(playerid);
		    if(!response)
		    {
		        SendClientMessage(playerid, COLOR_GREY, "Ai inchis radioul.");
		        foreach(Player, i)
		        {
		            if(GetPlayerVehicleID(i) == cpid)
		            {
		        		StopAudioStreamForPlayer(i);
		        		Listening[i] = false;
					}
				}
		        return 1;
			}
			switch(listitem)
			{
			    case 0:
			    {
			        foreach(Player, i)
		        	{
        		 		if(GetPlayerVehicleID(i) == cpid)
		            	{
		        			PlayAudioStreamForPlayer(i, "http://variousfm.listen2myradio.com/");
		        			Listening[i] = true;
						}
					}
			    }
			    case 1:
			    {
			        foreach(Player, i)
		        	{
        		 		if(GetPlayerVehicleID(i) == cpid)
		            	{
		        			PlayAudioStreamForPlayer(i, "http://radio-hosting.hostpl.eu:8002/listen.pls");
		        			Listening[i] = true;
						}
					}
			    }
			    case 2:
			    {
			        foreach(Player, i)
		        	{
        		 		if(GetPlayerVehicleID(i) == cpid)
		            	{
		        			PlayAudioStreamForPlayer(i, "http://stream.profm.ro:8012/profm.mp3");
		        			Listening[i] = true;
						}
					}
			    }
			    case 3:
			    {
			        foreach(Player, i)
		        	{
        		 		if(GetPlayerVehicleID(i) == cpid)
		            	{
		        			PlayAudioStreamForPlayer(i, "http://www.radiozu.ro/live.m3u");
		        			Listening[i] = true;
						}
					}
			    }
			    case 4:
			    {
			        foreach(Player, i)
		        	{
        		 		if(GetPlayerVehicleID(i) == cpid)
		            	{
		        			PlayAudioStreamForPlayer(i, "http://www.dibiradio.ro/asculta.pls");
		        			Listening[i] = true;
						}
					}
			    }
			    case 5:
			    {
			        foreach(Player, i)
		        	{
        		 		if(GetPlayerVehicleID(i) == cpid)
		            	{
		        			PlayAudioStreamForPlayer(i, "http://stream.profm.ro:8142/rock.mp3");
		        			Listening[i] = true;
						}
					}
			    }
				case 6:
				{
				    foreach(Player, i)
				    {
				        if(GetPlayerVehicleID(i) == cpid)
				        {
				            PlayAudioStreamForPlayer(i, "http://80.86.106.136:8000/listen.pls");
				            Listening[i] = true;
						}
					}
				}
			}
		}
		return 1;
}
Asta e tot ce am gasit //edit:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
   SendClientMessage(playerid,0x9ACD32AA , "{FFFFFF}Apasa pe Tasta 2 sau scrie/engine pentru a porni/opri motorul");
   SendClientMessage(playerid,0x9ACD32AA , "{FFFFFF}Apasa pe Y pentru a asculta Radio Online.");

	if(VehLocked[vehicleid] == 1)
	{
    	if(IsABike(vehicleid))
    	{
    	    ClearAnimations(playerid);
    	}
    	if(vehicleid > PreVehicle)
    	{
    	    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
			SetVehicleParamsEx(vehicleid,engine,lights,alarm,1,bonnet,boot,objective);
    	    new esofer=0;
    	    for(new o=0;o<=MAX_PLAYERS;o++)
    	    {
				if(IsPlayerInVehicle(o, vehicleid) && GetPlayerState(o) == PLAYER_STATE_DRIVER)
				{
		    	    esofer =1;
					o=501;
				}
			}
			if(esofer==0 && alarmon[vehicleid] == 0 && PlayerData[playerid][pPcarkey]+ PreVehicle != vehicleid && PlayerData[playerid][pPcarkey2] + PreVehicle != vehicleid && PlayerData[playerid][pPcarkey3] + PreVehicle != vehicleid)
			{
					GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
		     		SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
		     		alarmon[vehicleid] = 1;
		     		SetTimerEx("DestroyAlarm", 15000, false, "i", vehicleid);
			}
    	}
	}

Uite crec ca asta este de folos!

Posted

Cauta [pawn]if(PRESSED(KEY_YES))[/pawn], asta este conditia cand apesi tasta Y, dupa dedesupt pui asta [pawn]if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER)[/pawn], adica script'ul tau treb sa arate ceva in genu

[pawn]if(PRESSED(KEY_YES))

{

    if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER || GetPlayerState(playerid)==PLAYER_STATE_PASSENGER)

  {

          Aici pui ce ai tu la comanda respectiva cand iti porneste radio

  }

  else

  {

        SendClientMessage(playerid,0xFFFFFFFF, "Trebuie sa fi in masina ca sa pornesti radio");

  }

}

[/pawn]

sper ca ti-am fost de ajutor si ai inteles :D, daca nu ai inteles spune ce ;)

Posted

Pai stai ca nu am inteles!Tu ai deja pe tasta Y si vrei sa iti mearga doar cand esti in masina sau nu ai nici pe tasta Y?

Posted
if(newkeys == KEY_YES)
    {
	ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_LIST, "Lista de Radio", "Radio ViP\nRadio MaFia\nRadio HoT StYle\nRadio Bandit\nRadio Gangsta\nRadio HitFM\nRadio TuBe[DubStep]\nRadio Pro FM House\nRadio Mynele\nRadio Pro FM\nRadio Greu De Difuzat\nRadio HiT FM -Dance\nRadio Traditional Hip-Hop\nRadio Wish \nRadio Popular\nRadio Party Romania\nRadio DiZ\nRadio Club Mix", "Asculta ", "Anuleaza");
    }

	if ((newkeys==KEY_SECONDARY_ATTACK))
    {
     if(IsPlayerConnected(playerid))
		{
			for(new i = 0; i <  housess; i++)
			{
				if (PlayerToPoint(3, playerid,HouseData[i][hExitx], HouseData[i][hExity], HouseData[i][hExitz]) && InHouse[playerid] == i)
				{
					SetPlayerInterior(playerid,0);
					SetPlayerPos(playerid,HouseData[i][hEntrancex],HouseData[i][hEntrancey],HouseData[i][hEntrancez]);
					PlayerData[playerid][pInt] = 0;
					PlayerData[playerid][pLocal] = 255;
					SetPlayerVirtualWorld(playerid,0);
					InHouse[playerid] = 0;
					if(HouseData[i][hHel] == 1)
					{
						new Float:tempheal;
						GetPlayerHealth(playerid,tempheal);
						if(tempheal < 100.0)
						{
							SetPlayerHealth(playerid,100.0);
						}
					}
					return 1;
				}
			}

Posted
if(newkeys == KEY_YES)
{
	if(!(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "Trebuie sa fii intr-un vehicul");
	ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_LIST, "Lista de Radio", "Radio ViP\nRadio MaFia\nRadio HoT StYle\nRadio Bandit\nRadio Gangsta\nRadio HitFM\nRadio TuBe[DubStep]\nRadio Pro FM House\nRadio Mynele\nRadio Pro FM\nRadio Greu De Difuzat\nRadio HiT FM -Dance\nRadio Traditional Hip-Hop\nRadio Wish \nRadio Popular\nRadio Party Romania\nRadio DiZ\nRadio Club Mix", "Asculta ", "Anuleaza");
}

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Posted

La OnPlayerStateChange adaugi:

if(newstate == PLAYER_STATE_ONFOOT)
{
	StopAudioStreamForPlayer(playerid);
}

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.