Quote:
Originally Posted by Jelle
PHP Code:
if(get_user_team(id) != 1 || get_user_team(id) != 2)
to
PHP Code:
if ( get_user_team(id) == 3 ) return
Just an idea. Then you do not need two, but only one check. As I see it, it is a bit faster.
|
It's twice as fast( Only because the native is also called unnecessarily twice ). Somehow what I'd use is:
PHP Code:
switch( cs_get_user_team( id ) )
{
case CS_TEAM_UNASSIGNED, CS_TEAM_SPECTATOR:
{
//Action
}
}
Quote:
Originally Posted by drekes
I looked over i.
But i don't understand what's wrong with the continue. I learned it this way.
|
You shouldn't use jumps( breaks, continues and returns ) as they just make the code harder to perceive and mess it up. You want to keep things simple and it's much easier to think that you eat if you'r hungry instead of if you'r not hungry you skip eating.