Raised This Month: $ Target: $400
 0% 

FM_Think


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 08-21-2013 , 18:33   Re: FM_Think
Reply With Quote #4

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; }
__________________

Last edited by Black Rose; 08-21-2013 at 18:38.
Black Rose is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:54.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode