Dini bug? - 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: Dini bug? (
/showthread.php?tid=160846)
Dini bug? -
ViruZZzZ_ChiLLL - 17.07.2010
Whenever I /reloadfs, /GMX, and /changemode,
all of my save variable resets or turns into 0.
Why?
Re: Dini bug? -
Donny_k - 17.07.2010
Do you mean all your saved variables in your files are set to zero ?
If this is the case then you either never set values to them correctly or you have a custom function or something which isn't reading/using your variables correctly, either way we would require some code to be able to figure this out as you are pretty vague dude.
Re: Dini bug? -
ViruZZzZ_ChiLLL - 17.07.2010
Well my script is basically like this :
pawn Код:
new example[MAX_PLAYERS];
#define PlayerFile "/Folder/%s.ini"
public OnPlayerConnect(playerid)
{
new file[126];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), PlayerFile, name);
if(!dini_Exists(file))
{
dini_Create(file);
}
example[playerid] = dini_Int(file, "Example");
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new file[126];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), PlayerFile, name);
dini_IntSet(file, "Example", example[playerid]);
return 1;
}
Thanks.
Re: Dini bug? -
Donny_k - 17.07.2010
That's always going to be zero dude.
Read > 0
Write > read value
There is no setting any value to it (example[]) other than the read.