03.02.2014, 17:04
stock LoadGates()
{
new file[64];
for(new t=0; t<=MAX_GATES; t++)
{
format(file,sizeof(file),"gates/gate%d.txt",t);
new Float: X, Float: Y, Float: Z;
X = dini_Float(file,"floatx");
Y = dini_Float(file,"floaty");
Z = dini_Float(file,"floatz");
new F = dini_Int(file,"factionid");
new GID = dini_Int(file,"gateid");
if(dini_Exists(file))
{
GateInfo[t][gModel] = 976;
GateInfo[t][gFaction] = F;
GateInfo[t][gCX] = X;
GateInfo[t][gCY] = Y;
GateInfo[t][gCZ] = Z;
GateInfo[t][gSpeed] = 5;
new string[256];
format(string, sizeof(string), ".::Gate %d::.\nCmd: /fgate\nFaction Owner: %d",t,GateInfo[t][gFaction]);
GateInfo[GID][gGate] = CreateDynamicObject(976, X, Y, Z-1, 0, 0, dini_Float(file,"facingangle"));
GateInfo[t][gText] = CreateDynamic3DTextLabel(string, 0xFFFFFFFF, GateInfo[t][gCX], GateInfo[t][gCY], GateInfo[t][gCZ], 10);
GateInfo[t][gStatus] = 0;
}
}
print("Gates loaded successfully.");
return 1;
}
{
new file[64];
for(new t=0; t<=MAX_GATES; t++)
{
format(file,sizeof(file),"gates/gate%d.txt",t);
new Float: X, Float: Y, Float: Z;
X = dini_Float(file,"floatx");
Y = dini_Float(file,"floaty");
Z = dini_Float(file,"floatz");
new F = dini_Int(file,"factionid");
new GID = dini_Int(file,"gateid");
if(dini_Exists(file))
{
GateInfo[t][gModel] = 976;
GateInfo[t][gFaction] = F;
GateInfo[t][gCX] = X;
GateInfo[t][gCY] = Y;
GateInfo[t][gCZ] = Z;
GateInfo[t][gSpeed] = 5;
new string[256];
format(string, sizeof(string), ".::Gate %d::.\nCmd: /fgate\nFaction Owner: %d",t,GateInfo[t][gFaction]);
GateInfo[GID][gGate] = CreateDynamicObject(976, X, Y, Z-1, 0, 0, dini_Float(file,"facingangle"));
GateInfo[t][gText] = CreateDynamic3DTextLabel(string, 0xFFFFFFFF, GateInfo[t][gCX], GateInfo[t][gCY], GateInfo[t][gCZ], 10);
GateInfo[t][gStatus] = 0;
}
}
print("Gates loaded successfully.");
return 1;
}