12.08.2010, 15:18
pawn Код:
public SaveFactionsEx()
{
new file[128];
for(new factionid = 0; factionid < 100; factionid++)
{
format(file, sizeof(file), "/server/factions/%d.cfg", fInfo[factionid][fID]);
if (!dini_Exists(file))
{
dini_Create(file);
dini_IntSet(file,"fid",fInfo[factionid][fID]);
dini_IntSet(file,"ftaken",fInfo[factionid][fTaken]);
dini_Set(file,"fname",fInfo[factionid][fName]);
dini_Set(file,"fleader",fInfo[factionid][fLeader]);
dini_IntSet(file,"fmembers",fInfo[factionid][fMembers]);
}
}
return 1;
}
pawn Код:
public LoadFactionEx()
{
new file[128], string[256];
for(new factionid = 0; factionid < 100; factionid++)
{
format(file, sizeof(file), "/server/factions/%d.cfg", fInfo[factionid][fID]);
if (dini_Exists(file))
{
fInfo[factionid][fID] = dini_Int(file, "fid");
fInfo[factionid][fTaken] = dini_Int(file, "ftaken");
string = dini_Get(file, "fname");
strmid(fInfo[factionid][fName], string, 0, strlen(string), 255);
string = dini_Get(file, "fleader");
strmid(fInfo[factionid][fLeader], string, 0, strlen(string), 255);
fInfo[factionid][fMembers] = dini_Int(file, "fmembers");
printf("Family: %d Taken: %d Name: %s Leader: %s Members: %d",
fInfo[factionid][fID],
fInfo[factionid][fTaken],
fInfo[factionid][fName],
fInfo[factionid][fLeader],
fInfo[factionid][fMembers]);
}
}
return 1;
}

