"Save" in my Timer - 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)
+--- Thread: "Save" in my Timer (
/showthread.php?tid=447009)
"Save" in my Timer -
LeeXian99 - 28.06.2013
Hey guys, I just copied this from OnPlayerDisconnect and when I compile it, it gives me a crash.
Код:
forward Save(playerid);
public Save(playerid);
{
new INI:file = INI_Open(Path(playerid)); //will open their file;
INI_SetTag(file,"Player's Data");//We will set a tag inside of user's account called "Player's Data"
INI_WriteInt(file,"Money",GetPlayerMoney(playerid));//We will save his money inside of his account
INI_WriteInt(file,"Scores",GetPlayerScore(playerid));//We will save his score inside of his account
INI_WriteInt(file,"Kills",pInfo[playerid][Kills]);//As explained above
INI_WriteInt(file,"Deaths",pInfo[playerid][Deaths]);//As explained above
INI_WriteInt(file,"TGoto",pInfo[playerid][Toggoto]);
INI_Close(file);//Now after we've done saving their data, we now need to close the file
return 1;
}
Can you please help me to fix it?
Re: "Save" in my Timer -
CurlyPwn - 28.06.2013
Did you make a emun for it?
Re: "Save" in my Timer -
JaKe Elite - 28.06.2013
How can we help you if we don't know what kind of crash is happening in the callback
Re: "Save" in my Timer -
LeeXian99 - 28.06.2013
It's pawncc.exe crashed.
Re: "Save" in my Timer -
CurlyPwn - 28.06.2013
enum pInfo
{
pMoney,
pScores,
pKills,
pDeaths,
pTogoto
}
Also btw you might have mis spelt
Quote:
INI_WriteInt(file,"TGoto",pInfo[playerid][Toggoto]);
|
TGoto = Toggoto? Double g
Re: "Save" in my Timer -
LeeXian99 - 28.06.2013
I just realized why it does crash, maybe I'm too new in scripting, in fact, its mistake is at
Код:
forward Save(playerid);
public Save(playerid);
It supposed to be:
Код:
forward Save(playerid, name[], value[]);
public Save(playerid, name[], value[])
Sorry for my dummy mistake, I'm learning everyday.