It' not loading The objects from the file :(
#1

It' not loading The objects from the file, (just does not work)

please help me ?

PHP код:
stock LoadObjectsFromFile(const filename[])
{
    new
        
File:file fopen(filenameio_read);
    if (!
file) return 0;
    
TotalObjects 0;
    new
        
line[100],
        
modelid,
        
Float:Pos[6],
        
index,
        
var_from_line[128];
    while (
fread(fileline))
    {
        
index 0;
          
index token_by_delim(line,var_from_line,',',index);
          if(
index == (-1)) continue;
        
Pos[0] = floatstr(var_from_line);
          
index token_by_delim(line,var_from_line,',',index+1);
          if(
index == (-1)) continue;
          
Pos[1] = floatstr(var_from_line);
          
index token_by_delim(line,var_from_line,',',index+1);
          if(
index == (-1)) continue;
          
Pos[2] = floatstr(var_from_line);
          
index token_by_delim(line,var_from_line,',',index+1);
          if(
index == (-1)) continue;
          
Pos[3] = floatstr(var_from_line);
          
index token_by_delim(line,var_from_line,',',index+1);
          if(
index == (-1)) continue;
          
Pos[4] = floatstr(var_from_line);
          
index token_by_delim(line,var_from_line,',',index+1);
          if(
index == (-1)) continue;
          
Pos[5] = strval(var_from_line);
        
ActivityObject[TotalObjects] = CreateDynamicObject(modelidPos[0], Pos[1], Pos[2], Pos[3], Pos[4], Pos[5], ActivityInfo[ActivityNumber][a_VirtualWorld], ActivityInfo[ActivityNumber][a_Interior]);
        
TotalObjects++;
    }
    
fclose(file);
    return 
printf("Objects Loaded: %d"TotalObjects);

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)