Raised This Month: $ Target: $400
 0% 

while() cpu load 100%


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 05-14-2009 , 07:33   while() cpu load 100%
Reply With Quote #1

I have this code
PHP Code:
#include <amxmodx>
#include <engine>

public plugin_init( ) {
    
register_plugin"Reset Buttons""1.0""xPaw" );
    
    
register_event"HLTV""evNewRound""a""1=0""2=0" );
}

public 
evNewRound( ) {
    new 
iButton    = -1;
    new 
Float:flGametime get_gametime();
    new 
Float:flNextthinkFloat:flLTime;
    
    while( ( 
iButton find_ent_by_classiButton"func_button" ) != ) ) {
        
flNextthink entity_get_floatiButtonEV_FL_nextthink );
        
flLTime entity_get_floatiButtonEV_FL_ltime );
        
        if( 
flNextthink flLTime && flNextthink flGametime ) {
            
entity_set_floatiButtonEV_FL_nextthinkflLTime );
        }
    }

When it starts new round, server just freezes and cpu usage goes to 100% :\
__________________
xPaw is offline
 


Thread Tools
Display Modes

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 01:28.


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