How to audiostream
#1

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?
Reply
#2

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

Reply
#3

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

Is that a command?
Reply
#5

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

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

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

Anytime
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)