24.10.2014, 05:02
Use this include.. it might help you..
For more information http://forum.sa-mp.com/showthread.ph...highlight=load
If i helped you, than please +REP me.
Code:
stock LoadDynamicObjectsFrom(filename[]) { new count = GetTickCount(); new string[512],objectid,Float:pos[6],index,var_from_line[64],loaded; new File:example = fopen(filename, io_read); if(!example)return printf("Error opening: %s",filename); while(fread(example, string) > 0) { if(IsObjectCode(string)) { if(ClearLine(string)) { index = 0; index = token_by_delim(string,var_from_line,',',index); objectid = strval(var_from_line); index = token_by_delim(string,var_from_line,',',index+1); pos[0] = floatstr(var_from_line); index = token_by_delim(string,var_from_line,',',index+1); pos[1] = floatstr(var_from_line); index = token_by_delim(string,var_from_line,',',index+1); pos[2] = floatstr(var_from_line); index = token_by_delim(string,var_from_line,',',index+1); pos[3] = floatstr(var_from_line); index = token_by_delim(string,var_from_line,',',index+1); pos[4] = floatstr(var_from_line); index = token_by_delim(string,var_from_line,',',index+1); pos[5] = floatstr(var_from_line); CreateDynamicObject(objectid,pos[0],pos[1],pos[2],pos[3],pos[4],pos[5]); loaded++; } } } fclose(example); return printf("Loaded %d objects. In %d mc.",loaded,(GetTickCount()-count)); } stock ClearLine(line[]) { strdel(line, 0, 20); return 1; } forward bool:IsObjectCode(line[]); stock bool:IsObjectCode(line[]) { if(strfind(line, "CreateDynamicObject", false) != -1)return true; return false; } stock token_by_delim(const string[], return_str[], delim, start_index) { new x=0; while(string[start_index] != EOS && string[start_index] != delim) { return_str[x] = string[start_index]; x++; start_index++; } return_str[x] = EOS; if(string[start_index] == EOS) start_index = (-1); return start_index; }
If i helped you, than please +REP me.