Get streamed objects.
#1

Hi,

How to do check if player have streamed objects with simple object about 1000, i want to report, because with one command you can create a dynamic object near you, but if will be playing 1000 players and in one place they build that object then i think it'is will be not very good and buggs will start.
Reply
#2

You would need to use the following.

native Streamer_IsItemVisible(playerid, type, {Text3D,_}:id);
native Streamer_GetUpperBound(type);
native Streamer_IsInArrayData(type, {Text3D,_}:id, data, value);

@Edit - You may need to store all of your objects in an array then loop through them and use Streamer_IsItemVisible(playerid, type, {Text3D,_}:id); although you might able to check if an item exists by doing this.

pawn Код:
new VisibleCount;

for(new i = 0; i <= Streamer_GetUpperBound(STREAMER_TYPE_OBJECT); i++)
{
    // Not in array ?
    if(Streamer_IsInArrayData(STREAMER_TYPE_OBJECT, i, E_STREAMER_MODEL_ID, 0)) continue;
    if(Streamer_IsItemVisible(playerid, STREAMER_TYPE_OBJECT, i)) VisibleCount++;
}
I'm not sure if that will work right (untested) my thinking is if the model id is 0 then the that item does not exist but you might even be able to just do it like this which should work again I didn't any of this because I have never had any reason to use these features.

pawn Код:
new VisibleCount;

for(new i = 0; i <= Streamer_GetUpperBound(STREAMER_TYPE_OBJECT); i++)
{
    if(Streamer_IsItemVisible(playerid, STREAMER_TYPE_OBJECT, i)) VisibleCount++;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)