05.09.2012, 15:32
I want player to spawn their own ID of boombox, but this one seems weird.., sometimes the object itself doesn't show up,
this is the pwn when no song is chosen(despawn object)
this is the pwn when no song is chosen(despawn object)
pawn Код:
new Float:X, Float:Y, Float:Z, Float:Distance = 15.0;
for(new BoomBoxItem = 0; BoomBoxItem < MAX_OBJECTS; BoomBoxItem++)
{
if(IsValidObject(BoomBoxItem)) DestroyDynamicObject(BoomBoxItem);
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
for(new BoomBoxItem = 0; BoomBoxItem < MAX_OBJECTS; BoomBoxItem++)
{
GetDynamicObjectPos(BoomBoxItem, X, Y, Z);
}
if(IsPlayerInRangeOfPoint(i, X, Y, Z, Distance))
{
StopAudioStreamForPlayer(i);
}
}
BoomboxPlaced[playerid] = 0;
StopAudioStreamForPlayer(playerid);