View Single Post
vitorrossi
Senior Member
Join Date: Apr 2012
Location: NY, USA
Old 05-14-2015 , 12:49   Re: get_players or global var
Reply With Quote #8

Quote:
Originally Posted by Nextra View Post
I'm not aware of any issues with get_players in the latest AMXX builds, especially not the "a" or "b" flag. Your approach only complicates the code and will not result in a performance benefit. Quite the opposite actually: get_players will in almost all cases be the fastest method for looping players, as it does all filtering at once (not that it matters).

If you truly wanted to cache data like team and alive counts you would need a very good reason for it. A task that runs every 5 seconds is definitely not one of those reasons. AddToFullPack and similar are pretty much the only use-cases that might qualify.



The client is technically not disconnected until he times out. That's quite different to "client_disconnected is not called in certain cases". Please be careful with such claims.
Ok, I wasn't sure if it would be an optimization or not, but after reading your reply I must agree with you. Thanks.



Quote:
Originally Posted by fysiks View Post
Your code makes absolutely no sense.

Why do you need this information so often?
Lol always so helpful
vitorrossi is offline