Raised This Month: $ Target: $400
 0% 

while() cpu load 100%


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
--kml--
Senior Member
Join Date: Jan 2009
Old 05-14-2009 , 09:20   Re: while() cpu load 100%
Reply With Quote #2

oo maybe change new to static?

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( ) { 
    static iButton    = -1; 
    static Float:flGametime = get_gametime(); 
    static Float:flNextthink, Float:flLTime; 
     
    while( ( iButton = find_ent_by_class( iButton, "func_button" ) != 0 ) ) { 
        flNextthink = entity_get_float( iButton, EV_FL_nextthink ); 
        flLTime = entity_get_float( iButton, EV_FL_ltime ); 
         
        if( flNextthink > flLTime && flNextthink > flGametime ) { 
            entity_set_float( iButton, EV_FL_nextthink, flLTime ); 
        } 
    } 
}  
maybe will worK? xD
__________________
wooT now is asking season
will ask you plenty of things for learning

Last edited by --kml--; 05-14-2009 at 10:05.
--kml-- 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 01:28.


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