Streamer, loop through objects.
#7

Quote:
Originally Posted by DRIFT_HUNTER
Посмотреть сообщение
Create include and hook to a CreateDynamicObject function, keep track of maximum object id and objects count...
You can also hook to a DestroyDynamicObject function and if destroyed object is the last one (maximal id) then loop back and check for valid objects (first one valid object is new maximal id)

EDIT: just visited streamer topic to check natives. And these came to my mind


pawn Код:
new objectscount = CountDynamicObjects();
new i = 0;
while(objectscount > 0)
{
    if(IsValidDynamicObject(i))
   {
        //Do what you need here, but i++ goes in the end of the IF function

        i++;
    }
}
Quote:
Originally Posted by Crayder
Посмотреть сообщение
But that wouldn't be every correct object ID. Say some of the objects in the middle were destroyed but before they were more objects were created. The objects that were destroyed would be counted in and the ones created last would not.
This is why I said iterators would be the best way. But I have never used them and I keep getting errors when I try too... XD
Reply


Messages In This Thread
Streamer, loop through objects. - by Crayder - 31.01.2015, 01:47
Re: Streamer, loop through objects. - by CalvinC - 31.01.2015, 10:18
Re: Streamer, loop through objects. - by Crayder - 31.01.2015, 18:08
Re: Streamer, loop through objects. - by Schneider - 31.01.2015, 18:25
Re: Streamer, loop through objects. - by Crayder - 31.01.2015, 19:51
Re: Streamer, loop through objects. - by DRIFT_HUNTER - 31.01.2015, 19:58
Re: Streamer, loop through objects. - by Crayder - 31.01.2015, 20:59

Forum Jump:


Users browsing this thread: 1 Guest(s)