Raised This Month: $51 Target: $400
 12% 

freeze forever and > 200% cpu load


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 03-28-2016 , 00:46   freeze forever and > 200% cpu load
Reply With Quote #1

Code:
public OnPluginStart()
{
    RegConsoleCmd("jointeam", Command_jointeam);
}  


public Action:Command_jointeam(client, args)
{
    if (!client || !IsClientInGame(client))
    {
        return Plugin_Continue;
    }
  
    decl String:teamString[3];
    GetCmdArg(1, teamString, sizeof(teamString));
    new oldTeam = GetClientTeam(client);
    new newTeam = StringToInt(teamString);
    g_Tcount = GetTeamClientCount(TEAM_T);
    g_CTcount = GetTeamClientCount(TEAM_CT);
  
  
    ...
  
    if(oldTeam < TEAM_T)
    {
  
        ...
      
        else if(newTeam == TEAM_CT)
        {
            if(g_CTcount > g_Tcount || g_PrevLosers == TEAM_T && g_CTcount == g_Tcount)
            {
                LogToFile(ZLogFile, "Jointeam 4.3");
                CGOPrintToChat(client, "{LIME}Text");
                ChangeClientTeam(client, TEAM_T);          
          
                return Plugin_Handled;
            }
            else return Plugin_Continue;
        }
Last text in logs:
Jointeam 4.3
X joined T team
How this action can make freeze until server reload, and >200% cpu load?
There was 2 more players in that moment
g_PrevLosers - previous team who lost round

Last edited by Indarello; 03-28-2016 at 00:47.
Indarello is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 03-28-2016 , 08:35   Re: freeze forever and > 200% cpu load
Reply With Quote #2

First look: Maybe it's because you hook team change and inside that hook you change team - infinite loop.
__________________
Plugins: TeamGames
Includes: Menu stocks, ColorVariables, DownloadTableConfig

> No help through PM, make a topic.
KissLick is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 03-28-2016 , 09:43   Re: freeze forever and > 200% cpu load
Reply With Quote #3

Try to use: CS_SwitchTeam
instead of ChangeClientTeam.
__________________
xbatista is offline
Send a message via Skype™ to xbatista
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 03-28-2016 , 11:07   Re: freeze forever and > 200% cpu load
Reply With Quote #4

thanks, i will try
freeze is rare, and for now i dont know that this pugin makes it, it was just last massage in logs before freeze
Indarello 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 06:28.


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