08.07.2015, 12:03
PHP код:
forward SaveTurfs();
public SaveTurfs()
{
new string[32];
new idx;
while (idx < sizeof(turfs))
{
format(string, sizeof(string),"Factions/Turfs1.ini");
if(dini_Exists(string))
{
dini_IntSet(string, "TurfID", turfs[idx][turfID]);
dini_Set(string, "turfName", turfs[idx][turfName]);
dini_Set(string, "CityName", turfs[idx][cityName]);
dini_FloatSet(string, "zMinX", turfs[idx][zMinX]);
dini_FloatSet(string, "zMinY", turfs[idx][zMinY]);
dini_FloatSet(string, "zMaxX", turfs[idx][zMaxX]);
dini_FloatSet(string, "zMaxY", turfs[idx][zMaxY]);
dini_IntSet(string, "TurfColor", turfs[idx][TurfColor]);
dini_IntSet(string, "TurfOwner", turfs[idx][TurfOwner]);
dini_IntSet(string, "Attacker", turfs[idx][TurfAttacker]);
dini_IntSet(string, "AttackKills", turfs[idx][TurfAttackKills]);
dini_IntSet(string, "TurfWarStarted", turfs[idx][TurfWarStarted]);
dini_IntSet(string, "Mit", turfs[idx][MIT]);
}
}
return 1;
}
PHP код:
forward LoadTurfs();
public LoadTurfs()
{
new string[256];
new idx;
while (idx < sizeof(turfs))
{
format(string, sizeof(string),"Factions/Turfs1.ini");
if(dini_Exists(string))
{
turfs[idx][turfID] = dini_Int(string, "TurfID");
turfs[idx][zMinX] = dini_Float(string, "zMinX");
turfs[idx][zMinY] = dini_Float(string, "zMinY");
turfs[idx][zMaxX] = dini_Float(string, "zMaxX");
turfs[idx][zMaxY] = dini_Float(string, "zMaxY");
turfs[idx][TurfColor] = dini_Int(string, "TurfColor");
turfs[idx][TurfOwner] = dini_Int(string, "TurfOwner");
turfs[idx][TurfAttacker] = dini_Int(string, "Attacker");
turfs[idx][TurfAttackKills] = dini_Int(string, "AttackKills");
turfs[idx][TurfWarStarted] = dini_Int(string, "TurfWarStarted");
turfs[idx][MIT] = dini_Int(string, "Mit");
}
}
return 1;
}