Audio for players in virtual world
#1

Hello .
I coded an audio streaming code, but i guess it plays the music for everyone, and i want to play it for those, who are in virtual world 3. Any suggestions?
PHP код:
CMD:playmusicl(playeridparams[])
 {
    if(
GetPlayerVirtualWorld(playerid) == 3) return SendClientMessage(playerid, -1"Ure not in virtual world 3!");
    if(
isnull(params)) return SendClientMessage(playerid, -1"Ievadi: /playmusicl (url)");
    foreach(
Playeri)
    {
    
PlayAudioStreamForPlayer(iparams);
    }
    return 
1;
 } 
Reply
#2

PHP код:
CMD:playmusicl(playeridparams[])
{
    if(
GetPlayerVirtualWorld(playerid) == 3) return SendClientMessage(playerid, -1"Ure not in virtual world 3!");
    if(
isnull(params)) return SendClientMessage(playerid, -1"Ievadi: /playmusicl (url)");
    foreach(
Playeri)
    {
        if(
GetPlayerVirtualWorld(i) == 3)
        {
            
//Looping all online players, if player is VW == 3, PlayAudioStream....
            
PlayAudioStreamForPlayer(iparams);
        }
    }
    return 
1;

Reply
#3

pawn Код:
CMD:playmusicl(playerid, params[])
{
    if(isnull(params))
        return SendClientMessage(playerid, -1, "Ievadi: /playmusicl (url)");

    foreach(Player, i)
    {
        if(GetPlayerVirtualWorld(i) == 3)
        {
            PlayAudioStreamForPlayer(i, params);
        }
    }
    return 1;
}
Reply
#4

Quote:
Originally Posted by Sabur
Посмотреть сообщение
pawn Код:
CMD:playmusicl(playerid, params[])
{
    if(isnull(params))
        return SendClientMessage(playerid, -1, "Ievadi: /playmusicl (url)");

    foreach(Player, i)
    {
        if(GetPlayerVirtualWorld(i) == 3)
        {
            PlayAudioStreamForPlayer(i, params);
        }
    }
    return 1;
}
Ty.
Your method worked, but itk why David's method aint working
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)