Frosya
Новичок
Пожалуйста помогите вот код
stock LoadGZ()
{
new File = ini_openFile("richzone.ini");
new l[200];
new stringer[128];
new asd[5][10];
for(new i =0;i<sizeof(GZInfo);i++)
{
format(stringer,sizeof(stringer),"Zone%d",i);
new x = ini_getString(File,stringer,l);
if(x < 0)
{
GZInfo[gCoords][0] = STANDARTGangZone[0];
GZInfo[gCoords][1] = STANDARTGangZone[1];
GZInfo[gCoords][2] = STANDARTGangZone[2];
GZInfo[gCoords][3] = STANDARTGangZone[3];
}
else
{
split(l,asd,'|');
GZInfo[gCoords][0] = floatstr(asd[0]);
GZInfo[gCoords][1] = floatstr(asd[1]);
GZInfo[gCoords][2] = floatstr(asd[2]);
GZInfo[gCoords][3] = floatstr(asd[3]);
}
GZInfo[gFrakVlad] = strval(asd[4]);
if(GZInfo[gFrakVlad] == 0) GZInfo[gFrakVlad] = allowedfactions[random(sizeof(allowedfactions))];
GZInfo[gID] = GangZoneCreate(GZInfo[gCoords][0],GZInfo[gCoords][1],GZInfo[gCoords][2],GZInfo[gCoords][3]);
}
ini_closeFile(File);
}
stock SaveGZ()
{
new File = ini_openFile("richzone.ini");
new l[128];
new stringer[200];
for(new i =0;i<sizeof(GZInfo);i++)
{
format(l,sizeof(l),"Zone%d",i);
format(stringer,sizeof(stringer),"%f|%f|%f|%f|%d",GZInfo[gCoords][0], GZInfo[gCoords][1],GZInfo[gCoords][2],GZInfo[gCoords][3],GZInfo[gFrakVlad]);
ini_setString(File,l,stringer);
}
ini_closeFile(File);
}
stock LoadGZ()
{
new File = ini_openFile("richzone.ini");
new l[200];
new stringer[128];
new asd[5][10];
for(new i =0;i<sizeof(GZInfo);i++)
{
format(stringer,sizeof(stringer),"Zone%d",i);
new x = ini_getString(File,stringer,l);
if(x < 0)
{
GZInfo[gCoords][0] = STANDARTGangZone[0];
GZInfo[gCoords][1] = STANDARTGangZone[1];
GZInfo[gCoords][2] = STANDARTGangZone[2];
GZInfo[gCoords][3] = STANDARTGangZone[3];
}
else
{
split(l,asd,'|');
GZInfo[gCoords][0] = floatstr(asd[0]);
GZInfo[gCoords][1] = floatstr(asd[1]);
GZInfo[gCoords][2] = floatstr(asd[2]);
GZInfo[gCoords][3] = floatstr(asd[3]);
}
GZInfo[gFrakVlad] = strval(asd[4]);
if(GZInfo[gFrakVlad] == 0) GZInfo[gFrakVlad] = allowedfactions[random(sizeof(allowedfactions))];
GZInfo[gID] = GangZoneCreate(GZInfo[gCoords][0],GZInfo[gCoords][1],GZInfo[gCoords][2],GZInfo[gCoords][3]);
}
ini_closeFile(File);
}
stock SaveGZ()
{
new File = ini_openFile("richzone.ini");
new l[128];
new stringer[200];
for(new i =0;i<sizeof(GZInfo);i++)
{
format(l,sizeof(l),"Zone%d",i);
format(stringer,sizeof(stringer),"%f|%f|%f|%f|%d",GZInfo[gCoords][0], GZInfo[gCoords][1],GZInfo[gCoords][2],GZInfo[gCoords][3],GZInfo[gFrakVlad]);
ini_setString(File,l,stringer);
}
ini_closeFile(File);
}
