Small Radio System Problem.
#1

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;
     }
Reply
#2

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

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
Reply
#4

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.
Reply
#5

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.
Reply
#6

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.
Reply
#7

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

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

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.
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)