11.10.2016, 14:09
Hi guys! I'm looking for a way to load the player's LP after he logs in. Here's the code.
Is there something wrong in this line?
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);
new
tmp2[ 256 ],
playername2[ MAX_PLAYER_NAME ]
;
GetPlayerName(playerid, playername2, sizeof(playername2));
format(tmp2, sizeof(tmp2), "~w~Welcome ~n~~g~%s", playername2);
GameTextForPlayer(playerid, tmp2, 5000, 1);
GivePlayerCash(playerid, PlayerInfo[playerid][pCash]);
PlayerInfo[playerid][pLearn] = INI_Int("pLearn",PlayerInfo[playerid][pLearn]);
SetSpawnInfo(playerid, PlayerInfo[playerid][pSpecial], PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], 1.0, -1, -1, -1, -1, -1, -1);
SpawnPlayer(playerid);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","You have entered an incorrect password.\nType your password below to login.","Login","Quit");
}
return 1;
}
}
}
return 1;
}
Код:
PlayerInfo[playerid][pLearn] = INI_Int("pLearn",PlayerInfo[playerid][pLearn]);