First off, use indentation properly and use PHP Tags for highlighting.
Secondly, else if statements require a condition to work off of.
ex:
PHP Code:
// GOOD
if( cs_get_user_team( id ) == CS_TEAM_T )
{
// Code for T
}
else if( cs_get_user_team( id ) == CS_TEAM_CT )
{
// Code for CT
}
else
{
// Code for SPEC or UNASSIGNED
}
PHP Code:
// BAD
if( cs_get_user_team( id ) == CS_TEAM_T )
{
// Code for T
}
else if // REQUIRES CONDITION
{
// ???
}
You're not specifying the condition, therefore you aren't getting any results.
Control Structures are the same in pretty much every other programming language out there.
EDIT: Most of the time, when you're in need of so many else if statements, you might want to perform a switch.
ex:
Instead of
PHP Code:
if( cs_get_user_team( id ) == CS_TEAM_T )
{
// Code for T
}
else if( cs_get_user_team( id ) == CS_TEAM_CT )
{
// Code for CT
}
else
{
// Code for SPEC or UNASSIGNED
}
You might want to do
PHP Code:
switch( cs_get_user_team( id ) )
{
case CS_TEAM_T:
{
// Code for T
}
case CS_TEAM_CT:
{
// Code for CT
}
default:
{
// Code for SPECTATOR or UNASSIGNED
}
}
__________________