Szerző Téma: Rádió+kocsi  (Megtekintve 599 alkalommal)

Rádió+kocsi
« Dátum: 2012. Július 17. - 10:27:54 »
0 Show voters
Hali
Ismét hozzátok fordulok segítségért egy rádió fs miatt.
Az a gondom, hogy ha beülök egy autóba és bekapcsolom a rádiót minden szuper és megy, ha viszont kiszállok akkor kikapcsol a rádió és hiába ülök vissza a kocsiba, újra be kell kapcsolnom. Azt szeretném, hogy a rádió bármikor menjen és ki lehessen kapcsolni a dialogban.
 
#include <a_samp>
#include <zcmd>
#define COLOR_RED 0xFF0000FF
#define DIALOG_RADIO 5678
#define BotName                     \"{FF0000}Radio:\"
CMD:radio(playerid, params[])
{
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, BotName\" ERROR, you aren\'t in a vehicle\");
    ShowPlayerDialog(playerid, DIALOG_RADIO, DIALOG_STYLE_LIST, \"Online Radio\", \"Radio 1\\nDiscoShit\\nRiseFM\\nClassFM\\nNeo FM\\nKane FM\", \"Select\", \"Close\"); //This shows the dialog, notice we used DIALOG_MUSICPLAYER for the dialogid!
    return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_RADIO) // This checks to see if the dialog the players viewing is the music player one
{
          if(response) // If the player clicked a song
  {
               if(listitem == 0) // Since this is a list, we check if they clicked the first song on the list.
               {
              PlayAudioStreamForPlayer(playerid, \"http://195.70.35.172:8000/radio1.mp3.m3u\"); // Play the song
      }
               if(listitem == 1)
               {
                  PlayAudioStreamForPlayer(playerid, \"http://discoshit.hu/ds-radio.m3u\");
               }
               if(listitem == 2)
               {
                  PlayAudioStreamForPlayer(playerid, \"http://live.risefm.hu:8080/radio\");
               }
               if(listitem == 3)
               {
                  PlayAudioStreamForPlayer(playerid, \"http://87.229.103.52:7058/CLASS_FM.m3u\");
               }
               if(listitem == 4)
               {
                  PlayAudioStreamForPlayer(playerid, \"http://www.xhosting.hu/NeoFM/128_kbs_mp3.m3u\");
               }
               if(listitem == 5)
               {
                  PlayAudioStreamForPlayer(playerid, \"http://91.121.122.94:8081/\");
               }
   }
   return 1;
    }
   
   
    return 0;
}

 
Illetve még azt szeretném, hogy ha pl. lehívok egy kocsit, majd egy másikat akkor az elõzõ tûnjön el. Ezt meg lehet oldani?
Elõrre is köszi :)

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Rádió+kocsi
« Válasz #1 Dátum: 2012. Július 17. - 10:53:30 »
0 Show voters
Bíztos vagy benne 100% -ban, hogy kocsiban megyen?
 

if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, BotName\" ERROR, you aren\'t in a vehicle\");

 
Mert itt az áll, hogy kocsiban nem használható!  :)

Rádió+kocsi
« Válasz #2 Dátum: 2012. Július 17. - 12:02:42 »
0 Show voters
Nekem 100% hogy kocsiban megy meg megkértem mást is hogy nézze meg és neki is

Dupla hozzászólás automatikusan összefûzve. ( 2012. Július 17. - 23:27:43 )

Meg van oldva, zárok.
« Utoljára szerkesztve: 2012. Július 17. - 23:27:43 írta []lambo96[] »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal