Jump to content
  • 0

pomoc help radio


newshift

Dotaz

muže někdo poradit proč nejde ? dam newradio a a kliknu na evropu 2 a nic neukaže to ani že na serveru je radio by newshift


 

#include <a_samp>


#define zelena 0x22FF00FF

#if defined FILTERSCRIPT

 

public OnFilterScriptInit()

{

    print("\n--------------------------------------");

    print(" Radio System is starting ..");

    print(" Radio system has started.");

    print("--------------------------------------\n");

    return 1;

}

 

public OnFilterScriptExit()

{

    print("\n--------------------------------------");

    print(" Radio System has been shut down due to a Filterscript unload/Exit.");

    print("--------------------------------------\n");

    return 1;

}

 

#else

 

main()

{

    print("\n----------------------------------");

    print(" Radio by newshift. Powered by PlayHard's Tutorials :P");

    print("----------------------------------\n");

}

 

#endif

 

 

public OnPlayerCommandText(playerid, cmdtext[])

{

    if (strcmp("/newradio", cmdtext, true, 10) == 0) //Change this one to whatever you want.

    {

        ShowPlayerDialog(playerid,90,DIALOG_STYLE_LIST,"Radio","1. Evropa2 - CZ\r\n2. EVROPA2 - SK\r\n3. Helax 93.7 CZ","Vybrat", "Zrusit");

        //We use the line above to make the Dialog show, and as you notice we want DIALOG_STYLE_LIST because it will be a list so we can choose from.

        //As you notice everytime you add \r\n it adds a new line to the list, which means in our tutorial adds a new radio station to the list.

        //Make sure you change the ID of the Dialog, we don't want it to mix with other dialogs in your server, I set it to 90.

        return 1;

    }

    if (strcmp("/vypnoutradio", cmdtext, true, 10) == 0)

    {

        StopAudioStreamForPlayer(playerid);//This is the function we need to stop the audio from streaming the music.

        return 1;

    }

    return 0;

}

 

public OnPlayerConnect(playerid)

{

SendClientMessage(playerid, 0xFFFFFFFF, "{FF7F00}[ radio ] {FFFFFF}Na serveru je radio by newshift");

return 1;

}

 

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])

{

    switch(dialogid)

    {

        case 90: //Remember the ID we changed in ShowPlayerDialog? (90) That's how the DialogResponse will get to know which Dialog it's going to use.

        {

            if(!response)// This one is used for option 2 which we changed to (Cancel).

            {

                    SendClientMessage(playerid, zelena, "vypnul si dialog.");//This one sends a message when you close the dialog using (Cancel).

                    return 1;

            }

 

            switch(listitem)//This one will list the items.

            {

 

                {

                    PlayAudioStreamForPlayer(playerid, "http://icecast3.play.cz/evropa2-128.mp3");//This function will play our desired radio. So we have to put the url between its brackets.

                    SendClientMessage(playerid, zelena, "Type /vypnoutradio pro vypnuti."); //This line sends a message to the listener that he can stop it using /stopradio.

                }

 

                {

                    PlayAudioStreamForPlayer(playerid, "http://ice2.europa2.sk/fm-europa2sk-128");//This function will play our desired radio. So we have to put the url between its brackets.

                    SendClientMessage(playerid, zelena, "Type /vypnoutradio pro vypnuti.");//This line sends a message to the listener that he can stop it using /stopradio.

                }

 

                {

                    PlayAudioStreamForPlayer(playerid, "http://ice.abradio.cz:8000/helax128.mp3");//This function will play our desired radio. So we have to put the url between its brackets.

                    SendClientMessage(playerid, zelena, "Type /vypnoutradio pro vypnuti.");//This line sends a message to the listener that he can stop it using /stopradio.

                }

                //You can continue cases here but make sure you make a new line in the ShowPlayerDialog on /myradio command \r\n4. 4th \r\n5. 5th channel etc..

            }

        }

    }

    return 1;

}

Link to comment
Share on other sites

21 odpovědí na tuto otázku

Recommended Posts

  • 0

Udělej to takto ;) >

 

 

#include <a_samp>
 
 
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid, 0xFF0000FF, "Server využívá radio systém - /radion.");
}
 
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/evropa2", true))//Evropa 2
{
    
PlayAudioStreamForPlayer(playerid, "http://icecast3.play.cz/evropa2-128.mp3.m3u");
SendClientMessage(playerid, 0xFF0000FF, "[Radio]{00FF00}Spustil si Evropu 2   ");
return 1;
}
if(!strcmp(cmdtext, "/fajnradio", true))//Fajn Radio
{
 
PlayAudioStreamForPlayer(playerid, "https://listenonline.eu/00000212.m3u");
SendClientMessage(playerid, 0xFF0000FF, "[Radio]{00FF00}Spustil si FajnRadio ");
return 1;
}
 
if(!strcmp(cmdtext, "/funradio", true))//Fun Radio
{
 
PlayAudioStreamForPlayer(playerid, "http://stream.funradio.sk:8000/fun128.mp3.m3u");
SendClientMessage(playerid, 0xFF0000FF, "[Radio]{00FF00}Spustil si FunRadio ");
return 1;
}
if(!strcmp(cmdtext, "/europa2", true))//Evropa 2 /SK
{
 
PlayAudioStreamForPlayer(playerid, "http://ice2.europa2.sk/fm-europa2sk-128");
SendClientMessage(playerid, 0xFF0000FF, "[Radio]{00FF00}Spustil si Europu 2 ");
return 1;
}
if(strcmp(cmdtext, "/radios", true) == 0)
 
if(strcmp(cmdtext, "/radioff", true) == 0) // Vypne rádio
{
   StopAudioStreamForPlayer(playerid);
   SendClientMessage(playerid, 0xFF0000FF, "[Radio]{00FF00}Vypnul jsi rádio!  ");
   return 1;
}
return 0;
}
 
 
- A jen taková "poznámka" - máš to dobře nahráno na serveru?
Edited by Tedy
Link to comment
Share on other sites

  • 0

dialog nacte ale nic dalsiho :d

du skusit to tve


public OnPlayerConnect(playerid)
{
SendClientMessage(playerid, text1, "--------------------------------------------------");
SendClientMessage(playerid, text, "Server využívá radio systém by newshift - /radios.");
SendClientMessage(playerid, text1, "--------------------------------------------------");
}
 
stale to nejde
Link to comment
Share on other sites

  • 0

 

dialog nacte ale nic dalsiho :d

du skusit to tve

public OnPlayerConnect(playerid)
{
SendClientMessage(playerid, text1, "--------------------------------------------------");
SendClientMessage(playerid, text, "Server využívá radio systém by newshift - /radios.");
SendClientMessage(playerid, text1, "--------------------------------------------------");
}
 
stale to nejde

 

Jak nejde? Jde to to normálně převést z .pwn do .amx ? + dát na server do Filterscriptů,zapíšeš v configu a restartuješ server? 

Link to comment
Share on other sites

  • 0

Lepší bude,když se to bude objevovat vždy po spawnu... Vždy jak se hráč spawne tak se mu objeví text

 

public OnPlayerRequestSpawn(playerid)

{
    SCM(playerid,  0xFFFF00FF, "Server využívá radio systém by newshift - /radios");
return 1;
}
 
 
A nebo takto : 
 
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid, 0xFF0000FF, "Server využívá radio systém by newshift - /radios.");
}
Edited by Tedy
Link to comment
Share on other sites

  • 0
#include <a_samp>

#define text 0x22FF00FF

#define text1 0xFF6600FF

 

public OnPlayerConnect(playerid)

{

SendClientMessage(playerid, text1, "--------------------------------------------------");

SendClientMessage(playerid, text, "Server využívá radio systém by newshift - /radios.");

SendClientMessage(playerid, text1, "--------------------------------------------------");

}

 

public OnPlayerCommandText(playerid, cmdtext[])

{

if(!strcmp(cmdtext, "/evropa2", true))//Evropa 2

{

 

PlayAudioStreamForPlayer(playerid, "http://icecast3.play.cz/evropa2-128.mp3");

SendClientMessage(playerid, text, "[Radio]{text1}Spustil si Evropu 2   ");

return 1;

}

if(!strcmp(cmdtext, "/fajnradio", true))//Fajn Radio

{

 

PlayAudioStreamForPlayer(playerid, "https://listenonline.eu/00000212.m3u");

SendClientMessage(playerid, text, "[Radio]{text1}Spustil si FajnRadio ");

return 1;

}

 

if(!strcmp(cmdtext, "/helax", true))//Fun Radio

{

 

PlayAudioStreamForPlayer(playerid, "http://ice.abradio.cz:8000/helax128.mp3");

SendClientMessage(playerid, text1, "[Radio]Spustil si Helax 93.7 Dance Radio ");

return 1;

}

if(!strcmp(cmdtext, "/europa2SK", true))//Evropa 2 /SK

{

 

PlayAudioStreamForPlayer(playerid, "http://ice2.europa2.sk/fm-europa2sk-128");

SendClientMessage(playerid, text1, "[Radio]Spustil si Europu 2 SK");

return 1;

}

if(strcmp(cmdtext, "/radios", true) == 0)

{

   StopAudioStreamForPlayer(playerid);

   SendClientMessage(playerid, text1, "--------------------------------------------------");

   SendClientMessage(playerid, text, "[Radio]/evropa2 !  ");

   SendClientMessage(playerid, text, "[Radio]/evropa2SK !  ");

   SendClientMessage(playerid, text, "[Radio]/helax !  ");

   SendClientMessage(playerid, text, "[Radio]/fajnradio !  ");

   SendClientMessage(playerid, text, "[Radio]Vypnuti radia /radioff !  ");

   SendClientMessage(playerid, text1, "--------------------------------------------------");

   return 1;

}

if(strcmp(cmdtext, "/radioff", true) == 0) // Vypne rádio

{

   StopAudioStreamForPlayer(playerid);

   SendClientMessage(playerid, text1, "[Radio]Vypnul jsi rádio!  ");

   return 1;

}

return 0;

}

 

hej ja se v tom neviznam :d

Link to comment
Share on other sites

  • 0
Takhle to dej ;) A bude se to zobrazovat při připojení i při každém spawnu ;)
 
#include <a_samp>
#define text 0x22FF00FF
#define text1 0xFF6600FF
 
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid, 0xFF0000FF, "Server využívá radio systém by newshift - /radios.");
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/evropa2", true))//Evropa 2
{
 
PlayAudioStreamForPlayer(playerid, "http://icecast3.play...evropa2-128.mp3");
SendClientMessage(playerid, text, "[Radio]{text1}Spustil si Evropu 2   ");
return 1;
}
if(!strcmp(cmdtext, "/fajnradio", true))//Fajn Radio
{
 
PlayAudioStreamForPlayer(playerid, "https://listenonline.eu/00000212.m3u");
SendClientMessage(playerid, text, "[Radio]{text1}Spustil si FajnRadio ");
return 1;
}
 
if(!strcmp(cmdtext, "/helax", true))//Fun Radio
{
 
PlayAudioStreamForPlayer(playerid, "http://ice.abradio.c...00/helax128.mp3");
SendClientMessage(playerid, text1, "[Radio]Spustil si Helax 93.7 Dance Radio ");
return 1;
}
if(!strcmp(cmdtext, "/europa2SK", true))//Evropa 2 /SK
{
 
PlayAudioStreamForPlayer(playerid, "http://ice2.europa2....m-europa2sk-128");
SendClientMessage(playerid, text1, "[Radio]Spustil si Europu 2 SK");
return 1;
}
if(strcmp(cmdtext, "/radios", true) == 0)
{
   StopAudioStreamForPlayer(playerid);
   SendClientMessage(playerid, text1, "--------------------------------------------------");
   SendClientMessage(playerid, text, "[Radio]/evropa2 !  ");
   SendClientMessage(playerid, text, "[Radio]/evropa2SK !  ");
   SendClientMessage(playerid, text, "[Radio]/helax !  ");
   SendClientMessage(playerid, text, "[Radio]/fajnradio !  ");
   SendClientMessage(playerid, text, "[Radio]Vypnuti radia /radioff !  ");
   SendClientMessage(playerid, text1, "--------------------------------------------------");
   return 1;
}
if(strcmp(cmdtext, "/radioff", true) == 0) // Vypne rádio
{
   StopAudioStreamForPlayer(playerid);
   SendClientMessage(playerid, text1, "[Radio]Vypnul jsi rádio!  ");
   return 1;

 

public OnPlayerRequestSpawn(playerid)

{
    SCM(playerid,  0xFFFF00FF, "Server využívá radio systém by newshift - /radios");
return 1;
}
}
return 0;
}
Link to comment
Share on other sites

  • 0
