Scores Not saving
#1

when I use the cmd "/setscore amount" the score doesnot gets save in the scriptfile folder. I need help.
Reply
#2

Can you show us your OnPlayerDisconnect ?
Reply
#3

Quote:
Originally Posted by malackovgfx
Посмотреть сообщение
Can you show us your OnPlayerDisconnect ?
PHP код:
ppublic OnPlayerDisconnect(playeridreason)
{
    new 
INI:File INI_Open(UserPath(playerid));
    
INI_SetTag(File,"data");
    
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
    
INI_WriteInt(File,"Scores",PlayerInfo[playerid][pScores]);
    
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
    
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
    
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    
INI_WriteInt(File,"VIP",PlayerInfo[playerid][pVIP]);
    
INI_Close(File);
    return 
1;

Reply
#4

Show us your "setscore" command too.
Reply
#5

EDITED: The one under me found it.
Reply
#6

I have found the problem

instead of this
Quote:

INI_WriteInt(File,"Scores",PlayerInfo[playerid][pScores]);

I have to do this
Quote:

INI_WriteInt(File,"Scores",GetPlayerScore(playerid ));

Reply
#7

lol now another error when I use /setscore it gets save in the script file folder but when I reconnect score becomes 0 again.
Reply
#8

please help
Reply
#9

Just a guess....

I think when you connect your score is loaded as PlayerInfo[playerid][pScores]. You must have to do SetPlayerScore(playerid, PlayerInfo[playerid][pScores]) after loading account info.
Reply
#10

this is my on player connect
PHP код:
public OnPlayerConnect(playerid)
{
    if(
fexist(UserPath(playerid)))
    {
        
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
        
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD,"Login","Type your password below to login.","Login","Quit");
    }
    else
    {
        
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT,"Registering...","Type your password below to register a new account.","Register","Quit");
    }
    return 
1;

is there any error?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)