View Single Post
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-09-2023 , 08:07   Re: Question about native : get_players
Reply With Quote #9

Quote:
Originally Posted by 101 View Post

by the way , if natives have to calculate from the beginning , then why should i call it ?
i think natives are workers that should be ready to give a pre-prepared information instanly -as fast as possible -, and they don't have to work from zero , they should be ready,cached and prepared .
From where did you get this information? It is not correct. Some natives will give you existing data (if they are simple getters), and some natives will do some work before returning a result. This is perfectly normal, expected and there is nothing wrong with it. There is nothing wrong with get_players.

Btw, is_user_alive should absolutely check if the user is connected first, as being connected is a prerequisite for being alive. So, if you ever need to know if a user is alive, you can simply do is_user_alive(id). You don't need to write is_user_connected(id) && is_user_alive(id).
__________________

Last edited by HamletEagle; 12-09-2023 at 08:09.
HamletEagle is offline