Mapfiles not loading from scriptfiles
#3

Code:
stock LoadMaps()
{
    new arrCoords[2][128], strFromFile2[128], output;
	new File: file = fopen("RMRP/mapping/list.ini", io_read);


stock LoadMapFile(filename[], worldid)
{
    new arrCoords[11][128], strFromFile2[256], str[128], output;
    format(str, 128, "RMRP/mapping/%s.ini", filename);
	new File: file = fopen(str, io_read), obj;
	if (file)
	{
		new found = 0;
        while (output < 5000)
        {
            fread(file, strFromFile2);
			split(strFromFile2, arrCoords, ',');
			if(strval(arrCoords[0]) >= 1)
			{
			    obj = CreateDynamicObjectFix(strval(arrCoords[0]), floatstr(arrCoords[1]), floatstr(arrCoords[2]), floatstr(arrCoords[3]), floatstr(arrCoords[4]), floatstr(arrCoords[5]), floatstr(arrCoords[6]), worldid);
			    if(strval(arrCoords[8]) > 0)
			    {
			        SetDynamicObjectMaterial(obj,  strval(arrCoords[7]), strval(arrCoords[8]), arrCoords[9], arrCoords[10], 0xFFFFFFFF);
			    }
				//if(worldid == 0) CreateDynamicObject(strval(arrCoords[0]), floatstr(arrCoords[1]), floatstr(arrCoords[2]), floatstr(arrCoords[3]), floatstr(arrCoords[4]), floatstr(arrCoords[5]), floatstr(arrCoords[6]), -1);
				found++;
            }
            output++;
		}
		format(str, 128, "Loaded Mapfile: %s.ini - %d Objects - WorldID: %d.", filename, found, worldid);
		printf(str);
	}
	fclose(file);
	return true;
}
Reply


Messages In This Thread
Mapfiles not loading from scriptfiles - by ShiffeyTheGamer - 22.01.2020, 19:38
Re: Mapfiles not loading from scriptfiles - by Markski - 23.01.2020, 12:06
Re: Mapfiles not loading from scriptfiles - by ShiffeyTheGamer - 23.01.2020, 14:59

Forum Jump:


Users browsing this thread: 1 Guest(s)