How to make a family using the families.cfg?
#1

I don't seem to understand this yet, so I am going to ask, how do I turn this:
Код:
0|None|None|0xFF000069|None|0|0.0|0.0|0.0|0.0|0
into a family? Thanks.
Reply
#2

Go into your script and look at the (i beleive it is this) LoadFamilies and SaveFamilies callback. You'll see how they save the different variables into the file using the %s|%d|%f...... format, hince it is quite popular.
Reply
#3

This?:
Код:
forward LoadFamilies();
forward SaveFamilies();
Reply
#4

Search in the script (CTR+F) for "public LoadFamilies". When you get there, look through the code and study how the used it to save the variables into the file, as they did.
Reply
#5

Код:
public LoadFamilies()
{
	new arrCoords[11][64];
	new strFromFile2[256];
	new File: file = fopen("families.cfg", io_read);
	if (file)
	{
		new idx;
		while (idx < sizeof(FamilyInfo))
		{
			fread(file, strFromFile2);
			split(strFromFile2, arrCoords, '|');
			FamilyInfo[idx][FamilyTaken] = strval(arrCoords[0]);
			strmid(FamilyInfo[idx][FamilyName], arrCoords[1], 0, strlen(arrCoords[1]), 255);
			strmid(FamilyInfo[idx][FamilyMOTD], arrCoords[2], 0, strlen(arrCoords[2]), 255);
			strmid(FamilyInfo[idx][FamilyColor], arrCoords[3], 0, strlen(arrCoords[3]), 255);
			strmid(FamilyInfo[idx][FamilyLeader], arrCoords[4], 0, strlen(arrCoords[4]), 255);
			FamilyInfo[idx][FamilyMembers] = strval(arrCoords[5]);
			FamilyInfo[idx][FamilySpawn][0] = floatstr(arrCoords[6]);
			FamilyInfo[idx][FamilySpawn][1] = floatstr(arrCoords[7]);
			FamilyInfo[idx][FamilySpawn][2] = floatstr(arrCoords[8]);
			FamilyInfo[idx][FamilySpawn][3] = floatstr(arrCoords[9]);
			FamilyInfo[idx][FamilyInterior] = strval(arrCoords[10]);
			printf("Family:%d Taken: %d Name:%s MOTD:%s Leader:%s Members:%d SpawnX:%f SpawnY:%f SpawnZ:%f Int:%d",
			idx,FamilyInfo[idx][FamilyTaken],FamilyInfo[idx][FamilyName],FamilyInfo[idx][FamilyMOTD],FamilyInfo[idx][FamilyLeader],FamilyInfo[idx][FamilyMembers],FamilyInfo[idx][FamilySpawn][0],FamilyInfo[idx][FamilySpawn][1],FamilyInfo[idx][FamilySpawn][2],FamilyInfo[idx][FamilyInterior]);
			idx++;
		}
		fclose(file);
	}
	return 1;
Reply
#6

Quote:

FamilyInfo[idx][FamilyTaken],
FamilyInfo[idx][FamilyName],
FamilyInfo[idx][FamilyMOTD],
FamilyInfo[idx][FamilyColor],
FamilyInfo[idx][FamilyLeader],
FamilyInfo[idx][FamilyMembers],
FamilyInfo[idx][FamilySpawn][0],
FamilyInfo[idx][FamilySpawn][1],
FamilyInfo[idx][FamilySpawn][2],
FamilyInfo[idx][FamilySpawn][3],
FamilyInfo[idx][FamilyInterior]);

Reply
#7

Does it help any that I'm using the Godfather?
Reply
#8

If you are asking howto make a new family do the follwoing:
open the file to where they save,
copy the last line, press enter, and paste it
Replace the information from that line with the new informatoin you want.
Reply
#9

Deleted
Reply
#10

(what do I put here?)|example name|(what's MOTD?)|(what code if for light blue?)|example player|0|0.0|0.0|0.0|0.0|0 Plz help with questions.
Reply


Forum Jump:


Users browsing this thread: