Raised This Month: $ Target: $400
 0% 

FM_Think


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 08-21-2013 , 19:37   Re: FM_Think
Reply With Quote #1

So you broke it exactly the same way again? I already told you in #4 this is wrong. Don't update think time if you get the wrong entity. Just exit the function.

On top of that, after it finishes one run it will return on "if( g_bActive )" and break again.
__________________
Black Rose is offline
@.SizNeR
Member
Join Date: Jun 2013
Old 08-21-2013 , 20:13   Re: FM_Think
Reply With Quote #2

Quote:
Originally Posted by Black Rose View Post
So you broke it exactly the same way again? I already told you in #4 this is wrong. Don't update think time if you get the wrong entity. Just exit the function.

On top of that, after it finishes one run it will return on "if( g_bActive )" and break again.
Code:
public FwFirstThink( iEntity ) {       static szClassname[ 32 ];         pev( iEntity, pev_classname, szClassname, charsmax( szClassname ) );         server_print( "On think." );         if( !equali( szClassname, g_szFirstClass ) )     {               server_print( "Error. [1]" );                 return 1;     }         if( g_bActive )     {         server_print( "Updating next time. [2]" );                 return 1;     }         new players[ 32 ], pnum;         new tCount, ctCount;         get_players( players, pnum, "c" );         for( new i = 0; i < pnum; i++ )     {         if( !is_user_connected( players[ i ] ) )             continue;                 switch( cs_get_user_team( players[ i ] ) )         {             case CS_TEAM_T:                 tCount++;                         case CS_TEAM_CT:                 ctCount++;         }     }         if ( ( tCount <= 1 && ctCount >= 0 ) || ( tCount / ctCount > 5 ) && !g_bActive )     {         server_print( "Starting First" );                 g_bActive = true;             g_iCountdown = 5;             set_task( 1.0, "CmdFirstCountdown", g_iCountdownTask, _, _, "b" );     }     set_think( iEntity, 1.0 );         server_print( "Updating next time. [3]" );         return 1; }

The server is already print same message:
PHP Code:
Error. [1]
On Think
@.SizNeR is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-22-2013 , 00:11   Re: FM_Think
Reply With Quote #3

Why don't you use register_think ? would be more efficient because every bad classnames would be filtered internally to module.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
@.SizNeR
Member
Join Date: Jun 2013
Old 08-22-2013 , 09:02   Re: FM_Think
Reply With Quote #4

Quote:
Originally Posted by ConnorMcLeod View Post
Why don't you use register_think ? would be more efficient because every bad classnames would be filtered internally to module.
Thanks, its work.
@.SizNeR is offline
Reply



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