SA-MP Forums Archive
Small Radio System Problem. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Small Radio System Problem. (/showthread.php?tid=647111)



Small Radio System Problem. - Trevor19012 - 29.12.2017

Hello!

For my current radio system I am building I am allowing the use of custom URL's into it. However the links do not work and I have a feeling it is a problem with my current code. I created a basic custom radio command that plays custom URL's and the same link worked there, but it does not work on a Input Dialog.
Any help of course is appreciated!!

pawn Код:
if(dialogid == RADIOMENU+1 && response)
    {
        new link[300];
        strcat(link, inputtext);
        PlayAudioStreamForPlayer(playerid, link);
        return 1;
     }



Re: Small Radio System Problem. - JaKe Elite - 29.12.2017

Why do you use strcat? You could have just directly use the inputtext parameter over the PlayAudioStreamForPlayer function


Re: Small Radio System Problem. - sheenidgs - 29.12.2017

Quote:
Originally Posted by Trevor19012
Посмотреть сообщение
Hello!

For my current radio system I am building I am allowing the use of custom URL's into it. However the links do not work and I have a feeling it is a problem with my current code. I created a basic custom radio command that plays custom URL's and the same link worked there, but it does not work on a Input Dialog.
Any help of course is appreciated!!

pawn Код:
if(dialogid == RADIOMENU+1 && response)
    {
        new link[300];
        strcat(link, inputtext);
        PlayAudioStreamForPlayer(playerid, link);
        return 1;
     }
I've looked up on Wiki and see the example. What link do you trying input?
https://sampwiki.blast.hk/wiki/PlayAudioStreamForPlayer


Re: Small Radio System Problem. - Trevor19012 - 30.12.2017

Quote:
Originally Posted by JaKe Elite
Посмотреть сообщение
Why do you use strcat? You could have just directly use the inputtext parameter over the PlayAudioStreamForPlayer function
I did that originally and it didn't work, so I assumed I messed up with inputtext.


Re: Small Radio System Problem. - Trevor19012 - 30.12.2017

Quote:
Originally Posted by sheenidgs
Посмотреть сообщение
I've looked up on Wiki and see the example. What link do you trying input?
https://sampwiki.blast.hk/wiki/PlayAudioStreamForPlayer
With all due respect. I know how to use this function. I appreciate you trying to help, but the link I have put in to this function works on a test command for custom URL's, just not in the input dialog.


Re: Small Radio System Problem. - sheenidgs - 30.12.2017

Quote:
Originally Posted by Trevor19012
Посмотреть сообщение
With all due respect. I know how to use this function. I appreciate you trying to help, but the link I have put in to this function works on a test command for custom URL's, just not in the input dialog.
Have you ever try to debug the inputtext variable with SendClientMessage or printf? Just make sure what is actually value in inputtext.


Re: Small Radio System Problem. - Daniielk - 30.12.2017

I'm not 100% sure it works
PHP код:
if(dialogid == RADIOMENU+&& response)
    {
        new 
link[32];
        
format(link,32,"%s",inputtext);
        
PlayAudioStreamForPlayer(playeridlink);
        return 
1;
     } 



Re: Small Radio System Problem. - Zeth - 30.12.2017

By the way check if there is any '%' sign in link, it may crash the dialogs and hence the audio won't stream.


Re: Small Radio System Problem. - Trevor19012 - 30.12.2017

Quote:
Originally Posted by Daniielk
Посмотреть сообщение
I'm not 100% sure it works
PHP код:
if(dialogid == RADIOMENU+&& response)
    {
        new 
link[32];
        
format(link,32,"%s",inputtext);
        
PlayAudioStreamForPlayer(playeridlink);
        return 
1;
     } 
Did not work, thanks though.


Re: Small Radio System Problem. - Trevor19012 - 30.12.2017

Quote:
Originally Posted by sheenidgs
Посмотреть сообщение
Have you ever try to debug the inputtext variable with SendClientMessage or printf? Just make sure what is actually value in inputtext.
May be on to something here. I just did that and it didn't return anything in SendClientMessage.