Saving stats not saving
#1

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

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

I already got register login system.. i don't really wanna remove it.
Reply
#4

Show us your onplayerdisconnect, or at least the part where you save the players stats
Reply
#5

Done
Reply
#6

Ok, so your using Yini, that looks good i think, how about your onplayerconnect?
Reply
#7

Done
Reply
#8

Lol, thats looking good too, how about LoadUser callback?
Reply
#9

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;

Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)