Wrong password
#1

Hey everyone.

I have changed something in my GM so it will save cash/score

I wanted to test it but everytime i connect it says "Incorrect password"

What code do i need to give?
Reply
#2

• - Are you saving the stats in onplayerdisconnect ? & no other way?
because you have shut down your server improperly and it did not save the player's Password.
Reply
#3

The only thing i added before that was

PHP код:
forward LoadUser_data(playerid,name[],value[]);
public 
LoadUser_data(playerid,name[],value[])
{
    
INI_Int("Cash",PlayerInfo[playerid][pAdmin]);
    
INI_Int("Cash",PlayerInfo[playerid][pCash]);
    
INI_Int("Score",PlayerInfo[playerid][pScore]);
    
INI_Int("Kills",PlayerInfo[playerid][pKills]);
    
INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    return 
1;

And this on DialogResponse
PHP код:
                    SetPlayerScore(playerid,PlayerInfo[playerid][pScore]);
                    
GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]); 
Reply
#4

excluded the ip and add again
Reply
#5

pawn Код:
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][pPass]); // you have not even loaded password
   INI_Int("Cash",PlayerInfo[playerid][pAdmin]);
    INI_Int("Cash",PlayerInfo[playerid][pCash]);
    INI_Int("Score",PlayerInfo[playerid][pScore]);
    INI_Int("Kills",PlayerInfo[playerid][pKills]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    return 1;
}
Reply
#6

omg How i didn't notice it lol.


But the problem it is that it doesn't save score or cash but saves deaths :\
Reply
#7

Show Your Saving data from OnPlayerDisconnect
Edit: And your your Dialog_Login
Reply
#8

PHP код:
public OnPlayerDisconnect(playeridreason)
{
    
SetPlayerScore(playeridPlayerInfo[playerid][pScore]);
    
GivePlayerMoney(playeridPlayerInfo[playerid][pCash]);
    new 
INI:File INI_Open(UserPath(playerid));
    
INI_SetTag(File,"data");
    
INI_WriteInt(File"Money"GetPlayerMoney(playerid));
    
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
    
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
    
INI_WriteInt(File,"Score",PlayerInfo[playerid][pScore]);
    
INI_Close(File);
    
IsPlayerPolice[playerid] =0;
    return 
1;

PHP код:
case DIALOG_LOGIN:
        {
            if ( !
response ) return Kick playerid );
            if( 
response )
            {
                if(
udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
                    
SetPlayerScore(playerid,PlayerInfo[playerid][pScore]);
                    
GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]);
                    
SendClientMessage(playerid1"{ff0000}[SERVER]{ffffff}: You have successfully logged in !");
                }
                else
                {
                    
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT,""COL_WHITE"{FF0000}>>|{00CC00}Please Login{FF0000}|<<",""COL_RED"You have entered an incorrect password or you didn't put password at all.\n"COL_WHITE"Type your password below to login.","Login","Quit");
                }
                return 
1;
            }
        }
    }
    return 
1;

Reply
#9

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File, "Money", GetPlayerMoney(playerid));
    INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
    INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
    INI_WriteInt(File,"Score",GetPlayerScore(playerid));
    INI_Close(File);
    IsPlayerPolice[playerid] =0;
    return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason); // death message probably you have it already
        SetPlayerScore(killerid,GetPlayerScore(killerid)+1) // Setting player score to 1 you can increase it
    PlayerInfo[killerid][pKills] ++; // Killer will get kills increased
    PlayerInfo[playerid][pDeaths] ++; // Dier will Get deaths increased
    return 1;
}
Reply
#10

Stats still not saving and my score won't show on TAB
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)