If you are checking if user is connected for example when you execute command where player is a target then using is_user_connected(id) is fine, but if you loop through all players in prethink then caching is_user_connected is better however your method is not the best. You should use something like this:
PHP Code:
new _pg_is_ced
#define _IsUserConnected(%1) ( _pg_is_ced & 1<<(%1) )
#define _SetUserConnected(%1) _pg_is_ced |= 1<<(%1)
#define _SetUserNotConnected(%1) _pg_is_ced &= ~( 1<<(%1) )
public client_connected( id ) _SetUserConnected(id)
public client_disconnected( id ) _SetUserNotConnected(id)
public some_function(id){
if(_IsUserConnected(id)){
//code...
}
}
__________________