2020-10-01, 05:29 PM
(2020-10-01, 10:19 AM)justinnn Wrote: Every time a house is removed, its looping thru every object in your server just to check if its furniture or not. That causes the lag because pawn is unthreaded, meaning the server waits for the loop to get finished to continue its operation. So imagine waiting for a loop to go thru 16,000 objects.
Use y_iterate. If you dont know how to theres a documentation somewhere. If you dont want to use iterate, use arrays. Everytime a house adds a furniture, assign the objectid of that furniture to that array.
I've been planning to assign the furniture/land objects into an array but the problem is it will limit the furnitures/land objects that it can make since the higher the limit for the array, the higher the memory is being used in the script and I don't want that.
I didn't know that y_iterate can be used on looping through objects, may I know how I can convert this code into y_iterate??
Thanks!