All hear music.
#1

How make system, when all login in my server and they hear music in background when they play?
Reply
#2

PlayAudioStreamForPlayer(playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0) might help you.
Reply
#3

https://sampwiki.blast.hk/wiki/PlayerPlaySound .
and if you want to make it dissapear just add 1 to the sound id
EXAMPLE
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    PlayerPlaySound(playerid, 1097, -2146.9839,-90.9392,41.5966);

    return 1;
}
public OnPlayerSpawn(playerid)
{
    PlayerPlaySound(playerid, 1098, -2146.9839,-90.9392,41.5966);
       return 1;
}
Reply
#4

Thanks, but how make system, when i write the command /playmusicforall and all server people hear for example real life radio?
Reply
#5

It's easy bro.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    //---    
    if(strcmp(cmdtext, "/playmusicforall", true) == 0)
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
             PlayAudioStreamForPlayer(i, "http://somafm.com/tags.pls"); //Example.
        }
        return 1;
    }
    if(strcmp(cmdtext, "/stopmusicforall", true) == 0)
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            StopAudioStreamForPlayer(i); //Example.
        }
        return 1;
    }
    //---
    return 0;
}
Reply
#6

Quote:
Originally Posted by irinel1996
Посмотреть сообщение
It's easy bro.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    //---    
    if(strcmp(cmdtext, "/playmusicforall", true) == 0)
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
             PlayAudioStreamForPlayer(i, "http://somafm.com/tags.pls"); //Example.
        }
        return 1;
    }
    if(strcmp(cmdtext, "/stopmusicforall", true) == 0)
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            StopAudioStreamForPlayer(i); //Example.
        }
        return 1;
    }
    //---
    return 0;
}
I'm probably wrong dude but shouldn't it check If(IsPlayerConnected(i))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)