Quote:
Originally Posted by Kush
This is because you need to GivePlayerMoney. Remember, the LoadUser_data function simply loads the values, but that doesn't mean it will give you your money, nor will it give you weapons if you don't tell it what to do.
Try something like this:
PHP Code:
forward OnPlayerLogin(playerid);
public OnPlayerLogin(playerid)
{
GivePlayerCash(playerid, PlayerInfo[playerid][pCash]);
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
return 1;
}
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""EMBED_WHITE"Login",""EMBED_RED"You have entered an incorrect password.\n"EMBED_WHITE"Type your password below to login.","Login","Quit");
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(PlayerPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
OnPlayerLogin(playerid); //here
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""EMBED_WHITE"Login",""EMBED_RED"You have entered an incorrect password.\n"EMBED_WHITE"Type your password below to login.","Login","Quit");
}
}
}
That would work.
|
That is not the answer for my question.
It does not save the money when I disconnect. The value does not change in the .ini file.
Thats the problem.
But i dunno how to fix it.