Wrong password -
Glossy42O - 01.11.2014
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?
Re: Wrong password -
gurmani11 - 01.11.2014
• - 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.
Re: Wrong password -
Glossy42O - 01.11.2014
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]);
Re: Wrong password -
silenthill - 01.11.2014
excluded the ip and add again
Re: Wrong password -
gurmani11 - 01.11.2014
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;
}
Re: Wrong password -
Glossy42O - 01.11.2014
omg How i didn't notice it lol.
But the problem it is that it doesn't save score or cash but saves deaths :\
Re: Wrong password -
gurmani11 - 01.11.2014
Show Your Saving data from OnPlayerDisconnect
Edit: And your your Dialog_Login
Re: Wrong password -
Glossy42O - 01.11.2014
PHP код:
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",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(playerid, 1, "{ff0000}[SERVER]{ffffff}: You have successfully logged in !");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_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;
}
Re: Wrong password -
gurmani11 - 01.11.2014
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;
}
Re: Wrong password -
Glossy42O - 01.11.2014
Stats still not saving and my score won't show on TAB