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: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 );
}
}
}
When it starts new round, server just freezes and cpu usage goes to 100% :\
__________________