C:\Users\\Desktop\Untitled.pwn(58) : warning 225: unreachable code

C:\Users\Desktop\Untitled.pwn(58) : warning 217: loose indentation

C:\Users\\Desktop\Untitled.pwn(58) : error 029: invalid expression, assumed zero

C:\Users\\Desktop\Untitled.pwn(58) : error 004: function "OnPlayerRequestSpawn" is not implemented

C:\Users\\Desktop\Untitled.pwn(60) : error 017: undefined symbol "SCM"

C:\Users\\Desktop\Untitled.pwn(61) : warning 217: loose indentation

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

 

 

3 Errors.

Link to comment
Share on other sites

  • 0

#include <a_samp>

#define text 0x22FF00FF
#define text1 0xFF6600FF
 
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid, 0xFF0000FF, "Server využívá radio systém by newshift - /radios.");
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/evropa2", true))//Evropa 2
{
 
PlayAudioStreamForPlayer(playerid, "http://icecast3.play...evropa2-128.mp3");
SendClientMessage(playerid, text, "[Radio]{text1}Spustil si Evropu 2   ");
return 1;
}
if(!strcmp(cmdtext, "/fajnradio", true))//Fajn Radio
{
 
PlayAudioStreamForPlayer(playerid, "https://listenonline.eu/00000212.m3u");
SendClientMessage(playerid, text, "[Radio]{text1}Spustil si FajnRadio ");
return 1;
}
 
if(!strcmp(cmdtext, "/helax", true))//Fun Radio
{
 
PlayAudioStreamForPlayer(playerid, "http://ice.abradio.c...00/helax128.mp3");
SendClientMessage(playerid, text1, "[Radio]Spustil si Helax 93.7 Dance Radio ");
return 1;
}
if(!strcmp(cmdtext, "/europa2SK", true))//Evropa 2 /SK
{
 
PlayAudioStreamForPlayer(playerid, "http://ice2.europa2....m-europa2sk-128");
SendClientMessage(playerid, text1, "[Radio]Spustil si Europu 2 SK");
return 1;
}
if(strcmp(cmdtext, "/radios", true) == 0)
{
   StopAudioStreamForPlayer(playerid);
   SendClientMessage(playerid, text1, "--------------------------------------------------");
   SendClientMessage(playerid, text, "[Radio]/evropa2 !  ");
   SendClientMessage(playerid, text, "[Radio]/evropa2SK !  ");
   SendClientMessage(playerid, text, "[Radio]/helax !  ");
   SendClientMessage(playerid, text, "[Radio]/fajnradio !  ");
   SendClientMessage(playerid, text, "[Radio]Vypnuti radia /radioff !  ");
   SendClientMessage(playerid, text1, "--------------------------------------------------");
   return 1;
}
if(strcmp(cmdtext, "/radioff", true) == 0) // Vypne rádio
{
   StopAudioStreamForPlayer(playerid);
   SendClientMessage(playerid, text1, "[Radio]Vypnul jsi rádio!  ");
   return 1;

 

public OnPlayerRequestSpawn(playerid)

{
    SCM(playerid,  0xFFFF00FF, "Server využívá radio systém by newshift - /radios");
return 1;
}
 
return 0;
}
Link to comment
Share on other sites

  • 0
C:\Users\\Desktop\Untitled.pwn(58) : warning 225: unreachable code

C:\Users\\Desktop\Untitled.pwn(58) : warning 217: loose indentation

C:\Users\\Desktop\Untitled.pwn(58) : error 029: invalid expression, assumed zero

C:\Users\\Desktop\Untitled.pwn(58) : error 004: function "OnPlayerRequestSpawn" is not implemented

C:\Users\\Desktop\Untitled.pwn(60) : error 017: undefined symbol "SCM"

C:\Users\\Desktop\Untitled.pwn(61) : warning 217: loose indentation

C:\Users\\Desktop\Untitled.pwn(64) : warning 225: unreachable code

C:\Users\\Desktop\Untitled.pwn(67) : error 030: compound statement not closed at the end of file (started at line 54)

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

 

 

4 Errors.

Link to comment
Share on other sites

  • 0

Tohle funguje ;) >

 

#include <a_samp>

