05.09.2012, 15:29
pawn Код:
case 0:
{
if(BoomboxPlaced[playerid] == 1)
{
new Float:X, Float:Y, Float:Z;
new BoomBoxItem;
GetDynamicObjectPos(BoomBoxItem, X, Y, Z);
for(new i = 0; i < MAX_PLAYERS; i++)
{
StopAudioStreamForPlayer(i);
PlayAudioStreamForPlayer(i, "http://relay.181.fm:8018/", X, Y, Z, 15.0, 1);
}
}
else
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 15.0;
GetPlayerPos(playerid, X, Y, Z);
for(new BoomBoxItem = 0; BoomBoxItem < MAX_OBJECTS; BoomBoxItem++)
{
if(IsValidObject(BoomBoxItem)) DestroyDynamicObject(BoomBoxItem);
}
new BoomBoxItem;
BoomBoxItem = CreateDynamicObject(2226, X, Y, Z-0.9, 0, 0, 3.9700012207031);
BoomboxPlaced[playerid] = 1;
StopAudioStreamForPlayer(i);
PlayAudioStreamForPlayer(i, "http://relay.181.fm:8018/", X, Y, Z, Distance, 1);
}
}
}