SA-MP Forums Archive
save score in y_ini? - 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 score in y_ini? (/showthread.php?tid=289970)



save score in y_ini? - MonkZemun - 13.10.2011

Hi,i have a problem,i don't know how to save score...
I put this on OnPlayerDisconnect:
PHP код:
INI_WriteInt(File,"Score",GetPlayerScore(playerid)); 
It saves in .ini but when i go relog it restore score to 0..i don't know what is wrong.


Re: save score in y_ini? - Stefans94 - 13.10.2011

you need to load it after relog..
you got LoadUser_data or something like that?


Re: save score in y_ini? - MonkZemun - 13.10.2011

yes i have this:
PHP код:
public LoadUser_data(playerid,name[],value[])
{
    
INI_Int("Password",PlayerInfo[playerid][pPass]);
    
INI_Int("Cash",PlayerInfo[playerid][pCash]);
    
INI_Int("Score",PlayerInfo[playerid][pScore]);
    
INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    
INI_Int("VIP",PlayerInfo[playerid][pVIP]);
    
INI_Int("Kills",PlayerInfo[playerid][pKills]);
    
INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    
INI_Int("Locked",PlayerInfo[playerid][pLocked]);
    
INI_Int("Online",PlayerInfo[playerid][pOnline]);
    return 
1;




Re: save score in y_ini? - SmiT - 13.10.2011

pawn Код:
SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);



Re: save score in y_ini? - MonkZemun - 13.10.2011

Quote:
Originally Posted by SmiT
Посмотреть сообщение
pawn Код:
SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
where to put that? i think thats for dini..?


Re: save score in y_ini? - SmiT - 13.10.2011

It has nothing to do with dini. Put it when the player login.


Re: save score in y_ini? - MonkZemun - 13.10.2011

@SmiT
thank you so much...