View Single Post
Crazed
Member
Join Date: Oct 2006
Old 10-22-2006 , 09:09   Re: [Update] Client Checker
Reply With Quote #7

Had a bug while loading the chk_cvars.cfg file. This was because I first didnt had any comments in that file added this later and forgot to update the old code properly.

Old code:
PHP Code:
new fp=fopen(cc_configfile"rt")
    
lines 0
    
new left[64], right[64]
    while  (!
feof(fp)) {
        
fgets(fpbuf63)
        
trim(buf)
        if (
strlen(buf) > 0) {
            
strtok(bufleft63right63' ')
            
// Check if line is not a comment
            
if (strcmp(left"//"))
                
cvars_buf[lines] = buf
        
}
        
lines++
    }
    
fclose(fp
New code:
PHP Code:
new fp=fopen(cc_configfile"rt")
        
cvar_items 0
        
while  (!feof(fp)) 
        {
            
fgets(fpbuf63)
            
trim(buf)
            if (
strlen(buf) > 0
            {
                
// Check if line starts with comment sign
                
if (strfind(buf"//"00) != 0)
                {
                    
cvars_buf[cvar_items] = buf
                    cvar_items
++
                }
            }
        }
        
fclose(fp

Last edited by Crazed; 10-22-2006 at 09:39.
Crazed is offline