Every time think is called for any other entity it will update the think time of your entity. This is obviously why it's never called. The next think is always getting pushed forward by other entitys.
Also since you only have one entity just do
Code:
if ( iEntity != g_iEntity )
return;
And here's what you should've done.
Code:
public FwThink( iEntity )
{
server_print("FwThink was called.");
if ( !pev_valid( iEntity ) )
return 1;
server_print("Entity is valid.");
static szEntityClass[ 32 ];
pev( iEntity, pev_classname, szEntityClass, charsmax( szEntityClass ) );
if ( !equali( szEntityClass, g_szEntityClass ) )
{
server_print("Wrong entity, updating nextthink.");
CmdSetThink( g_iEntity, 1.0 );
return 1;
}
new iPlayers[ 32 ], iCtCount, iTerrorCount;
get_players( iPlayers, iCtCount, "ceh", "CT" );
get_players( iPlayers, iTerrorCount, "ceh", "TERRORIST" );
server_print("iCtCount: %d, iTerrorCount: %d", iCtCount, iTerrorCount);
if ( ( iCtCount <= 0 && iTerrorCount >= 1 ) || ( iCtCount <= 1 && iTerrorCount >= 10 ) || ( iCtCount <= 2 && iTerrorCount >= 15 ) || ( iCtCount <= 3 && iTerrorCount >= 20 ) )
{
MyPublic();
return 1;
}
CmdSetThink( g_iEntity, 1.0 );
return 1;
}
__________________