help score/money not saving to file - 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: help score/money not saving to file (
/showthread.php?tid=220823)
help score/money not saving to file -
YungGee - 04.02.2011
The score and money is not saving to the file but the levels are plz help heres code
pawn Код:
enum AccInfo
{
LoggedIn,
Registered,
VIP,
Score,
Money,
Level
};
new pInfo[MAX_PLAYERS][AccInfo];
public OnPlayerDisconnect(playerid, reason)
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid,name,sizeof(name));
format(file,sizeof(file),"Admin/Accounts/%s.txt",name);
if(dini_Exists(file))
{
dini_IntSet(file,"LoggedIn",0);
dini_IntSet(file, "Score", pInfo[playerid][Score]);
dini_IntSet(file, "Money", pInfo[playerid][Money]);
dini_IntSet(file, "VIP", pInfo[playerid][VIP]);
dini_IntSet(file, "Level", pInfo[playerid][Level]);
return 1;
}
return 1;
}
Re: help score/money not saving to file -
xRyder - 04.02.2011
Try this:
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid,name,sizeof(name));
format(file,sizeof(file),"Admin/Accounts/%s.txt",name);
new pScore, pMoney;
pScore = GetPlayerScore(playerid);
pMoney = GetPlayerMoney(playerid);
if(dini_Exists(file))
{
dini_IntSet(file,"LoggedIn",0);
dini_IntSet(file, "Score", pScore);
dini_IntSet(file, "Money", pMoney);
dini_IntSet(file, "VIP", pInfo[playerid][VIP]);
dini_IntSet(file, "Level", pInfo[playerid][Level]);
return 1;
}
return 1;
}
Re: help score/money not saving to file -
HyperZ - 04.02.2011
pawn Код:
enum AccInfo
{
LoggedIn,
Registered,
VIP,
Score,
Money,
Level
};
new pInfo[MAX_PLAYERS][AccInfo];
public OnPlayerDisconnect(playerid, reason)
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid,name,sizeof(name));
format(file,sizeof(file),"Admin/Accounts/%s.txt",name);
if(dini_Exists(file))
{
dini_IntSet(file,"LoggedIn",0);
dini_IntSet(file, "Score", GetPlayerScore(playerid));
dini_IntSet(file, "Money", GetPlayerMoney(playerid));
dini_IntSet(file, "VIP",pInfo[playerid][VIP] = 0);
dini_IntSet(file, "Level",pInfo[playerid][Level] = 0);
return 1;
}
return 1;
}