Quote:
Originally Posted by didoWEE
in is_real_player(id)
we have
PHP Code:
return ((is_user_bot(id) || is_user_hltv(id)) ? false : true);
So we will get errors in console/logs if player is not connected (this is why we stop on the first if and we do NOT check all 4 at once)
|
Both ways will always have the same number of checks.
quoted code can be simplified to:
PHP Code:
return is_user_connect(id) && !(is_user_bot(id) || is_user_hltv(id));
EDIT:
AND statements(&& operator) won't check right side if left side is false, example:
PHP Code:
new x = 0;
if (false && x == 0) // This will NEVER check if x is 0 as the left side is always false
//Code here
OR statements(|| operator) won't check right side if left side is true, no example needed (as you can replace && in above with ||)