SA-MP Forums Archive
How to audiostream - 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: How to audiostream (/showthread.php?tid=659223)



How to audiostream - Zeus666 - 27.09.2018

PHP код:
        ProxDetector(pInfo[playerid][pRadioFreq], playeridstringCOLOR_WHITE);
        
PlayAudioStreamForPlayer(playerid,"https://sampdayz.ro/SFX/radio.mp3"); 
how can i set instead of playerid from playaudiostream to be set for every player who has the same pradioFreq as the playerid?


Re: How to audiostream - v1k1nG - 27.09.2018

PHP код:
foreach(Playeri){
if(
pinfo[playerid][pradioFreq] == pinfo[i][pradioFreq]){
//code
}




Re: How to audiostream - Zeus666 - 27.09.2018

Quote:
Originally Posted by v1k1nG
Посмотреть сообщение
PHP код:
foreach(Playeri){
if(
pinfo[playerid][pradioFreq] == pinfo[i][pradioFreq]){
//code
}

I want the

PHP код:
PlayAudioStreamForPlayer 
to be declansated (activated) when someone (any playerid) types something on /r.


Re: How to audiostream - v1k1nG - 27.09.2018

Is that a command?


Re: How to audiostream - Zeus666 - 27.09.2018

Quote:
Originally Posted by v1k1nG
Посмотреть сообщение
Is that a command?
PHP код:
CMD:r(playerid,params[])
{
    if(
PlayerHasItem(playerid,"Radio"))
    {
        if(
isnull(params)) return SendClientMessage(playerid, -1,""chat" /r [radio chat]");
        new 
string[128];
        
format(stringsizeof(string), ""COL_YELLOW"STATIE RADIO:"COL_WHITE" %s says on the radio:  %s "PlayerName(playerid), params);
        
ProxDetector(pInfo[playerid][pRadioFreq], playeridstringCOLOR_WHITE);
        
PlayAudioStreamForPlayer(playerid,"https://sampdayz.ro/SFX/radio.mp3");
    }
    else return 
SendClientMessage(playerid,-1,""chat" You don't have radio!");
    return 
1;

Currently, playaudiosream activates only for the "playerid" but I want to be activated for everyone who has the same pRadioFreq


ex: If I write something on /r, i want the audiostream to be activated for every player who has the same pradiofreq as me


Re: How to audiostream - v1k1nG - 27.09.2018

PHP код:

CMD
:r(playerid,params[])
{
    if(
PlayerHasItem(playerid,"Radio"))
    {
        if(
isnull(params)) return SendClientMessage(playerid, -1,""chat" /r [radio chat]");
        new 
string[128];
        
format(stringsizeof(string), ""COL_YELLOW"STATIE RADIO:"COL_WHITE" %s says on the radio:  %s "PlayerName(playerid), params);
        
// ProxDetector(pInfo[playerid][pRadioFreq], playerid, string, COLOR_WHITE);
        
foreach(Playeri){
        if(
pinfo[playerid][pradioFreq] == pinfo[i][pradioFreq]){
            
SendClientMessage(i, -1string);
            
PlayAudioStreamForPlayer(i,"https://sampdayz.ro/SFX/radio.mp3");
        }
        } 
    }
    else return 
SendClientMessage(playerid,-1,""chat" You don't have radio!");
    return 
1;

You choose


Re: How to audiostream - Zeus666 - 27.09.2018

Quote:
Originally Posted by v1k1nG
Посмотреть сообщение
PHP код:

CMD
:r(playerid,params[])
{
    if(
PlayerHasItem(playerid,"Radio"))
    {
        if(
isnull(params)) return SendClientMessage(playerid, -1,""chat" /r [radio chat]");
        new 
string[128];
        
format(stringsizeof(string), ""COL_YELLOW"STATIE RADIO:"COL_WHITE" %s says on the radio:  %s "PlayerName(playerid), params);
        
// ProxDetector(pInfo[playerid][pRadioFreq], playerid, string, COLOR_WHITE);
        
foreach(Playeri){
        if(
pinfo[playerid][pradioFreq] == pinfo[i][pradioFreq]){
            
SendClientMessage(i, -1string);
            
PlayAudioStreamForPlayer(i,"https://sampdayz.ro/SFX/radio.mp3");
        }
        } 
    }
    else return 
SendClientMessage(playerid,-1,""chat" You don't have radio!");
    return 
1;

You choose

fixed. thanks


Re: How to audiostream - v1k1nG - 27.09.2018

Anytime