05.09.2012, 15:51
something like this might work, you would have to make it similar. or give more codes instead of pieces.
pawn Код:
new boombox[MAX_PLAYERS]; // store the id of the object,
public OnPlayerConnect(playerid)
{
boombox = createdynamicobject(....); // creates the object for each player
}
public OnPlayerDisconnect(playerid,reason)
{
DestroyDynamicObject(boombox[playerid]); // destroy when the player leaves.
}
// this one.. you put into the code... will get the pos of the object of the playerd and stop the audio for everyone who is near to the object
new Float:X,Float:Y,Float:Z;
GetDynamicObjectPos(boombox[playerid], X, Y, Z);
for(new i; i < MAX_PLAYERS; ++i)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInRangeOfPoint(i,radius, X, Y, Z)) // put the radius..
{
StopAudioStreamForPlayer(i);
}
}