SA-MP Forums Archive
Is this ok ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Is this ok ? (/showthread.php?tid=164211)



Is this ok ? - Jimbo01 - 30.07.2010

Quote:

public LoadStuff()
{
new arrCoords[4][64];
new strFromFile2[256];
new File: file = fopen("stuff.ini", io_read);
if (file)
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
Jackpot = strval(arrCoords[0]);
fclose(file);
}
else
{
GameModeExit();
}
return 1;
}

public SaveStuff()
{
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "%d", Jackpot);
new File: file2 = fopen("stuff.ini", io_write);
fwrite(file2, coordsstring);
fclose(file2);
return 1;
}

1. Is the code ok ?
2. What will happen if i change new coordsstring[256]; 256 to 128 ? nothing ?


Re: Is this ok ? - willsuckformoney - 30.07.2010

1 i believe so 2 nothing


Re: Is this ok ? - mihaitza55 - 30.07.2010

If u change it from 256 to 128 then instead of the maximum letters to be 256, they will be 128
Or, you could simply change it to sizeof(string)


Re: Is this ok ? - willsuckformoney - 30.07.2010

^^^^@@@@


Re: Is this ok ? - mihaitza55 - 30.07.2010

^^^^@@@@ wtf ? )