SA-MP Forums Archive
Sound System - 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: Sound System (/showthread.php?tid=542720)



Sound System - Vinicin - 21.10.2014

Putting sound system, in a certain place, like putting a sound playing in the slum, who are in shanty town will hear the sound that the player colocae, and that is not in the favela can not hear.


Re: Sound System - Pottus - 21.10.2014

https://sampforum.blast.hk/showthread.php?tid=102865 - Dynamic Areas
https://sampwiki.blast.hk/wiki/PlayAudioStreamForPlayer - Play Audio stream


Re: Sound System - Pawnify - 21.10.2014

To play a sound in a specific area, you must first get the coordinates of the area you want the sound to play in.

Then add;
PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls", X, Y, Z, Distance, 1);

X,Y,Z being the coordinates you chose..
Then distance being how big of a radius the place is.

To read more on PlayAudioStreamForPlayer goto https://sampwiki.blast.hk/wiki/PlayAudioStreamForPlayer


Re: Sound System - Vinicin - 21.10.2014

Can anyone help me create this system, I am newbie


Re: Sound System - gurmani11 - 21.10.2014

pawn Код:
#include a_samp
#include streamer // For Dynamics
new YourVariable;
public OnGameModeInit()
{
   
    YourVariable = CreateDynamicRectangle(Float:minx, Float:miny, Float:maxx, Float:maxy, worldid = -1, interiorid = -1, playerid = -1);
    return 1;
}
public OnPlayerEnterDynamicArea(playerid, areaid)
{
    if(areaid == YourVariable )
    {
        PlayAudioStreamForPlayer(playerid, "http://mp3dos.com/assets/songs/15000-15999/15726-am-i-wrong-nico-vinz--1411219503.mp3");

        SetPlayerTime(playerid,24,0);
    }

    return 1;
}
public OnPlayerLeaveDynamicArea(playerid, areaid)
{
    if(areaid == YourVariable )
    {
        SetPlayerTime(playerid,8,0);
        StopAudioStreamForPlayer(playerid);
    }
    return 1;
}



Re: Sound System - Pottus - 21.10.2014

@gurmani11 - That will work fine.


Re: Sound System - gurmani11 - 21.10.2014

ty mate