View Single Post
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 04-21-2016 , 19:39   Re: Pro Become V.I.P. [re1.0.2]
Reply With Quote #13

Quote:
Originally Posted by didoWEE View Post
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 0;
if (
false && == 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 ||)

Last edited by WildCard65; 04-22-2016 at 08:25.
WildCard65 is offline