#define text 0x22FF00FF
#define text1 0xFF6600FF
 
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid, 0xFF0000FF, "Server využívá radio systém by newshift - /radios.");
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/evropa2", true))//Evropa 2
{
 
PlayAudioStreamForPlayer(playerid, "http://icecast3.play...evropa2-128.mp3");
SendClientMessage(playerid, text, "[Radio]{text1}Spustil si Evropu 2   ");
return 1;
}
if(!strcmp(cmdtext, "/fajnradio", true))//Fajn Radio
{
 
PlayAudioStreamForPlayer(playerid, "https://listenonline.eu/00000212.m3u");
SendClientMessage(playerid, text, "[Radio]{text1}Spustil si FajnRadio ");
return 1;
}
 
if(!strcmp(cmdtext, "/helax", true))//Fun Radio
{
 
PlayAudioStreamForPlayer(playerid, "http://ice.abradio.c...00/helax128.mp3");
SendClientMessage(playerid, text1, "[Radio]Spustil si Helax 93.7 Dance Radio ");
return 1;
}
if(!strcmp(cmdtext, "/europa2SK", true))//Evropa 2 /SK
{
 
PlayAudioStreamForPlayer(playerid, "http://ice2.europa2....m-europa2sk-128");
SendClientMessage(playerid, text1, "[Radio]Spustil si Europu 2 SK");
return 1;
}
if(strcmp(cmdtext, "/radios", true) == 0)
 
if(strcmp(cmdtext, "/radioff", true) == 0) // Vypne rádio
{
   StopAudioStreamForPlayer(playerid);
   SendClientMessage(playerid, text1, "[Radio]Vypnul jsi rádio!  ");
   return 1;
}
return 0;
}
Link to comment
Share on other sites

  • 0

Tak se pokus dát na konec toho scriptu tohle >

 

if (strcmp("/radios", cmdtext, true, 10) == 0)
{
SCM(playerid,  0xFFFF00FF,,    "---Radio by (-)---");
SCM(playerid,  0xFFFF00FF,, "/evropa2     ");
SCM(playerid,  0xFFFF00FF,, "/fajnradio     ");
SCM(playerid,  0xFFFF00FF,, "/funradio          ");
SCM(playerid,  0xFFFF00FF,, "/europa2       ");
SCM(playerid,  0xFFFF00FF,    "-----------------------");
return 1;
}
return 0;
}
public OnPlayerRequestSpawn(playerid)
{
    SCM(playerid,  0xFFFF00FF,, "Na Serveru se nachází radio BY (-)");
return 1;
}
Link to comment
Share on other sites

  • 0

jak sem to hodil na svuj server kde nemam RZE ani take mody s netu tak to nacte nemuze to byt hostingem ? ja to mam pres fakahedu a on pres free hosting

Link to comment
Share on other sites

  • 0

 

Tak se pokus dát na konec toho scriptu tohle >

 

if (strcmp("/radios", cmdtext, true, 10) == 0)
{
SCM(playerid,  0xFFFF00FF,,    "---Radio by (-)---");
SCM(playerid,  0xFFFF00FF,, "/evropa2     ");
SCM(playerid,  0xFFFF00FF,, "/fajnradio     ");
SCM(playerid,  0xFFFF00FF,, "/funradio          ");
SCM(playerid,  0xFFFF00FF,, "/europa2       ");
SCM(playerid,  0xFFFF00FF,    "-----------------------");
return 1;
}
return 0;
}
public OnPlayerRequestSpawn(playerid)
{
    SCM(playerid,  0xFFFF00FF,, "Na Serveru se nachází radio BY (-)");
return 1;
}

 

Ne,tím to nebude.. zkus tam dát ještě na konec toho scriptu tohle.. Když hráč zadá příkaz /radios tak mu vyskočí v chatu tabulka jaké jsou stanice.. 

Link to comment
Share on other sites

  • 0

n kasly na to jak dam tohle tak pawno zas hazi errory :d

dik ze si tak dlouho se mnou trpel a ukradl sem ti tolik casu zbitecne 

Nevadí .. Ale to radio ti funguje? /evropa 2 atd.. Spustí se normálně?

Link to comment
Share on other sites

  • 0

A co když tu zprávu dáš do onplayerconnect ? a když chceš že se spawne a napsalo mu to znovu tak tu zprávu dej do onplayerspawn v čem je problém ?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...