18.10.2009, 18:59
my Server don't save my stuff.ini anymore.
I use LoadStuff and SaveStuff
I think there is a problem, with loading the stuff.ini.
I use LoadStuff and SaveStuff
pawn Код:
public SaveStuff()
{
if(TOGGLE_DEBUG_MODE)
{
print(" //DEBUG: CALL SaveStuff()");
}
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "$%d,$%d,$%d,%d,$%d, LcnMats: %d, LcnBombs: %d, LcnMoney: $%d, YakMats: %d, YakBombs: %d, YakMoney: $%d, HitMats: %d, HitBombs: %d, HitMoney: $%d, StMats: %d, StBombs: %d, StMoney: $%d, RAMats: %d, RABombs: %d, RAMoney: $%d, NPC Bus price: $%d",
Jackpot,Tax,TaxValue,Security,V_A_T,
lMats,lBombs,lMoney,
yMats,yBombs,yMoney,
hMats,hBombs,hMoney,
stMats,stBombs,stMoney,
raMats,raBombs,raMoney,
busprice);
new File: file2 = fopen("stuff.ini", io_write);
fwrite(file2, coordsstring);
fclose(file2);
return 1;
}
public LoadStuff()
{
if(TOGGLE_DEBUG_MODE)
{
print(" //DEBUG: CALL LoadStuff()");
}
new arrCoords[21][64];
new strFromFile2[256];
new File: file = fopen("stuff.ini", io_read);
if (file)
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
Jackpot = strval(arrCoords[0]);
Tax = strval(arrCoords[1]);
TaxValue = strval(arrCoords[2]);
Security = strval(arrCoords[3]);
V_A_T = strval(arrCoords[4]);
lMats = strval(arrCoords[5]);
lBombs = strval(arrCoords[6]);
lMoney = strval(arrCoords[7]);
yMats = strval(arrCoords[8]);
yBombs = strval(arrCoords[9]);
yMoney = strval(arrCoords[10]);
hMats = strval(arrCoords[11]);
hBombs = strval(arrCoords[12]);
hMoney = strval(arrCoords[13]);
stMats = strval(arrCoords[14]);
stBombs = strval(arrCoords[15]);
stMoney = strval(arrCoords[16]);
raMats = strval(arrCoords[17]);
raBombs = strval(arrCoords[18]);
raMoney = strval(arrCoords[19]);
busprice = strval(arrCoords[20]);
fclose(file);
if(Security == 0 || Security == 1)
{
}
else
{
GameModeExit();
}
}
else
{
GameModeExit();
}
return 1;
}