"Save" in my Timer
#1

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?
Reply
#2

Did you make a emun for it?
Reply
#3

How can we help you if we don't know what kind of crash is happening in the callback
Reply
#4

It's pawncc.exe crashed.
Reply
#5

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
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)