Saving stats not saving -
Glossy42O - 25.10.2014
Hello. When i get score or cash or somethin else and i do /stats it shows the score etc..
But if i relog it doesn't save them :O
What code do i need to show ya?
Re: Saving stats not saving -
maaz - 25.10.2014
get a good admin system with saving facilities or
Try this out
https://sampforum.blast.hk/showthread.php?tid=270787
https://sampforum.blast.hk/showthread.php?tid=297301
Re: Saving stats not saving -
Glossy42O - 25.10.2014
I already got register login system.. i don't really wanna remove it.
Re: Saving stats not saving -
Crayder - 25.10.2014
Show us your onplayerdisconnect, or at least the part where you save the players stats
Re: Saving stats not saving -
Glossy42O - 25.10.2014
Done
Re: Saving stats not saving -
Crayder - 25.10.2014
Ok, so your using Yini, that looks good i think, how about your onplayerconnect?
Re: Saving stats not saving -
Glossy42O - 25.10.2014
Done
Re: Saving stats not saving -
Crayder - 25.10.2014
Lol, thats looking good too, how about LoadUser callback?
Re: Saving stats not saving -
Glossy42O - 25.10.2014
PHP Code:
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Password",PlayerInfo[playerid][pPass]);
INI_Int("Score", PlayerInfo[playerid][pScore]);
INI_Int("Cash",PlayerInfo[playerid][pCash]);
INI_Int("AdminLevel",PlayerInfo[playerid][pAdmin]);
INI_Int("Kills",PlayerInfo[playerid][pKills]);
INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
return 1;
}
Re: Saving stats not saving -
Crayder - 25.10.2014
You never set the players score when loading. Put this
SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
SetPlayerMoney(playerid, PlayerInfo[playerid][pCash]);
Before the return in the LoadUser callback.
Then report your results after compiling and testing.