Raised This Month: $ Target: $400
 0% 

Repetitive task


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Laccess
Junior Member
Join Date: May 2010
Old 09-03-2012 , 09:13   Repetitive task
Reply With Quote #1

Hi,
I'm recently having a lot of trouble with the FPS on my server. Some maps run at 700-950 FPS, some at ~500, and some at 20-50 FPS. I've been removing some of the maps that have a bad impact on the FPS, though I believe they're not the only problem occurring.

I write some scripts, but I'm not very experienced and I think it's somewhat me that caused the unstable FPS.

Now on to the question. I've made myself a task, which is repeated each second. It helps me with a lot of other delayed tasks.

Code:
public CommonCounter()
{
    counter ++;
    
    mp_timeleft = get_timeleft();
    
    if(counter == get_pcvar_num(gTCCvar))
        ban_team_change = true;
    
    if(60*get_pcvar_num(g_pRoundTime)-get_pcvar_num(g_pNoRespTime) == counter)
        no_respawn = true;
    
    if(!award_given && mp_timeleft<15)
        EndAward();
        
    if(!f_saved && mp_timeleft<8)
        MapendSaving();
        
    if(bet_delay_counter > 0)
        bet_delay_counter --;
}
Is it possible that this is ruining my FPS? That's the only code I suspect, since it's new and other stuff has been working properly for me quite a long time. Thanks in advance!
Laccess 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 08:16.


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